@@ -542,7 +542,7 @@ def test_build_switch_target_uses_dca_monthly_scheduler_window(self):
542542 args = parser .parse_args (
543543 [
544544 "--platform" ,
545- "ibkr " ,
545+ "firstrade " ,
546546 "--target-name" ,
547547 "dca" ,
548548 "--strategy-profile" ,
@@ -569,7 +569,7 @@ def test_build_switch_target_uses_daily_scheduler_when_ibit_zscore_plugin_is_aut
569569 args = parser .parse_args (
570570 [
571571 "--platform" ,
572- "ibkr " ,
572+ "firstrade " ,
573573 "--target-name" ,
574574 "ibit" ,
575575 "--strategy-profile" ,
@@ -579,7 +579,7 @@ def test_build_switch_target_uses_daily_scheduler_when_ibit_zscore_plugin_is_aut
579579
580580 target = build_runtime_switch .build_switch_target (args )
581581 assignments = {item .name : item .value for item in runtime_settings .build_assignments (target )}
582- plugin_payload = json .loads (assignments ["IBKR_STRATEGY_PLUGIN_MOUNTS_JSON " ])
582+ plugin_payload = json .loads (assignments ["FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON " ])
583583
584584 self .assertEqual (
585585 target ["runtime_target" ]["scheduler" ],
@@ -601,7 +601,7 @@ def test_build_switch_target_sets_ibit_zscore_exit_runtime_controls(self):
601601 args = parser .parse_args (
602602 [
603603 "--platform" ,
604- "ibkr " ,
604+ "firstrade " ,
605605 "--target-name" ,
606606 "ibit" ,
607607 "--strategy-profile" ,
@@ -625,7 +625,7 @@ def test_build_switch_target_disables_ibit_zscore_exit_when_plugins_are_disabled
625625 args = parser .parse_args (
626626 [
627627 "--platform" ,
628- "ibkr " ,
628+ "firstrade " ,
629629 "--target-name" ,
630630 "ibit" ,
631631 "--strategy-profile" ,
@@ -647,7 +647,7 @@ def test_build_switch_target_rejects_ibit_zscore_controls_for_other_profiles(sel
647647 args = parser .parse_args (
648648 [
649649 "--platform" ,
650- "ibkr " ,
650+ "firstrade " ,
651651 "--target-name" ,
652652 "dca" ,
653653 "--strategy-profile" ,
@@ -665,7 +665,7 @@ def test_build_switch_target_sets_dca_settings_for_dca_profile(self):
665665 args = parser .parse_args (
666666 [
667667 "--platform" ,
668- "ibkr " ,
668+ "firstrade " ,
669669 "--target-name" ,
670670 "dca" ,
671671 "--strategy-profile" ,
@@ -690,7 +690,7 @@ def test_build_switch_target_accepts_dca_control_fields_from_extra_variables_jso
690690 args = parser .parse_args (
691691 [
692692 "--platform" ,
693- "ibkr " ,
693+ "firstrade " ,
694694 "--target-name" ,
695695 "dca" ,
696696 "--strategy-profile" ,
@@ -728,7 +728,7 @@ def test_build_switch_target_rejects_dca_settings_for_non_dca_profile(self):
728728 with self .assertRaisesRegex (ValueError , "DCA settings are only supported" ):
729729 build_runtime_switch .build_switch_target (args )
730730
731- def test_build_switch_target_rejects_direct_dca_extra_variables (self ):
731+ def test_build_switch_target_rejects_dca_profile_on_non_firstrade_platform (self ):
732732 parser = build_runtime_switch .build_parser ()
733733 args = parser .parse_args (
734734 [
@@ -738,6 +738,24 @@ def test_build_switch_target_rejects_direct_dca_extra_variables(self):
738738 "dca" ,
739739 "--strategy-profile" ,
740740 "nasdaq_sp500_smart_dca" ,
741+ "--plugin-mode" ,
742+ "none" ,
743+ ]
744+ )
745+
746+ with self .assertRaisesRegex (ValueError , "DCA strategy profiles are only supported on firstrade" ):
747+ build_runtime_switch .build_switch_target (args )
748+
749+ def test_build_switch_target_rejects_direct_dca_extra_variables (self ):
750+ parser = build_runtime_switch .build_parser ()
751+ args = parser .parse_args (
752+ [
753+ "--platform" ,
754+ "firstrade" ,
755+ "--target-name" ,
756+ "dca" ,
757+ "--strategy-profile" ,
758+ "nasdaq_sp500_smart_dca" ,
741759 "--extra-variables-json" ,
742760 '{"DCA_MODE":"smart"}' ,
743761 ]
@@ -799,7 +817,7 @@ def test_build_switch_target_can_disable_option_overlay(self):
799817 "--target-name" ,
800818 "live" ,
801819 "--strategy-profile" ,
802- "nasdaq_sp500_smart_dca " ,
820+ "tqqq_growth_income " ,
803821 "--option-overlay-mode" ,
804822 "disabled" ,
805823 ]
@@ -838,9 +856,9 @@ def test_build_switch_target_rejects_enabled_option_overlay_without_profile_defa
838856 args = parser .parse_args (
839857 [
840858 "--platform" ,
841- "schwab " ,
859+ "firstrade " ,
842860 "--target-name" ,
843- "live " ,
861+ "default " ,
844862 "--strategy-profile" ,
845863 "nasdaq_sp500_smart_dca" ,
846864 "--option-overlay-mode" ,
@@ -873,18 +891,18 @@ def test_build_switch_target_preserves_dca_fields_in_service_targets_when_omitte
873891 existing = {
874892 "targets" : [
875893 {
876- "service" : "interactive-brokers-demo-ibkr-dca -service" ,
877- "ACCOUNT_GROUP" : "demo-ibkr-dca " ,
894+ "service" : "firstrade-quant -service" ,
895+ "ACCOUNT_GROUP" : "firstrade " ,
878896 "DCA_MODE" : "smart" ,
879897 "DCA_BASE_INVESTMENT_USD" : "500" ,
880898 "runtime_target" : {
881- "platform_id" : "ibkr " ,
899+ "platform_id" : "firstrade " ,
882900 "strategy_profile" : "nasdaq_sp500_smart_dca" ,
883901 "dry_run_only" : False ,
884- "deployment_selector" : "demo-ibkr-dca " ,
885- "account_selector" : ["DEMO_IBKR_DCA " ],
886- "account_scope" : "demo-ibkr-dca " ,
887- "service_name" : "interactive-brokers-demo-ibkr-dca -service" ,
902+ "deployment_selector" : "firstrade " ,
903+ "account_selector" : ["firstrade " ],
904+ "account_scope" : "US " ,
905+ "service_name" : "firstrade-quant -service" ,
888906 "execution_mode" : "live" ,
889907 },
890908 },
@@ -897,15 +915,15 @@ def test_build_switch_target_preserves_dca_fields_in_service_targets_when_omitte
897915 args = parser .parse_args (
898916 [
899917 "--platform" ,
900- "ibkr " ,
918+ "firstrade " ,
901919 "--target-name" ,
902- "demo-ibkr-dca " ,
920+ "default " ,
903921 "--strategy-profile" ,
904922 "nasdaq_sp500_smart_dca" ,
905923 "--account-selector" ,
906- "DEMO_IBKR_DCA " ,
924+ "firstrade " ,
907925 "--service-name" ,
908- "interactive-brokers-demo-ibkr-dca -service" ,
926+ "firstrade-quant -service" ,
909927 "--plugin-mode" ,
910928 "none" ,
911929 "--existing-service-targets-json-file" ,
@@ -954,7 +972,7 @@ def test_build_switch_target_preserves_market_signal_fields_in_service_targets_w
954972 "--target-name" ,
955973 "demo-ibkr-dca" ,
956974 "--strategy-profile" ,
957- "ibit_smart_dca " ,
975+ "tqqq_growth_income " ,
958976 "--account-selector" ,
959977 "DEMO_IBKR_DCA" ,
960978 "--service-name" ,
@@ -970,7 +988,7 @@ def test_build_switch_target_preserves_market_signal_fields_in_service_targets_w
970988 assignments = {item .name : item .value for item in runtime_settings .build_assignments (target )}
971989 selected = json .loads (assignments ["CLOUD_RUN_SERVICE_TARGETS_JSON" ])["targets" ][0 ]
972990
973- self .assertEqual (selected ["runtime_target" ]["strategy_profile" ], "ibit_smart_dca " )
991+ self .assertEqual (selected ["runtime_target" ]["strategy_profile" ], "tqqq_growth_income " )
974992 self .assertEqual (selected ["IBKR_MARKET_SIGNAL_HANDOFF_INDEX_URI" ], "gs://signals/index.json" )
975993 self .assertEqual (selected ["IBKR_MARKET_SIGNAL_REQUIRED" ], "true" )
976994 self .assertEqual (selected ["IBKR_MARKET_SIGNAL_FALLBACK_MODE" ], "last_valid" )
0 commit comments