openctp-ctp-python icon indicating copy to clipboard operation
openctp-ctp-python copied to clipboard

CTPAPI的Python接口,使用Swig技术制作,支持pip install。

Results 11 openctp-ctp-python issues
Sort by recently updated
recently updated
newest added

行情demo如果需要登录,要怎么写?

在我的理解中,如果要运行腾讯行情,只能采取手动安装的模式。 ## 代码部分 所以为了在docker里运行一个基于腾讯行情的采集服务,现手动安装6.6.1的ctp-python文件([路径](https://github.com/openctp/openctp-ctp-python/tree/main/6.6.1_P1_20210406/linux64))至目录openctp/linux,在同目录里导入ctp项目中的qq行情thostmduserapi_se.so库文件([[路径](https://github.com/openctp/openctp/tree/master/ctp2QQ/6.6.1_P1_20210406/lin64)])。 代码中,调用方式如下: ```python from openctp.linux.thostmduserapi import CThostFtdcDepthMarketDataField, CThostFtdcMdSpi, CThostFtdcReqUserLoginField, CThostFtdcSpecificInstrumentField, CThostFtdcRspInfoField, CThostFtdcRspUserLoginField, CThostFtdcMdApi ```` 运行报错: ```shell File "/openctp/linux/thostmduserapi.py", line 46, in from . import _thostmduserapi ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6:...

运行时报错,啥原因啊: semaphore.release() NameError: name 'semaphore' is not defined 有没有QQ群交流呢?

客户端版本:6.7.2 7*24小时模拟环境 前置地址: openctp.cn:20004 日志: OnRspOrderInsert failed: 合约不存在 OnRspOrderInsert:UserID=xxxxx BrokerID=10010 InvestorID=12081 ExchangeID=DCE InstrumentID= Direction=0 ... 可以看到,返回的错误信息中InstrumentID为空,但是请求中确实填写了InstrumentID,并且连接其他前置如华鑫证券奇点,同样的代码,就可以报单成功

generate swig wrap files ... /mnt/e/ctp/openctp-ctp-python/CTPAPI/linux/ThostFtdcTraderApi.h:30: Warning 514: Director base class CThostFtdcTraderSpi has no virtual destructor. /mnt/e/ctp/openctp-ctp-python/CTPAPI/linux/ThostFtdcMdApi.h:30: Warning 514: Director base class CThostFtdcMdSpi has no virtual destructor. -- Configuring done...

![image](https://github.com/user-attachments/assets/9a27ac8c-533d-476f-921e-7182a7204e91) CMakeLists.txt中有一行重复的if你们是怎么编译通过的哈哈

您好, 请问td.ReqQryClassifiedInstrument为什么查询不到最新上市的品种?比如原木lg和多晶硅ps? ``` field = tdapi.CThostFtdcQryClassifiedInstrumentField() field.InstrumentID = contract # 这里填lg,LG,ps,PS, 都找不到。最新的可以找到的品种是瓶片PR field.ExchangeID = '' field.TradingType = tdapi.THOST_FTDC_TD_ALL field.ClassType = tdapi.THOST_FTDC_INS_FUTURE td.ReqQryClassifiedInstrument(field, reqid) ```

订阅全部品种行情后就断开连接,接着重新订阅再断开,不停重复 CThostFtdcUserApiImplBase::OnSessionDisconnected[00000292EFCFFC88][155123723][ 8193] OnFrontDisconnected.[nReason=8193] OnFrontConnected

刚下载下来,第一次下单成功了,但后面每次下单都是失败,用的simNow的账号,走的simNow电信1仿真通道,后续自己重新用原版td_demo,也是不行, 输入参数这样的,交易什么的都是连接上的 TdImpl("tcp://180.168.146.187:10201", "9999", "234137", "保密", "simnow_client_test", "0000000000000000") tdImpl.OrderInsert(ExchangeID="DCE", InstrumentID="pp2501", Direction="0", Offset="0", PriceType="2", Price=7450, Volume=2, TimeCondition="3", VolumeCondition="3", MinVolume=1) tdImplr.OrderInsert(ExchangeID="SHFE", InstrumentID="rb2505", Direction="0", Offset="0", PriceType="2", Price=3320, Volume=2, TimeCondition="3", VolumeCondition="3", MinVolume=1) ![0e8f08f246ee8cc4c51cd00a5f6126e6](https://github.com/user-attachments/assets/5615e79b-f515-4fc7-b7df-f5a761f80c39)