fix bug
This commit is contained in:
@@ -130,7 +130,7 @@ def handle_profit(
|
||||
f"突破, PNL:{pnl_rate:.2f}%,网格={observation.current_grid}",
|
||||
)
|
||||
if observation.state == GridState.STEADY:
|
||||
return TradeDecision(False,f"持平, PNL:{pnl_rate:.2f}%,网格={observation.current_grid}",)
|
||||
return TradeDecision(False,f"持平,网格={observation.current_grid}",)
|
||||
if runtime.orders.busy(position.stock_code, "SELL"):
|
||||
return TradeDecision(False, "卖出委托处理中")
|
||||
|
||||
@@ -163,7 +163,7 @@ def handle_loss(
|
||||
hands=int(position.volume / 100), market_value=position.market_value
|
||||
)
|
||||
if add_num >= len(LOSS_TIERS) or add_num < 0:
|
||||
return TradeDecision(False, f"补仓次数无效:{add_num}")
|
||||
return TradeDecision(False, f"次数无效:{add_num}")
|
||||
if pnl_rate > LOSS_TIERS[add_num]:
|
||||
return TradeDecision(False)
|
||||
if tick.last_price > 200 or position.market_value >= 20_000:
|
||||
|
||||
Reference in New Issue
Block a user