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:
dekun
2026-07-05 00:30:49 +08:00
parent 65b911994c
commit c0ad50a7b5
22 changed files with 814 additions and 35 deletions
+5
View File
@@ -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: