中控条件开仓单:客户端本地监控穿越/偏离区并按本机规则开平仓。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -130,7 +130,7 @@ def build_options_hub_snapshot(cfg: dict[str, Any]) -> dict[str, Any]:
|
||||
except Exception:
|
||||
open_bridges = []
|
||||
|
||||
return {
|
||||
out = {
|
||||
"ok": True,
|
||||
"enabled": True,
|
||||
"positions": positions,
|
||||
@@ -153,6 +153,23 @@ def build_options_hub_snapshot(cfg: dict[str, Any]) -> dict[str, Any]:
|
||||
"coin_budget": coin_budget,
|
||||
"bridge_status": bridge_status,
|
||||
"open_bridges": open_bridges,
|
||||
"cond_order_locked": False,
|
||||
"cond_orders_active": [],
|
||||
}
|
||||
try:
|
||||
from lib.options.options_cond_order_lib import has_active_cond_order, list_cond_orders
|
||||
|
||||
conn_c = cfg["get_db"]()
|
||||
try:
|
||||
from lib.options.options_db import init_options_tables
|
||||
|
||||
init_options_tables(conn_c)
|
||||
out["cond_order_locked"] = has_active_cond_order(conn_c)
|
||||
out["cond_orders_active"] = list_cond_orders(conn_c, active_only=True)
|
||||
finally:
|
||||
conn_c.close()
|
||||
except Exception:
|
||||
pass
|
||||
return out
|
||||
except Exception as e:
|
||||
return {"ok": False, "enabled": True, "msg": str(e)}
|
||||
|
||||
Reference in New Issue
Block a user