Giter Club home page Giter Club logo

ctp_real_md's Introduction

tick_from_ctp

项目介绍

使用ctp api接收行情生成实时分钟数据保存到redis

Dockerfile

FROM haifengat/centos:8.2
COPY *.py /home/
COPY *.txt /home/
# docker-compose
COPY *.yml /home/
# COPY pgdata.tgz /home/ 改用csv
COPY *.csv /home/
RUN pip install --no-cache-dir -r /home/requirements.txt
ENV redis_addr 172.19.129.98:16379
ENV front_trade tcp://180.168.146.187:10101
ENV front_quote tcp://180.168.146.187:10111
ENV login_info 008105/1/9999/simnow_client_test/0000000000000000
ENTRYPOINT ["python", "/home/tick_ctp.py"]
version: "3.7"
services:
    real_md:
    image: haifengat/ctp_real_md
    container_name: real_md
    restart: always
    environment:
        - "TZ=Asia/Shanghai"
        - "redis_addr=redis_tick:6379"
        - "front_trade=tcp://180.168.146.187:10101"
        - "front_quote=tcp://180.168.146.187:10111"
        - "login_info=008105/1/9999/simnow_client_test/0000000000000000"
    depends_on:
        - redis_tick

    redis_tick:
        image: redis:6.0.8-alpine3.12
        container_name: redis_tick
        restart: always
        environment:
            - TZ=Asia/Shanghai
        # ports:
        #     - "16379:6379"

build

# 通过github git push触发 hub.docker自动build
docker pull haifengat/ctp_real_md && docker tag haifengat/ctp_real_md haifengat/ctp_real_md:`date +%Y%m%d` && docker push haifengat/ctp_real_md:`date +%Y%m%d`

docker-compose.yaml

version: '3.1'
services:
  real_md:
    image: haifengat/ctp_real_md
    container_name: real_md
    restart: always
    environment:
      - "TZ=Asia/Shanghai"
      - "redis_addr=redis_tick:6379"
      - "front_trade=tcp://180.168.146.187:10101"
      - "front_quote=tcp://180.168.146.187:10111"
      - "login_info=008105/1/9999/simnow_client_test/0000000000000000"
    depends_on:
      - redis_tick

  redis_tick:
    image: redis:6.0.5
    container_name: redis_tick
    restart: always
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "16379:6379"   

使用

查看redis数据

$ docker exec -it redis_tick bash
>> redis-cli
>>> keys *
>>> lrange ${instrument} 0 -1

ctp_real_md's People

Contributors

hubertwu1976 avatar

Watchers

James Cloos avatar 海风 avatar  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.