Add OKX three-way trade mode for options vs hedge.

Env OKX_TRADE_MODE selects standalone options, perp hedge, or OO hedge; hide the other module UI and use group or position limits per mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-30 08:28:50 +08:00
parent f9c2a63cbc
commit 83ce50b24e
11 changed files with 417 additions and 69 deletions
+9 -3
View File
@@ -108,15 +108,21 @@ def _build_cfg(app_module: Any) -> dict[str, Any]:
def _hedge_enabled() -> bool:
return _env_bool("HEDGE_PLAN_ENABLED", False)
from lib.hedge_plan.okx_trade_mode_lib import hedge_module_enabled
return hedge_module_enabled()
def _show_perp_options() -> bool:
return _env_bool("HEDGE_PLAN_SHOW_PERP_OPTIONS", True)
from lib.hedge_plan.okx_trade_mode_lib import show_perp_options
return show_perp_options()
def _show_options_options() -> bool:
return _env_bool("HEDGE_PLAN_SHOW_OPTIONS_OPTIONS", True)
from lib.hedge_plan.okx_trade_mode_lib import show_options_options
return show_options_options()
def _oo_close_mode_enabled() -> bool: