Skip to content

Commit e0c67e6

Browse files
authored
Allow SOXL market regime plugin mounts (#93)
1 parent c6e221f commit e0c67e6

2 files changed

Lines changed: 17 additions & 23 deletions

File tree

src/quant_platform_kit/common/strategy_plugins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
MARKET_REGIME_CONTROL_SUPPORTED_STRATEGIES = frozenset(
4343
{
4444
"tqqq_growth_income",
45+
"soxl_soxx_trend_income",
4546
"global_etf_rotation",
4647
"russell_1000_multi_factor_defensive",
4748
"mega_cap_leader_rotation_top50_balanced",

tests/test_strategy_plugins.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def test_default_plugin_definition_supports_market_regime_control_for_approved_s
217217
)
218218
for strategy in (
219219
"tqqq_growth_income",
220+
"soxl_soxx_trend_income",
220221
"global_etf_rotation",
221222
"russell_1000_multi_factor_defensive",
222223
"mega_cap_leader_rotation_top50_balanced",
@@ -235,15 +236,6 @@ def test_default_plugin_definition_supports_market_regime_control_for_approved_s
235236
plugin=PLUGIN_MARKET_REGIME_CONTROL,
236237
mode=PLUGIN_MODE_SHADOW,
237238
)
238-
with self.assertRaisesRegex(
239-
ValueError,
240-
"market_regime_control does not support strategy soxl_soxx_trend_income",
241-
):
242-
validate_strategy_plugin_compatibility(
243-
strategy="soxl_soxx_trend_income",
244-
plugin=PLUGIN_MARKET_REGIME_CONTROL,
245-
mode=PLUGIN_MODE_SHADOW,
246-
)
247239
validate_strategy_plugin_notification_target(
248240
notification_target=GENERAL_MARKET_REGIME_NOTIFICATION_TARGET,
249241
plugin=PLUGIN_MARKET_REGIME_CONTROL,
@@ -338,20 +330,21 @@ def test_parse_strategy_plugin_mounts_accepts_market_regime_control_tqqq(self):
338330
self.assertEqual(mounts[0].plugin, PLUGIN_MARKET_REGIME_CONTROL)
339331
self.assertEqual(mounts[0].expected_schema_version, "market_regime_control.v1")
340332

341-
def test_parse_strategy_plugin_mounts_rejects_market_regime_control_soxl(self):
342-
with self.assertRaisesRegex(
343-
ValueError,
344-
"market_regime_control does not support strategy soxl_soxx_trend_income",
345-
):
346-
parse_strategy_plugin_mounts(
347-
[
348-
{
349-
"strategy": "soxl_soxx_trend_income",
350-
"plugin": PLUGIN_MARKET_REGIME_CONTROL,
351-
"signal_path": "gs://bucket/market_regime/latest_signal.json",
352-
}
353-
]
354-
)
333+
def test_parse_strategy_plugin_mounts_accepts_market_regime_control_soxl(self):
334+
mounts = parse_strategy_plugin_mounts(
335+
[
336+
{
337+
"strategy": "soxl_soxx_trend_income",
338+
"plugin": PLUGIN_MARKET_REGIME_CONTROL,
339+
"signal_path": "gs://bucket/market_regime/latest_signal.json",
340+
"expected_schema_version": "market_regime_control.v1",
341+
}
342+
]
343+
)
344+
345+
self.assertEqual(mounts[0].strategy, "soxl_soxx_trend_income")
346+
self.assertEqual(mounts[0].plugin, PLUGIN_MARKET_REGIME_CONTROL)
347+
self.assertEqual(mounts[0].expected_schema_version, "market_regime_control.v1")
355348

356349
def test_parse_strategy_plugin_mounts_accepts_market_regime_control_weight_profile(self):
357350
mounts = parse_strategy_plugin_mounts(

0 commit comments

Comments
 (0)