1 Star 0 Fork 67

qbjstone / pyctp

forked from 海风 / pyctp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test_quote.py 579 Bytes
一键复制 编辑 原始数据 按行查看 历史
海风 提交于 2022-09-12 17:47 . 更新: 基于 v6.6.8 封装
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__title__ = 'test py ctp of se'
__author__ = 'HaiFeng'
__mtime__ = '2022/09/11'
from py_ctp.quote import CtpQuote
from py_ctp.enums import *
def onLogin(obj, info):
print(info)
obj.ReqSubscribeMarketData(["rb2210","rb2301"])
def main():
q = CtpQuote()
q.OnConnected = lambda obj: q.ReqUserLogin("008105", "1", "9999")
q.OnUserLogin = onLogin
q.OnTick = lambda obj, t : print(t)
q.ReqConnect('tcp://180.168.146.187:10131')
input()
q.Release()
input()
if __name__ == '__main__':
main()
Python
1
https://gitee.com/qbjstone/pyctp.git
git@gitee.com:qbjstone/pyctp.git
qbjstone
pyctp
pyctp
master

搜索帮助