进行时间序列数据库的索引同步
easymirror
使用Redis作为消息转发。- 实盘实时对齐使用
easymirror.mirror.Mirror
类实现(未完成);盘后对齐使用easymirror.canine.Canine
实现。 - 多个相同的行情录入程序可以在盘中(未实现)、盘后对齐缺失的 tick 数据。
将仓库clone
到本地后,运行以下命令安装:
pip install -e .
主要的配置文件是conf/conf.json
。
导出配置文件
import easymirror as em
em.dumpconf() # 将相关配置文件导出到当前目录
- 这里
Redis
使用的端口是23002,对应的Redis
配置文件是redis.conf
。 - 基本上只需要简单地配置一下端口号和异地访问密码即可。
- 生产环境下,在公网部署部署该
Redis
服务。 - 各个节点的
conf.json
文件中指向该Redis
主机的 host 。
- 实盘中对齐
- 盘后对齐
- 二次开发
- demo见
debug.py
文件。 - 在子进程中建立服务后,通过
api.pushTickerIndex
接口推入Ticker数据。 - 代码基于
python3.5
的协程来实现。如果实盘数据录入不是python3.5
以上,那么只能使用盘后对齐
的功能
- demo见
makeup_vnpy.py
。 - 服务分成子线程
queryAskThread
用于响应对齐数据。 - 本地对齐业务由
run
完成。
参考easymirror._vnpy.py
,通过继承easymirro.canine.Canine
来重写部分接口。针对具体的数据库,进一步封装改子类。