一个简单、易用、面向中国股市实盘的python量化交易框架
Project description
vxquant
介绍
一个简单、易用、面向中国股市实盘的python量化交易框架
模块架构
vxquant 包括以下三个模块:
- vxquant -- 量化交易中的标准化组件
- vxsched -- 基于事件驱动的调度器实现
- vxutils -- 各种常用的python小功能
安装教程
- 通过 pip 安装
pip install vxquant
- 通过源代码安装
git clone https://gitee.com/vxquant/vxquant && cd vxquant/
pip install .
使用说明
- 策略文件目录
# 配置文件存放在 etc/ 目录中
etc/config.json
# 日志文件存放在 log/ 目录中
log/vxquant.log
# 策略文件存放在 mod/ 目录中
mod/
demo1.py
demo2.py
demo3.py
- demo1.py
"""策略demo 1 """
from vxsched import vxengine, vxEvent, vxContext, logger
@vxengine.event_handler("__init__")
def demo1_init(context: vxContext, event: vxEvent) -> None:
"""策略初始化"""
logger.info(f"title内容: {context.settings.title}")
@vxengine.event_handler("every_tick")
def demo1_every_tick(context: vxContext, event: vxEvent) -> None:
"""每个tick事件触发"""
logger.info(f"触发时间: {event.type}")
- 运行策略
python -m vxsched -s worker -c etc/config.json -m mod/
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vxquant-2023.4.1.tar.gz
(150.7 kB
view details)
Built Distribution
vxquant-2023.4.1-py3-none-any.whl
(196.7 kB
view details)
File details
Details for the file vxquant-2023.4.1.tar.gz
.
File metadata
- Download URL: vxquant-2023.4.1.tar.gz
- Upload date:
- Size: 150.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54229e24ca1eda5866a5d17d9d94295051167817a6e64123f9103521ce62c387 |
|
MD5 | 7ac0704e8dac676040f54caec0474280 |
|
BLAKE2b-256 | 5dee63adc252212506604dcbe517597a61fe4bf4ba1434dbad77d3f7bb629365 |
File details
Details for the file vxquant-2023.4.1-py3-none-any.whl
.
File metadata
- Download URL: vxquant-2023.4.1-py3-none-any.whl
- Upload date:
- Size: 196.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8226d621e3bef2ad8a546fcf44cb5c03eac6e557740be3f2cac261c820c791 |
|
MD5 | 56aec05de8992706fa10cfad7fd92cf0 |
|
BLAKE2b-256 | dc076c94232da4f30f9b9ed821f5235e76f2cce17ee4fd23026a27548e1b038c |