diff --git a/src/strategies/base.py b/src/strategies/base.py index a54ec66..9396a3b 100644 --- a/src/strategies/base.py +++ b/src/strategies/base.py @@ -49,8 +49,12 @@ class StrategyType(Enum): # Complex strategies IRON_CONDOR = "iron_condor" + # BUTTERFLY is the canonical member for the iron butterfly strategy + # (see IronButterflyStrategy.get_strategy_type and the factory registry). + # A second IRON_BUTTERFLY = "butterfly" member previously aliased BUTTERFLY + # (identical value), so the two were the same object and collided as dict + # keys. Removed to eliminate the silent shadowing. BUTTERFLY = "butterfly" - IRON_BUTTERFLY = "butterfly" class StrategyCategory(Enum): diff --git a/tests/models/test_scoring_engine.py b/tests/models/test_scoring_engine.py index d9a18e9..a5041b2 100644 --- a/tests/models/test_scoring_engine.py +++ b/tests/models/test_scoring_engine.py @@ -28,7 +28,7 @@ def sample_probabilities(self): StrategyType.IRON_CONDOR: 0.35, StrategyType.BULL_CALL_SPREAD: 0.25, StrategyType.LONG_STRADDLE: 0.20, - StrategyType.IRON_BUTTERFLY: 0.15, + StrategyType.BUTTERFLY: 0.15, StrategyType.BEAR_PUT_SPREAD: 0.05 } @@ -66,7 +66,7 @@ def sample_risk_metrics(self): 'volatility': 0.35, 'backtest_samples': 75 }, - StrategyType.IRON_BUTTERFLY: { + StrategyType.BUTTERFLY: { 'max_drawdown': 0.10, 'var_95': 0.04, 'win_rate': 0.65, @@ -95,7 +95,7 @@ def sample_expected_returns(self): StrategyType.IRON_CONDOR: 0.12, StrategyType.BULL_CALL_SPREAD: 0.15, StrategyType.LONG_STRADDLE: 0.20, - StrategyType.IRON_BUTTERFLY: 0.08, + StrategyType.BUTTERFLY: 0.08, StrategyType.BEAR_PUT_SPREAD: 0.10 }