Wednesday, June 20, 2018

china futures ctp realtime server docker image description

what
used this docker image,to receive china futures ctp realtime data.

How

1. docker:
docker image see: https://hub.docker.com/r/pkrss/ctp-market/

docker template:
    image: docker.io/pkrss/ctp-market:latest
    environment: (change below values if your need)
      - users.simnow.mdInvesterID="{your account id, liked 065206}"
      - users.simnow.mdInvesterPassword="{your simnow password}"
      - users.simnow.mdBrokerID="9999"
      - users.simnow.mdFrontAddr="tcp://218.202.237.33:10012"
      - users.simnow.mdInvesterPassword="tcp://218.202.237.33:10002"
      - sys_log_filePath=
      - sys_wsSrv_port=8086

2. web socket client:
websocket client docker ip:8086, send json string to regist realtime data:
{"cat": "quote","oper": "realtime", "data", {"stk":"*"}}
you can change * to your want symbol, liked: "rb1809".
After that your can receive multiple realtime data liked:
{"data":{"time":1529452800,"id":"rb1809","name":"螺纹钢1809","price":3911.0,"open":3850.0,"prevClose":3861.0,"close":null,"difVol":0,"vol":4810,"updnPrice":28,"updnPricePer":0.721,"positions":6408,"settlement":3881.0,"prevSettlement":3883.0,"high":3915.0,"low":3845.0,"buy1":3900.0,"sell1":3912.0,"buy1vol":5,"sell1vol":2},"cat":"quote","oper":"realtime"}


Last
Thanks!

No comments: