add launcher
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user