Fix perp manual order watch_entry bug; slim dialog UI; nav shows 永期/期期.
Manual market_order was validated as watch (missing watch_entry=0). Collapse order calc into details, remove page head card, show mode name in nav. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1180,11 +1180,13 @@ def validate_start_body(plan_type: str, body: dict[str, Any]) -> Optional[str]:
|
||||
if is_option_primary(body):
|
||||
from lib.hedge_plan.hedge_plan_option_primary_lib import validate_option_primary_watch
|
||||
|
||||
# 以期权为主默认盯盘启动(非现场开仓);显式 watch_entry=0 才走即开校验
|
||||
# 手动下单(market_order)或显式 watch_entry=0 → 即开校验;否则盯盘
|
||||
market = body.get("market_order") in (True, 1, "1", "true", "yes", "on")
|
||||
watch = body.get("watch_entry")
|
||||
if watch in (None, "", True, 1, "1", "true", "yes", "on"):
|
||||
return validate_option_primary_watch(body)
|
||||
return validate_option_primary_start(body)
|
||||
watch_off = watch in (False, 0, "0", "false", "no", "off")
|
||||
if market or watch_off:
|
||||
return validate_option_primary_start(body)
|
||||
return validate_option_primary_watch(body)
|
||||
need = ("direction", "entry", "tp", "sl", "contracts", "opt_inst_id", "sheets", "exchange_symbol")
|
||||
for k in need:
|
||||
if body.get(k) in (None, ""):
|
||||
|
||||
Reference in New Issue
Block a user