feat: 账户方向与币种白名单 env 开关(三所)
Per-instance TRADE_DIRECTION / TRADE_SYMBOL_WHITELIST restricts UI and API for manual orders, key monitors, and strategies; includes sync script for deployment profiles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -257,6 +257,11 @@ def precheck_trend_start(cfg: dict, conn, *, symbol: str = "", direction: str =
|
||||
pass
|
||||
sym = (symbol or "").strip()
|
||||
dir_l = (direction or "long").strip().lower()
|
||||
validate_fn = getattr(m, "validate_trade_policy_open", None)
|
||||
if callable(validate_fn) and sym:
|
||||
ok_pol, pol_msg = validate_fn(sym, dir_l)
|
||||
if not ok_pol:
|
||||
return False, pol_msg
|
||||
if sym and dir_l in ("long", "short") and hasattr(m, "precheck_risk"):
|
||||
ok_risk, risk_msg = m.precheck_risk(conn, sym, dir_l)
|
||||
if not ok_risk:
|
||||
|
||||
Reference in New Issue
Block a user