Skip to content

Commit d8ff44a

Browse files
committed
优化开仓逻辑计算
1 parent caa877d commit d8ff44a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trader/strategy/brother2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ async def OnRtnTrade(self, channel, trade: dict):
442442
direction=DirectionType.values[trade['Direction']],
443443
open_time=trade_time, shares=order.volume if order else trade['Volume'], cost=trade_cost,
444444
filled_shares=trade['Volume'], avg_entry_price=trade['Price'], frozen_margin=trade_margin)
445-
if order is None or order.volume == trade['Volume']:
445+
if order is None or order.status == OrderStatus.values[OrderStatus.AllTraded]:
446446
trade_completed = True
447447
if (not new_trade and not manual_trade) or (trade_completed and not new_trade and manual_trade):
448448
last_trade.avg_entry_price = \

0 commit comments

Comments
 (0)