vn.py量化社区
By Traders, For Traders.
Member
加入于:
帖子: 34
声望: 1

前日看vnpy更新了,非常感谢作者大神更新了下我上次发帖提的ctp二代行情的接口。有个问题想请教下:
if data["BidPrice2"]:
tick.bid_price_2 = data["BidPrice2"]
tick.bid_price_3 = data["BidPrice3"]
tick.bid_price_4 = data["BidPrice4"]
tick.bid_price_5 = data["BidPrice5"]
tick.ask_price_2 = data["AskPrice2"]
tick.ask_price_3 = data["AskPrice3"]
tick.ask_price_4 = data["AskPrice4"]
tick.ask_price_5 = data["AskPrice5"]
tick.bid_volume_2 = data["BidVolume2"]
tick.bid_volume_3 = data["BidVolume3"]
tick.bid_volume_4 = data["BidVolume4"]
tick.bid_volume_5 = data["BidVolume5"]
tick.ask_volume_2 = data["AskVolume2"]
tick.ask_volume_3 = data["AskVolume3"]
tick.ask_volume_4 = data["AskVolume4"]
tick.ask_volume_5 = data["AskVolume5"]

我看代码里这段似乎是只有当bp2>0时才会赋值五档行情,但行情有时会出现跌停的情况,导致bp2==0,此时ap这边是有五档的,这样处理是否会导致跌停的时候只有一档行情呢?我感觉可以data["BidPrice2"]和data["AskPrice2"]分别判断,来赋值。希望作者大神看下,谢谢。

Administrator
avatar
加入于:
帖子: 4117
声望: 229

有道理,方便的话在Github开个issue吧,我们来处理下

Member
加入于:
帖子: 34
声望: 1

已经开好了,谢谢!

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3