取消对策略持仓pos字段的修改。改为由策略内部自行更新。

This commit is contained in:
msincenselee 2017-05-07 18:54:24 +08:00
parent 8b7d373359
commit 076c573d1e

View File

@ -415,11 +415,11 @@ class CtaEngine(object):
# 3.提取对应的策略
strategy = self.orderStrategyDict[trade.vtOrderID]
# 计算策略持仓
if trade.direction == DIRECTION_LONG:
strategy.pos += trade.volume
else:
strategy.pos -= trade.volume
# 计算策略持仓 ( canceled by IncenseLee )
#if trade.direction == DIRECTION_LONG:
# strategy.pos += trade.volume
#else:
# strategy.pos -= trade.volume
self.callStrategyFunc(strategy, strategy.onTrade, trade)