File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import importlib
2+ import json
23import sys
34import types
45from pathlib import Path
@@ -31,6 +32,23 @@ def load_strategy_module(**env_overrides):
3132 "GLOBAL_TELEGRAM_CHAT_ID" : None ,
3233 }
3334 defaults .update (env_overrides )
35+ if "RUNTIME_TARGET_JSON" not in defaults :
36+ dry_run_only = str (defaults .get ("IBKR_DRY_RUN_ONLY" ) or "" ).strip ().lower () in {
37+ "1" ,
38+ "true" ,
39+ "yes" ,
40+ "y" ,
41+ "on" ,
42+ }
43+ defaults ["RUNTIME_TARGET_JSON" ] = json .dumps (
44+ {
45+ "platform_id" : "ibkr" ,
46+ "strategy_profile" : str (defaults .get ("STRATEGY_PROFILE" ) or "global_etf_rotation" ),
47+ "dry_run_only" : dry_run_only ,
48+ "execution_mode" : "paper" if dry_run_only else "live" ,
49+ },
50+ separators = ("," , ":" ),
51+ )
3452
3553 for key , value in defaults .items ():
3654 if value is None :
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ def test_default_account_group_example_is_valid():
88 Path (__file__ ).resolve ().parents [1 ]
99 / "docs"
1010 / "examples"
11- / "ibkr-account-groups.default .json"
11+ / "ibkr-account-groups.paper .json"
1212 )
1313
1414 configs = parse_account_group_configs (example_path .read_text (encoding = "utf-8" ))
15- default_group = configs ["default " ]
15+ default_group = configs ["paper " ]
1616
1717 assert default_group .ib_gateway_instance_name == "interactive-brokers-quant-instance"
1818 assert default_group .ib_gateway_zone == "us-central1-c"
You can’t perform that action at this time.
0 commit comments