Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/strategies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions tests/models/test_scoring_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down