openctp / openctp-ctp-python

CTPAPI的Python接口,使用Swig技术制作,支持pip install。
http://www.openctp.cn
BSD 3-Clause "New" or "Revised" License
122 stars 23 forks source link

Mac下PIP版本登录函数声明与示例不一致 #20

Closed shadowy closed 2 months ago

shadowy commented 2 months ago

目前mac下pip可安装的最新版本是6.7.2.3,按照交易示例td_demo里所写, 登录代码为:self.api.ReqUserLogin(req, 0) 但目前mac安装的pip该函数声明为

def ReqUserLogin(self, pReqUserLoginField: "CThostFtdcReqUserLoginField", nRequestID: "int", length: "TThostFtdcSystemInfoLenType", systemInfo: "TThostFtdcClientSystemInfoType") -> "int":
            return _thosttraderapi.CThostFtdcTraderApi_ReqUserLogin(self, pReqUserLoginField, nRequestID, length, systemInfo)

相比调用代码多了最后两个参数length和systemInfo。 我查看了目前最新的源代码,这个函数已经都是三参数版本了,所以mac下如何调用这个函数呢,还是等更新新版本的pip?谢谢。

Jedore commented 2 months ago

@shadowy 参考这个吧 🧑‍💻

shadowy commented 2 months ago

修改可用了,谢谢J大