Volatility position sizer extremely aggressive
A position-size multiplier that reads 3.0 on almost every SPY one-minute bar at defaults; its 0.5 branch never fires.
Each bar it divides the ATR by the close. ATR is the Wilder-smoothed average of the true range over atr_period bars, so the ratio is recent bar range as a share of price. Below low_vol_threshold it returns 3.0 (size three times), above high_vol_threshold it returns 0.5 (half size), and in between it returns 1.0, which it also returns while ATR is still filling its window. It is a sizing multiplier, not a signal, so it draws a line rather than markers.
How to read it
- The line sits in its own pane below the price and takes only three values: 3.0, 1.0 and 0.5.
- At defaults on SPY one-minute bars it reads 3.0 on every bar after its warm-up, so a flat line at 3.0 is the normal picture.
- A step down to 1.0 means ATR as a share of price rose above the low threshold; a step to 0.5 means it rose above the high threshold. Neither says where price is going.
What it outputs
- Size multiplier
- Position size multiplier: 3.0 in calm volatility, 1.0 in between or during warm-up, 0.5 in busy volatility.
Settings
- atr_period
- Bars in the ATR average. Raising it smooths the volatility reading so it reacts more slowly to bursts. Lowering it reacts within a few bars and flips the size more often. At defaults it changes little, since no bar comes near the 1% threshold.
- low_vol_threshold
- ATR as a share of close below which size is 3.0. Raising it puts more bars into the 3.0 band. Lowering it makes 3.0 rarer. At the default 0.01 (1%) every bar after warm-up qualifies, since the ratio stays under 0.1%. At zero or below, 3.0 never fires.
- high_vol_threshold
- ATR as a share of close above which size drops to 0.5. Lowering it brings busy bars into the 0.5 band. At the default 0.03 (3%) it never fires on SPY one-minute bars, where the ratio peaks near 0.1%. Keep it above low_vol_threshold, or the 1.0 band disappears.
Pitfalls
- The name says aggressive sizing, but at defaults the output is a constant 3.0, so it adds no sizing information.
- The 1% and 3% defaults sit far above what SPY one-minute bars reach, where the ratio peaks near 0.1%. The middle half of bars sits between about 0.01% and 0.03%.
- The source leaves its cython port as a TODO, so this indicator is not ready for native-C backtests.