Volatility position sizer even more aggressive
Position-size multiplier from 0.5 to 2.5 driven by volatility; with defaults it sits at 2.5 on almost every SPY minute bar.
It scales position size by volatility, not by direction. Volatility is the average true range (ATR) over roughly atr_period bars, divided by the close, so it is a fraction of price per bar. Below low_vol_threshold the multiplier is 2.5, above high_vol_threshold it is 0.5, and in between it is 1.0. While the ATR is still filling, or if the close is missing or zero, it returns 1.0.
How to read it
- The line sits in its own pane, between 0.5 and 2.5. It is a size multiplier, not a price, so read it as a sizing decision.
- 1.0 is normal size. 2.5 means the bar's volatility is below the low threshold; 0.5 means it is above the high threshold.
- With defaults the line stays at 2.5 on almost every SPY minute bar. That flat line reflects the thresholds sitting above bar volatility, not a market signal.
What it outputs
- Size multiplier
- Position size multiplier: 2.5 when volatility is low, 1.0 when normal, 0.5 when high. With defaults it holds 2.5 on almost all SPY minute bars.
Settings
- atr_period
- Bars the average true range looks back over. Shorter follows the latest bar ranges and flips the multiplier more often; longer smooths them, so the multiplier changes more slowly.
- low_vol_threshold
- Volatility under which the multiplier is 2.5. Raising it makes 2.5 more common; lowering it makes it rarer. At the default 0.01 (ATR under 1% of price per bar), almost every SPY minute bar qualifies, so the line stays at 2.5 nearly all the time.
- high_vol_threshold
- Volatility above which the multiplier is 0.5. Lowering it makes 0.5 more common; raising it makes 0.5 rarer. At the default 0.03 (ATR over 3% of price per bar), no SPY minute bar in the sample triggered it, so the 0.5 size never appeared.
Pitfalls
- At the defaults the output is effectively a constant 2.5 on SPY minute bars, because the 1% and 3% thresholds sit above one-minute ATR. Read the flat line as a setting problem, not a volatility reading.
- Thresholds are ATR as a fraction of price, so a value fitted to one bar size will not fit another. Retune them for each symbol and bar size.
- If low_vol_threshold is above high_vol_threshold, the 1.0 band disappears: bars between the two read as calm (2.5), and bars above the low threshold read as 0.5.