This commit is contained in:
2026-09-17 10:09:57 +08:00
parent e9a7ad9f77
commit 1962d3f8a7

View File

@@ -130,7 +130,7 @@ def handle_profit(
f"突破, PNL:{pnl_rate:.2f}%,网格={observation.current_grid}", f"突破, PNL:{pnl_rate:.2f}%,网格={observation.current_grid}",
) )
if observation.state == GridState.STEADY: 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"): if runtime.orders.busy(position.stock_code, "SELL"):
return TradeDecision(False, "卖出委托处理中") return TradeDecision(False, "卖出委托处理中")
@@ -163,7 +163,7 @@ def handle_loss(
hands=int(position.volume / 100), market_value=position.market_value hands=int(position.volume / 100), market_value=position.market_value
) )
if add_num >= len(LOSS_TIERS) or add_num < 0: 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]: if pnl_rate > LOSS_TIERS[add_num]:
return TradeDecision(False) return TradeDecision(False)
if tick.last_price > 200 or position.market_value >= 20_000: if tick.last_price > 200 or position.market_value >= 20_000: