Indicators
Standard Deviation: The Volatility Filter Your Bot Needs
How the rolling standard deviation indicator measures volatility, why bots need a volatility filter, and how to use StdDev in Setup.Cash.
Featured image placeholder
/og/setup-cash-og.svg
The StdDev / Volatility indicator computes the rolling standard deviation of price — a direct statistical measure of how much price is jumping around. It rarely generates entries by itself, but as a filter it can transform a mediocre strategy into a disciplined one.
How It Works
Standard deviation measures dispersion around the average over the last N bars (default 20):
- High StdDev: price is swinging hard — trends, news, breakouts.
- Low StdDev: price is compressed and quiet — ranges, pre-breakout coils.
- Rising from a low base: volatility expansion beginning, often the best moment for breakout entries.
It's the same math that widths Bollinger Bands — used directly as its own series.
Three Ways Bots Use It
1. Volatility floor. Skip entries when StdDev is below a threshold — dead markets produce fake signals and pay nothing even when you're right.
2. Volatility ceiling. Skip entries when StdDev spikes to extremes — news candles and panic moves blow through stops.
3. Squeeze detection. Enter breakout mode only after StdDev has been unusually low for several bars: compression precedes expansion.
StdDev vs ATR
ATR measures average bar range (including gaps); StdDev measures dispersion of closes. ATR is the natural unit for stop distances; StdDev is the natural unit for "is this market statistically quiet or loud?" Many robust systems use both: StdDev to decide whether to trade, ATR to decide how much.
Building It in Setup.Cash
Add StdDev / Volatility in the strategy builder and use it in a condition alongside your entry logic — for example, "RSI cross AND StdDev above X". For a normalized version that works across symbols, the extended library also offers Z-Score, Normalized ATR, and the Relative Volatility Index.
Tuning
- Length 20: standard.
- Shorter (10): reacts faster to regime changes.
- Longer (50+): defines the market's baseline volatility regime.
A volatility filter is the cheapest upgrade most strategies can get. Backtest with and without it and compare drawdowns.
Related Posts
View allIndicators
Bollinger Bands Strategy Guide for Trading Bots
How Bollinger Bands measure volatility, the difference between mean-reversion and breakout uses, and how to automate a Bollinger strategy in Setup.Cash.
2 min read · 365 words
Indicators
Elder Thermometer Indicator Explained
How Elder's Market Thermometer flags abnormally hot or cold bars from wick extension, and how to automate it in Setup.Cash.
1 min read · 194 words
Indicators
Keltner Channels Explained for Trading Bots
How Keltner Channels use ATR to build a volatility envelope, how they differ from Bollinger Bands, and how to automate them in Setup.Cash.
2 min read · 302 words
Indicators
Relative Volatility Index (RVI) Indicator Explained
How the Relative Volatility Index applies RSI math to standard deviation, telling you which way volatility leans, in Setup.Cash.
1 min read · 195 words
Start here
Build your trading bot workflow with structure
Use Setup.Cash to create, backtest, and paper trade rule-based strategies without relying on guesswork. Not financial advice. Trading involves risk.