一个简单、易用、面向中国股市实盘的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-2022.12.21.tar.gz
(80.4 kB
view details)
Built Distribution
vxquant-2022.12.21-py3-none-any.whl
(107.2 kB
view details)
File details
Details for the file vxquant-2022.12.21.tar.gz
.
File metadata
- Download URL: vxquant-2022.12.21.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02cae895d79ab11e65d75b8b616683459b831c5dfe1fedce7e22210d7f9e62ec |
|
MD5 | 08d81a54e3c95ac0d38fda4c740677b7 |
|
BLAKE2b-256 | c9418230a5307a5c12bf4cea56a3011c7fc7ec4fcec8ef211a8ae0bce5c74f1b |
File details
Details for the file vxquant-2022.12.21-py3-none-any.whl
.
File metadata
- Download URL: vxquant-2022.12.21-py3-none-any.whl
- Upload date:
- Size: 107.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3663a6c1cecfcbaa19f68d2e4d2bc51b9d2f040a6a8b578059db35b609609d0 |
|
MD5 | 5157fb73b67984909e0641dfc4b2b5de |
|
BLAKE2b-256 | d6e3b0569770c5cfadec3d828a817ba03963e2ada9a8755324102c9addd22bd6 |