[Mod] add depth volume for OesGateway, close #2112

This commit is contained in:
vn.py 2019-11-07 15:58:53 +08:00
parent 7e30f9fabc
commit 4e966a4bdb

View File

@ -144,8 +144,10 @@ class OesMdMessageLoop:
for i in range(min(data.BidPriceLevel, 5)):
tick.__dict__['bid_price_' + str(i + 1)] = data.BidLevels[i].Price / 10000
tick.__dict__['bid_volume_' + str(i + 1)] = data.BidLevels[i].QrderQty / 100
for i in range(min(data.OfferPriceLevel, 5)):
tick.__dict__['ask_price_' + str(i + 1)] = data.OfferLevels[i].Price / 10000
tick.__dict__['ask_volume_' + str(i + 1)] = data.OfferLevels[i].QrderQty / 100
self.gateway.on_tick(copy(tick))
def on_init_tick(self, d: MdsMktRspMsgBodyT):
@ -160,8 +162,10 @@ class OesMdMessageLoop:
for i in range(5):
tick.__dict__['bid_price_' + str(i + 1)] = data.BidLevels[i].Price / 10000
tick.__dict__['bid_volume_' + str(i + 1)] = data.BidLevels[i].QrderQty / 100
for i in range(5):
tick.__dict__['ask_price_' + str(i + 1)] = data.OfferLevels[i].Price / 10000
tick.__dict__['ask_volume_' + str(i + 1)] = data.OfferLevels[i].QrderQty / 100
self.gateway.on_tick(copy(tick))
def on_l2_trade(self, d: MdsMktRspMsgBodyT):