Regime position size
Position-size multiplier: 1.0 normally, cut to 0.8 in consolidation and 0.5 in volatile choppy markets.
RegimePositionSize takes a regime label and an ATR percentage and returns a size multiplier for each bar. It returns 1.0 for the explosive, strong and normal regimes, 0.8 for consolidation and 0.5 for volatile choppy. If either input is missing it returns 1.0, and the ATR value only needs to be present, since it never changes the result.
How to read it
- The line sits in its own pane below the price, not on the candles.
- A flat line at 1.0 means full size; a dip to 0.8 or 0.5 means the strategy would size down on that bar.
- In the SPY one-minute sample for September 2026 it stayed at 1.0 on every bar, so the cut never showed up in that run.
What it outputs
- Size multiplier
- Size multiplier per bar: 1.0 for explosive, strong, normal or missing input, 0.8 for consolidation, 0.5 for volatile choppy.
Pitfalls
- The class docstring says the multiplier runs from 0.5 to 1.5, but the code never returns anything above 1.0.
- The ATR input is only checked for None. Volatility affects size only through the regime label.
- The sample output was 1.0 on every bar, which is also what the missing-input fallback returns, so the sample does not show whether any size cut ever happens.