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:
@@ -277,6 +277,11 @@ def _roll_context(cfg: dict, data: dict) -> tuple[Optional[dict], Optional[str]]
|
||||
if not symbol:
|
||||
return None, "请选择或填写币种"
|
||||
direction = (data.get("direction") or "long").strip().lower()
|
||||
validate_fn = getattr(m, "validate_trade_policy_open", None) if m is not None else None
|
||||
if callable(validate_fn):
|
||||
ok_pol, pol_msg = validate_fn(symbol, direction)
|
||||
if not ok_pol:
|
||||
return None, pol_msg
|
||||
ex_sym = cfg["normalize_exchange_symbol"](symbol)
|
||||
conn = get_db()
|
||||
init_strategy_tables(conn)
|
||||
|
||||
Reference in New Issue
Block a user