取消对策略持仓pos字段的修改。改为由策略内部自行更新。
This commit is contained in:
parent
8b7d373359
commit
076c573d1e
@ -415,11 +415,11 @@ class CtaEngine(object):
|
|||||||
# 3.提取对应的策略
|
# 3.提取对应的策略
|
||||||
strategy = self.orderStrategyDict[trade.vtOrderID]
|
strategy = self.orderStrategyDict[trade.vtOrderID]
|
||||||
|
|
||||||
# 计算策略持仓
|
# 计算策略持仓 ( canceled by IncenseLee )
|
||||||
if trade.direction == DIRECTION_LONG:
|
#if trade.direction == DIRECTION_LONG:
|
||||||
strategy.pos += trade.volume
|
# strategy.pos += trade.volume
|
||||||
else:
|
#else:
|
||||||
strategy.pos -= trade.volume
|
# strategy.pos -= trade.volume
|
||||||
|
|
||||||
self.callStrategyFunc(strategy, strategy.onTrade, trade)
|
self.callStrategyFunc(strategy, strategy.onTrade, trade)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user