|
94 | 94 | "ibkr": "IBKR_DRY_RUN_ONLY", |
95 | 95 | "firstrade": "FIRSTRADE_DRY_RUN_ONLY", |
96 | 96 | "qmt": "QMT_DRY_RUN_ONLY", |
| 97 | + "binance": "BINANCE_DRY_RUN", |
97 | 98 | } |
98 | 99 | PLATFORM_RESERVED_CASH_RATIO_VARIABLES = { |
99 | 100 | "schwab": "SCHWAB_RESERVED_CASH_RATIO", |
|
168 | 169 | OPTION_OVERLAY_VARIABLES = tuple(field.upper() for field in OPTION_OVERLAY_CONTROL_FIELDS) |
169 | 170 | OPTION_OVERLAY_MODES = frozenset({"current", "enabled", "disabled"}) |
170 | 171 | OPTION_OVERLAY_PROFILE_PATH = ROOT / "web" / "strategy-switch-console" / "strategy-profiles.example.json" |
171 | | -RUNTIME_TARGET_VARIABLES = ( |
172 | | - "RUNTIME_TARGET_ENABLED", |
173 | | -) |
| 172 | +RUNTIME_TARGET_VARIABLES = ("RUNTIME_TARGET_ENABLED",) |
174 | 173 | DCA_PROFILES = frozenset( |
175 | 174 | { |
176 | 175 | "nasdaq_sp500_smart_dca", |
|
214 | 213 | "schwab": "repository", |
215 | 214 | "firstrade": "repository", |
216 | 215 | "qmt": "repository", |
| 216 | + "binance": "repository", |
217 | 217 | } |
218 | 218 | DEFAULT_SERVICE_NAME = { |
219 | 219 | "schwab": "charles-schwab-quant-service", |
220 | 220 | "firstrade": "firstrade-quant-service", |
221 | 221 | "qmt": "qmt-quant-service", |
| 222 | + "binance": "", |
222 | 223 | } |
223 | 224 | PLATFORM_ALIASES = { |
224 | 225 | "firsttrade": "firstrade", |
@@ -536,9 +537,7 @@ def _option_overlay_extra_variables(args: argparse.Namespace, strategy_profile: |
536 | 537 |
|
537 | 538 | defaults = _load_option_overlay_profile_defaults().get(strategy_profile) |
538 | 539 | if not defaults: |
539 | | - raise ValueError( |
540 | | - "option_overlay_mode enabled is only supported for strategies with option overlay defaults" |
541 | | - ) |
| 540 | + raise ValueError("option_overlay_mode enabled is only supported for strategies with option overlay defaults") |
542 | 541 | return dict(defaults) |
543 | 542 |
|
544 | 543 |
|
@@ -594,10 +593,7 @@ def _reject_direct_ibit_zscore_exit_extra_variables(extra_variables: dict[str, A |
594 | 593 | ] |
595 | 594 | if provided: |
596 | 595 | names = ", ".join(provided) |
597 | | - raise ValueError( |
598 | | - "use ibit_zscore_exit_* control fields instead of extra_variables_json " |
599 | | - f"for {names}" |
600 | | - ) |
| 596 | + raise ValueError(f"use ibit_zscore_exit_* control fields instead of extra_variables_json for {names}") |
601 | 597 |
|
602 | 598 |
|
603 | 599 | def _reject_research_only_extra_variables(extra_variables: dict[str, Any]) -> None: |
@@ -813,9 +809,7 @@ def _build_runtime_target(args: argparse.Namespace) -> dict[str, Any]: |
813 | 809 | else _deployment_selector_default(platform, target_name) |
814 | 810 | ) |
815 | 811 | account_scope = ( |
816 | | - args.account_scope.strip() |
817 | | - if args.account_scope |
818 | | - else _account_scope_default(platform, deployment_selector) |
| 812 | + args.account_scope.strip() if args.account_scope else _account_scope_default(platform, deployment_selector) |
819 | 813 | ) |
820 | 814 | account_selector = _split_csv(args.account_selector) or _account_selector_default(platform, account_scope) |
821 | 815 | service_name = args.service_name.strip() if args.service_name else _default_service_name(platform, target_name) |
@@ -948,9 +942,7 @@ def build_switch_target(args: argparse.Namespace) -> dict[str, Any]: |
948 | 942 | dca_controls = _extract_dca_control_fields(extra_variables) |
949 | 943 | ibit_zscore_exit_controls = _extract_ibit_zscore_exit_control_fields(extra_variables) |
950 | 944 | if cash_only_controls.get(CASH_ONLY_EXECUTION_CONTROL_FIELD): |
951 | | - args.cash_only_execution_mode = str( |
952 | | - cash_only_controls[CASH_ONLY_EXECUTION_CONTROL_FIELD] |
953 | | - ).strip().lower() |
| 945 | + args.cash_only_execution_mode = str(cash_only_controls[CASH_ONLY_EXECUTION_CONTROL_FIELD]).strip().lower() |
954 | 946 | _reject_direct_dca_extra_variables(extra_variables) |
955 | 947 | _reject_direct_ibit_zscore_exit_extra_variables(extra_variables) |
956 | 948 | _reject_research_only_extra_variables(extra_variables) |
|
0 commit comments