Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/quant_platform_kit/common/strategy_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
MARKET_REGIME_CONTROL_SUPPORTED_STRATEGIES = frozenset(
{
"tqqq_growth_income",
"soxl_soxx_trend_income",
"global_etf_rotation",
"russell_1000_multi_factor_defensive",
"mega_cap_leader_rotation_top50_balanced",
Expand Down
39 changes: 16 additions & 23 deletions tests/test_strategy_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def test_default_plugin_definition_supports_market_regime_control_for_approved_s
)
for strategy in (
"tqqq_growth_income",
"soxl_soxx_trend_income",
"global_etf_rotation",
"russell_1000_multi_factor_defensive",
"mega_cap_leader_rotation_top50_balanced",
Expand All @@ -235,15 +236,6 @@ def test_default_plugin_definition_supports_market_regime_control_for_approved_s
plugin=PLUGIN_MARKET_REGIME_CONTROL,
mode=PLUGIN_MODE_SHADOW,
)
with self.assertRaisesRegex(
ValueError,
"market_regime_control does not support strategy soxl_soxx_trend_income",
):
validate_strategy_plugin_compatibility(
strategy="soxl_soxx_trend_income",
plugin=PLUGIN_MARKET_REGIME_CONTROL,
mode=PLUGIN_MODE_SHADOW,
)
validate_strategy_plugin_notification_target(
notification_target=GENERAL_MARKET_REGIME_NOTIFICATION_TARGET,
plugin=PLUGIN_MARKET_REGIME_CONTROL,
Expand Down Expand Up @@ -338,20 +330,21 @@ def test_parse_strategy_plugin_mounts_accepts_market_regime_control_tqqq(self):
self.assertEqual(mounts[0].plugin, PLUGIN_MARKET_REGIME_CONTROL)
self.assertEqual(mounts[0].expected_schema_version, "market_regime_control.v1")

def test_parse_strategy_plugin_mounts_rejects_market_regime_control_soxl(self):
with self.assertRaisesRegex(
ValueError,
"market_regime_control does not support strategy soxl_soxx_trend_income",
):
parse_strategy_plugin_mounts(
[
{
"strategy": "soxl_soxx_trend_income",
"plugin": PLUGIN_MARKET_REGIME_CONTROL,
"signal_path": "gs://bucket/market_regime/latest_signal.json",
}
]
)
def test_parse_strategy_plugin_mounts_accepts_market_regime_control_soxl(self):
mounts = parse_strategy_plugin_mounts(
[
{
"strategy": "soxl_soxx_trend_income",
"plugin": PLUGIN_MARKET_REGIME_CONTROL,
"signal_path": "gs://bucket/market_regime/latest_signal.json",
"expected_schema_version": "market_regime_control.v1",
}
]
)

self.assertEqual(mounts[0].strategy, "soxl_soxx_trend_income")
self.assertEqual(mounts[0].plugin, PLUGIN_MARKET_REGIME_CONTROL)
self.assertEqual(mounts[0].expected_schema_version, "market_regime_control.v1")

def test_parse_strategy_plugin_mounts_accepts_market_regime_control_weight_profile(self):
mounts = parse_strategy_plugin_mounts(
Expand Down