Giter Site home page Giter Site logo

easymirror's Introduction

easymirror

进行时间序列数据库的索引同步

说明

  1. easymirror使用Redis作为消息转发。
  2. 实盘实时对齐使用easymirror.mirror.Mirror类实现(未完成);盘后对齐使用easymirror.canine.Canine实现。
  3. 多个相同的行情录入程序可以在盘中(未实现)、盘后对齐缺失的 tick 数据。

环境

将仓库clone到本地后,运行以下命令安装:

pip install -e .

配置文件

主要的配置文件是conf/conf.json。 导出配置文件

import easymirror as em
em.dumpconf() # 将相关配置文件导出到当前目录

Redis

  1. 这里Redis使用的端口是23002,对应的Redis配置文件是redis.conf
  2. 基本上只需要简单地配置一下端口号和异地访问密码即可。
  3. 生产环境下,在公网部署部署该Redis服务。
  4. 各个节点的conf.json文件中指向该Redis主机的 host

使用

  1. 实盘中对齐
  2. 盘后对齐
  3. 二次开发

1. 实盘中对齐(未实现)

  1. demo见debug.py文件。
  2. 在子进程中建立服务后,通过api.pushTickerIndex接口推入Ticker数据。
  3. 代码基于python3.5的协程来实现。如果实盘数据录入不是python3.5以上,那么只能使用盘后对齐的功能

2. 盘后对齐

  1. demo见makeup_vnpy.py
  2. 服务分成子线程queryAskThread用于响应对齐数据。
  3. 本地对齐业务由run完成。

3. 二次开发

参考easymirror._vnpy.py,通过继承easymirro.canine.Canine来重写部分接口。针对具体的数据库,进一步封装改子类。

easymirror's People

Contributors

lamter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.