1212if str (ROOT ) not in sys .path :
1313 sys .path .insert (0 , str (ROOT ))
1414QPK_SRC = ROOT .parent / "QuantPlatformKit" / "src"
15- if (QPK_SRC / "quant_platform_kit" / "common" / "runtime_config.py" ).exists () and str (QPK_SRC ) not in sys .path :
16- sys .path .insert (0 , str (QPK_SRC ))
15+ UES_SRC = ROOT .parent / "UsEquityStrategies" / "src"
16+ HES_SRC = ROOT .parent / "HkEquityStrategies" / "src"
17+ for candidate in (QPK_SRC , UES_SRC , HES_SRC ):
18+ if candidate .exists () and str (candidate ) not in sys .path :
19+ sys .path .insert (0 , str (candidate ))
1720SCRIPT_PATH = ROOT / "scripts" / "print_strategy_profile_status.py"
1821SWITCH_PLAN_SCRIPT_PATH = ROOT / "scripts" / "print_strategy_switch_env_plan.py"
1922
5457BASE_LONGBRIDGE_PROFILES = frozenset (
5558 {
5659 "global_etf_rotation" ,
60+ "ibit_smart_dca" ,
61+ "nasdaq_sp500_smart_dca" ,
5762 "russell_top50_leader_rotation" ,
5863 "tqqq_growth_income" ,
5964 "soxl_soxx_trend_income" ,
65+ "us_equity_combo" ,
66+ "us_equity_combo_leveraged" ,
6067 }
6168)
6269OPTIONAL_LONGBRIDGE_PROFILES = frozenset ({"global_etf_confidence_vol_gate" })
@@ -213,7 +220,7 @@ def test_load_platform_runtime_settings_prefers_runtime_target_json(self):
213220
214221 def test_load_platform_runtime_settings_requires_strategy_profile (self ):
215222 with patch .dict (os .environ , {}, clear = True ):
216- with self .assertRaisesRegex (EnvironmentError , "RUNTIME_TARGET_JSON is required " ):
223+ with self .assertRaisesRegex (EnvironmentError , "RUNTIME_TARGET_JSON" ):
217224 load_platform_runtime_settings (project_id_resolver = lambda : "project-1" )
218225
219226 def test_platform_supported_profiles_are_filtered_by_registry (self ):
@@ -496,7 +503,7 @@ def test_income_layer_overrides_are_loaded_from_env(self):
496503 self .assertEqual (settings .income_layer_start_usd , 250000.0 )
497504 self .assertEqual (settings .income_layer_max_ratio , 0.25 )
498505
499- def test_ibit_smart_dca_profile_is_rejected_on_longbridge (self ):
506+ def test_ibit_smart_dca_profile_is_loaded_on_longbridge (self ):
500507 with patch .dict (
501508 os .environ ,
502509 {
@@ -510,8 +517,11 @@ def test_ibit_smart_dca_profile_is_rejected_on_longbridge(self):
510517 },
511518 clear = True ,
512519 ):
513- with self .assertRaises (ValueError ):
514- load_platform_runtime_settings (project_id_resolver = lambda : "project-1" )
520+ settings = load_platform_runtime_settings (project_id_resolver = lambda : "project-1" )
521+
522+ self .assertEqual (settings .strategy_profile , "ibit_smart_dca" )
523+ self .assertTrue (settings .ibit_zscore_exit_enabled )
524+ self .assertEqual (settings .ibit_zscore_exit_mode , "live" )
515525
516526 def test_tech_runtime_execution_window_override_rejects_research_only_profile (self ):
517527 with patch .dict (
@@ -661,6 +671,7 @@ def test_platform_profile_status_matrix_matches_current_longbridge_rollout(self)
661671 {
662672 "canonical_profile" : "soxl_soxx_trend_income" ,
663673 "display_name" : "SOXL/SOXX Semiconductor Trend Income" ,
674+ "display_name_zh" : "半导体趋势收益" ,
664675 "domain" : "us_equity" ,
665676 "eligible" : True ,
666677 "enabled" : True ,
@@ -690,6 +701,7 @@ def test_platform_profile_status_matrix_matches_current_longbridge_rollout(self)
690701 {
691702 "canonical_profile" : "hk_global_etf_tactical_rotation" ,
692703 "display_name" : "HK Global ETF Tactical Rotation" ,
704+ "display_name_zh" : "港股ETF战术轮动" ,
693705 "domain" : "hk_equity" ,
694706 "eligible" : True ,
695707 "enabled" : True ,
@@ -819,7 +831,7 @@ def test_print_strategy_profile_status_json_matches_registry(self):
819831 self .assertEqual (by_profile ["russell_top50_leader_rotation" ]["profile_group" ], "snapshot_backed" )
820832 self .assertEqual (
821833 by_profile ["russell_top50_leader_rotation" ]["display_name_zh" ],
822- "罗素 Top50 领涨轮动 " ,
834+ "罗素Top50领涨 " ,
823835 )
824836 self .assertEqual (by_profile ["russell_top50_leader_rotation" ]["input_mode" ], "feature_snapshot" )
825837 self .assertTrue (by_profile ["russell_top50_leader_rotation" ]["requires_snapshot_artifacts" ])
@@ -865,7 +877,7 @@ def test_print_strategy_profile_status_table_contains_expected_headers(self):
865877 self .assertIn ("HK Global ETF Tactical Rotation" , result .stdout )
866878 self .assertNotIn ("HK Dividend-Gold Defensive Rotation" , result .stdout )
867879 self .assertIn ("Russell Top50 Leader Rotation" , result .stdout )
868- self .assertIn ("罗素 Top50 领涨轮动 " , result .stdout )
880+ self .assertIn ("罗素Top50领涨 " , result .stdout )
869881 self .assertNotIn ("Tech/Communication Pullback Enhancement" , result .stdout )
870882 self .assertNotIn ("hk_blue_chip_leader_rotation" , result .stdout )
871883 self .assertNotIn ("hk_index_mean_reversion" , result .stdout )
0 commit comments