add launcher

This commit is contained in:
2026-09-17 15:10:46 +08:00
parent 1962d3f8a7
commit a2b0bba05f
10 changed files with 778 additions and 3 deletions

View File

@@ -166,6 +166,11 @@ def handle_loss(
return TradeDecision(False, f"次数无效:{add_num}")
if pnl_rate > LOSS_TIERS[add_num]:
return TradeDecision(False)
all_codes = runtime.server_inital.get("all_codes") or []
if position.stock_code not in all_codes:
return TradeDecision(False, "不在服务端初始化股票池内,禁止补仓")
if tick.last_price > 200 or position.market_value >= 20_000:
return TradeDecision(False, "价格或仓位市值超过补仓限制")
if not runtime.add_watch.triggered("补仓", position.stock_code, tick.last_price):