Volatility adjustment
A position-size multiplier that shrinks as recent one-minute price moves grow; flat at 1.0 at defaults.
VolatilityAdjustment outputs a position-size multiplier between 0.1 and 1.0. It averages the absolute close-to-close change over the last atr_window bars, divides that by the current close to get a percentage, multiplies by adjustment_factor and subtracts the result from 1. Despite the name and docstring, it does not use ATR (high and low prices) or standard deviation.
How to read it
- The line sits in its own pane below the price, with values between 0.1 and 1.0.
- 1.0 means full size. Dips below 1.0 mark stretches where recent one-minute moves were large, so a trader would size down.
- At default settings it stays at 1.0 on SPY one-minute bars, dipping at most to 0.99993 over a month of data. Raise adjustment_factor before the line says anything.
What it outputs
- Size multiplier
- Position-size multiplier from 0.1 to 1.0. 1.0 means full size. Lower values mean recent one-minute moves were large, so size should shrink.
Settings
- atr_window
- How many recent one-minute price changes are averaged. Shorter windows react quickly and swing more on noise; longer windows move slowly. The output stays at 1.0 until this many changes have accumulated.
- adjustment_factor
- How strongly volatility cuts size. Raising it pushes the multiplier lower in active stretches; at the maximum of 11 it stays roughly between 0.99 and 1.0 on SPY. Zero or negative values keep it at 1.0.
Pitfalls
- The name and docstring promise ATR or standard deviation, but the code uses only close-to-close changes, so intrabar high and low ranges are ignored.
- At default settings it is flat at 1.0, so the pane auto-scale magnifies tiny wiggles that carry no sizing meaning. Read the level, not the wiggles.
- The first atr_window bars read 1.0 before any volatility is measured. 1.0 looks like a calm market but also means no data yet.