3232 "mega_cap_leader_rotation_top50_balanced" ,
3333 }
3434)
35+ US_DAILY_SCHEDULER = {
36+ "timezone" : "America/New_York" ,
37+ "main_time" : "45 15 * * *" ,
38+ "probe_time" : "35 9,15 * * *" ,
39+ "precheck_time" : "45 9 * * *" ,
40+ }
41+ US_DCA_SCHEDULER = {
42+ "timezone" : "America/New_York" ,
43+ "main_time" : "45 15 25-29 * *" ,
44+ "probe_time" : "35 9,15 25-29 * *" ,
45+ "precheck_time" : "45 9 25-29 * *" ,
46+ }
47+ US_SNAPSHOT_SCHEDULER = {
48+ "timezone" : "America/New_York" ,
49+ "main_time" : "45 15 1-7 * *" ,
50+ "probe_time" : "35 9,15 1-7 * *" ,
51+ "precheck_time" : "45 9 1-7 * *" ,
52+ }
53+ HK_DAILY_SCHEDULER = {
54+ "timezone" : "Asia/Hong_Kong" ,
55+ "main_time" : "45 15 * * *" ,
56+ "probe_time" : "35 9,15 * * *" ,
57+ "precheck_time" : "45 9 * * *" ,
58+ }
59+ HK_SNAPSHOT_SCHEDULER = {
60+ "timezone" : "Asia/Hong_Kong" ,
61+ "main_time" : "45 15 1-7 * *" ,
62+ "probe_time" : "35 9,15 1-7 * *" ,
63+ "precheck_time" : "45 9 1-7 * *" ,
64+ }
65+ STRATEGY_SCHEDULER_PROFILES = {
66+ "nasdaq_sp500_smart_dca" : US_DCA_SCHEDULER ,
67+ "ibit_smart_dca" : US_DCA_SCHEDULER ,
68+ "russell_1000_multi_factor_defensive" : US_SNAPSHOT_SCHEDULER ,
69+ "mega_cap_leader_rotation_top50_balanced" : US_SNAPSHOT_SCHEDULER ,
70+ "hk_low_vol_dividend_quality_snapshot" : HK_SNAPSHOT_SCHEDULER ,
71+ }
3572PLATFORM_DRY_RUN_VARIABLES = {
3673 "schwab" : "SCHWAB_DRY_RUN_ONLY" ,
3774 "longbridge" : "LONGBRIDGE_DRY_RUN_ONLY" ,
@@ -216,6 +253,14 @@ def _execution_mode_and_dry_run(raw_mode: str) -> tuple[str, bool]:
216253 raise ValueError ("execution_mode must be live or paper" )
217254
218255
256+ def _scheduler_plan_for_strategy (strategy_profile : str ) -> dict [str , str ]:
257+ profile = str (strategy_profile or "" ).strip ().lower ()
258+ scheduler = STRATEGY_SCHEDULER_PROFILES .get (profile )
259+ if scheduler is None :
260+ scheduler = HK_DAILY_SCHEDULER if profile .startswith ("hk_" ) else US_DAILY_SCHEDULER
261+ return dict (scheduler )
262+
263+
219264def _build_runtime_target (args : argparse .Namespace ) -> dict [str , Any ]:
220265 platform = _normalize_platform (args .platform )
221266 target_name = _normalize_target_name (args .target_name )
@@ -232,15 +277,17 @@ def _build_runtime_target(args: argparse.Namespace) -> dict[str, Any]:
232277 )
233278 account_selector = _split_csv (args .account_selector ) or _account_selector_default (platform , account_scope )
234279 service_name = args .service_name .strip () if args .service_name else _default_service_name (platform , target_name )
280+ strategy_profile = args .strategy_profile .strip ().lower ()
235281 runtime_target : dict [str , Any ] = {
236282 "platform_id" : platform ,
237- "strategy_profile" : args . strategy_profile . strip (). lower () ,
283+ "strategy_profile" : strategy_profile ,
238284 "dry_run_only" : dry_run_only ,
239285 "deployment_selector" : deployment_selector ,
240286 "account_selector" : account_selector ,
241287 "account_scope" : account_scope ,
242288 "service_name" : service_name ,
243289 "execution_mode" : execution_mode ,
290+ "scheduler" : _scheduler_plan_for_strategy (strategy_profile ),
244291 }
245292 execution_windows = _load_json_object (args .execution_windows_json , field_name = "execution_windows_json" )
246293 if execution_windows :
0 commit comments