Volatility Indicators
Volatility indicators measure the rate and magnitude of price changes, helping traders identify breakouts, set appropriate stop losses, and adjust position sizes based on market conditions.
Bollinger Bandsβ
Calculationβ
Bollinger Bands consist of a middle band (SMA) and two outer bands that are standard deviations away from the middle band.
Formula:
Middle Band = SMA(n)
Upper Band = SMA(n) + (k Γ Standard Deviation)
Lower Band = SMA(n) - (k Γ Standard Deviation)
Standard Settings:
- Period (n) = 20
- Standard Deviations (k) = 2
Step-by-Step Example (20-period, 2 StdDev):
Step 1: Calculate 20-period SMA
Prices: 100, 102, 101, 103, 105, ..., 110
SMA(20) = 104.50
Step 2: Calculate Standard Deviation
Deviations from mean: -4.5, -2.5, -3.5, -1.5, 0.5, ..., 5.5
Variance = Sum of (deviationΒ²) / 20 = 8.25
StdDev = β8.25 = 2.87
Step 3: Calculate Bands
Upper Band = 104.50 + (2 Γ 2.87) = 110.24
Middle Band = 104.50
Lower Band = 104.50 - (2 Γ 2.87) = 98.76
Characteristicsβ
- Middle Band: 20-period SMA (standard)
- Outer Bands: Β±2 standard deviations (standard)
- Band Width: Indicates volatility level
- Price Position: Shows relative price level
- Best For: Mean reversion and breakout strategies
Band Width Interpretationβ
| Band Width | Volatility | Market Condition | Strategy |
|---|---|---|---|
| Narrow | Low | Consolidation | Prepare for breakout |
| Normal | Medium | Trending | Trend following |
| Wide | High | Volatile | Mean reversion |
| Expanding | Increasing | Breakout starting | Follow momentum |
| Contracting | Decreasing | Consolidating | Wait for setup |
Price Position Interpretationβ
| Price Position | Signal | Action |
|---|---|---|
| Above Upper Band | Overbought | Potential reversal or strong trend |
| At Upper Band | Resistance | Watch for rejection or breakout |
| Middle Band | Neutral | Trend direction indicator |
| At Lower Band | Support | Watch for bounce or breakdown |
| Below Lower Band | Oversold | Potential reversal or strong trend |
Usage Examplesβ
Oversold Bounce (Mean Reversion):
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_lower",
"period": 20,
"stdDev": 2,
"comparison": "below"
}
// Price below lower band = oversold, potential bounce
Upper Band Breakout:
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_upper",
"period": 20,
"stdDev": 2,
"comparison": "crosses_above"
}
// Price breaks above upper band = strong momentum
Middle Band Crossover:
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_middle",
"period": 20,
"comparison": "crosses_above"
}
// Price crosses above middle band = bullish
Bollinger Band Strategiesβ
1. Bollinger Bounce (Mean Reversion):
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "low",
"indicator": "bollinger_lower",
"period": 20,
"stdDev": 2,
"comparison": "below"
},
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_lower",
"period": 20,
"stdDev": 2,
"comparison": "above"
}
]
}
},
"exitConditions": {
"takeProfit": {
"type": "indicator",
"indicator": "bollinger_middle",
"period": 20
}
}
}
// Enter when price touches lower band, exit at middle band
2. Bollinger Breakout:
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_upper",
"period": 20,
"stdDev": 2,
"comparison": "crosses_above"
},
{
"type": "indicator_value",
"indicator": "volume",
"comparison": "above",
"value": "sma_volume_20"
}
]
}
}
}
// Enter on upper band breakout with volume confirmation
3. Bollinger Squeeze:
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "custom",
"description": "Band width at 6-month low"
},
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_upper",
"period": 20,
"stdDev": 2,
"comparison": "crosses_above"
}
]
}
}
}
// Enter when bands squeeze then price breaks out
Bollinger Band Patternsβ
The Squeeze:
- Bands contract to narrow range
- Indicates low volatility
- Precedes significant move
- Trade the breakout direction
Walking the Bands:
- Price stays near upper/lower band
- Indicates strong trend
- Don't fade the trend
- Wait for reversal confirmation
Double Bottom/Top:
- Price makes two touches of band
- Second touch doesn't break band
- Reversal signal
- Enter on confirmation
Average True Range (ATR)β
Calculationβ
ATR measures market volatility by calculating the average of true ranges over a specified period.
Formula:
True Range = max[(High - Low), |High - Close_prev|, |Low - Close_prev|]
ATR = Average of True Range over n periods (typically 14)
First ATR = Simple average of first 14 TR values
Subsequent ATR = ((Previous ATR Γ 13) + Current TR) / 14
Example (14-period ATR):
Day 1: High=105, Low=100, Close_prev=102
TR = max[(105-100), |105-102|, |100-102|]
= max[5, 3, 2] = 5
Day 2: High=108, Low=103, Close_prev=105
TR = max[(108-103), |108-105|, |103-105|]
= max[5, 3, 2] = 5
Days 1-14: Calculate average
ATR = (5 + 5 + 4 + 6 + ... + 5) / 14 = 4.8
Day 15: TR = 6
ATR = ((4.8 Γ 13) + 6) / 14 = 4.89
Characteristicsβ
- Range: 0 to unlimited (in price units)
- Period: 14 (standard)
- Interpretation: Higher ATR = higher volatility
- Use: Position sizing, stop loss placement
- Not Directional: Doesn't indicate trend direction
ATR Interpretationβ
| ATR Level | Volatility | Implications |
|---|---|---|
| Low ATR | Low volatility | Tight stops, smaller positions, breakout pending |
| Normal ATR | Average volatility | Standard position sizing |
| High ATR | High volatility | Wider stops, smaller positions, trending |
| Rising ATR | Increasing volatility | Trend strengthening or starting |
| Falling ATR | Decreasing volatility | Trend weakening or consolidating |
Usage Examplesβ
ATR-Based Stop Loss:
{
"exitConditions": {
"stopLoss": {
"type": "atr",
"atrPeriod": 14,
"atrMultiplier": 2.0
}
}
}
// Stop loss = Entry Β± (2 Γ ATR)
High Volatility Filter:
{
"type": "indicator_value",
"indicator": "atr",
"period": 14,
"comparison": "above",
"value": "sma_atr_50"
}
// ATR above 50-period average = high volatility
Volatility Breakout:
{
"type": "indicator_value",
"indicator": "atr",
"period": 14,
"comparison": "crosses_above",
"value": "sma_atr_20"
}
// ATR crosses above its average = volatility expansion
ATR Applicationsβ
1. Position Sizing:
Position Size = Risk Amount / (ATR Γ Multiplier)
Example:
Risk per trade = $1000
ATR = 2.50
Multiplier = 2.0
Position Size = $1000 / (2.50 Γ 2.0) = 200 shares
2. Stop Loss Placement:
Long Stop = Entry - (ATR Γ Multiplier)
Short Stop = Entry + (ATR Γ Multiplier)
Example (Long):
Entry = $100
ATR = $2.50
Multiplier = 2.0
Stop Loss = $100 - ($2.50 Γ 2.0) = $95
3. Profit Target:
Target = Entry + (ATR Γ Multiplier)
Example:
Entry = $100
ATR = $2.50
Multiplier = 3.0
Target = $100 + ($2.50 Γ 3.0) = $107.50
ATR Multiplier Guidelinesβ
| Multiplier | Use Case | Risk Level |
|---|---|---|
| 1.0-1.5 | Tight stops, scalping | High (more stops) |
| 2.0 | Standard stops | Medium |
| 2.5-3.0 | Swing trading | Low (fewer stops) |
| 3.0+ | Position trading | Very low |
Keltner Channelsβ
Calculationβ
Keltner Channels use ATR to set channel width around an EMA, combining trend and volatility.
Formula:
Middle Line = EMA(n)
Upper Channel = EMA(n) + (ATR(n) Γ Multiplier)
Lower Channel = EMA(n) - (ATR(n) Γ Multiplier)
Standard Settings:
- EMA Period = 20
- ATR Period = 10
- Multiplier = 2.0
Example (20 EMA, 10 ATR, 2.0 multiplier):
EMA(20) = 105.00
ATR(10) = 2.50
Upper Channel = 105.00 + (2.50 Γ 2.0) = 110.00
Middle Line = 105.00
Lower Channel = 105.00 - (2.50 Γ 2.0) = 100.00
Characteristicsβ
- Middle Line: EMA (typically 20)
- Channel Width: ATR-based (adapts to volatility)
- Multiplier: 2.0 (standard)
- Best For: Trend following and breakouts
- Advantage: Adapts to volatility changes
Interpretationβ
| Price Position | Signal | Action |
|---|---|---|
| Above Upper Channel | Strong uptrend | Hold long, avoid shorts |
| Between Middle & Upper | Uptrend | Look for long entries |
| At Middle Line | Neutral | Trend direction indicator |
| Between Lower & Middle | Downtrend | Look for short entries |
| Below Lower Channel | Strong downtrend | Hold short, avoid longs |
Usage Examplesβ
Trend Following:
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_middle",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "above"
}
// Price above middle line = uptrend
Breakout Entry:
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_upper",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "crosses_above"
}
// Price breaks above upper channel = strong momentum
Channel Bounce:
{
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "low",
"indicator": "keltner_lower",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "below"
},
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_lower",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "above"
}
]
}
// Price touches lower channel and bounces
Keltner Channel Strategiesβ
1. Keltner Breakout:
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_upper",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "crosses_above"
},
{
"type": "indicator_value",
"indicator": "adx",
"period": 14,
"comparison": "above",
"value": 25
}
]
}
}
}
// Enter on upper channel breakout with strong trend
2. Keltner Trend Following:
{
"entryConditions": {
"long": {
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_middle",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "crosses_above"
}
]
}
},
"exitConditions": {
"stopLoss": {
"type": "indicator",
"indicator": "keltner_lower",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0
}
}
}
// Enter on middle line cross, stop at lower channel
Comparison: Bollinger Bands vs Keltner Channelsβ
| Feature | Bollinger Bands | Keltner Channels |
|---|---|---|
| Basis | SMA | EMA |
| Width Calculation | Standard Deviation | ATR |
| Responsiveness | Medium | High |
| Best For | Mean reversion | Trend following |
| Breakout Signals | Less frequent | More frequent |
| False Signals | Fewer | More |
| Volatility Adaptation | Good | Excellent |
Combined Strategyβ
Bollinger + Keltner Squeeze:
- When Bollinger Bands are inside Keltner Channels = low volatility
- Breakout from this squeeze = high-probability trade
- Trade in direction of breakout
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "custom",
"description": "Bollinger Bands inside Keltner Channels"
},
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_upper",
"period": 20,
"comparison": "crosses_above"
}
]
}
}
}
Volatility Indicator Combinationsβ
1. Bollinger Bands + ATR (Adaptive Stops)β
Setup:
- Bollinger Bands(20,2) for entries
- ATR(14) for stop loss placement
Entry:
- Price touches lower Bollinger Band
Stop Loss:
- Entry - (2 Γ ATR)
{
"entryConditions": {
"long": {
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "bollinger_lower",
"period": 20,
"stdDev": 2,
"comparison": "below"
}
]
}
},
"exitConditions": {
"stopLoss": {
"type": "atr",
"atrPeriod": 14,
"atrMultiplier": 2.0
}
}
}
2. Keltner Channels + Volume (Confirmed Breakouts)β
Setup:
- Keltner Channels(20,10,2) for breakout
- Volume for confirmation
Entry:
- Price breaks above upper Keltner
- Volume > average volume
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "keltner_upper",
"period": 20,
"atrPeriod": 10,
"multiplier": 2.0,
"comparison": "crosses_above"
},
{
"type": "indicator_value",
"indicator": "volume",
"comparison": "above",
"value": "sma_volume_20"
}
]
}
}
}
Best Practicesβ
Do'sβ
- β Use Bollinger Bands for mean reversion in ranging markets
- β Use Keltner Channels for trend following
- β Use ATR for position sizing and stop placement
- β Adjust band/channel parameters for different timeframes
- β Combine with volume for breakout confirmation
- β Use wider bands/channels in volatile markets
Don'tsβ
- β Assume price will always bounce at bands (can walk the bands)
- β Use fixed stop losses in volatile markets (use ATR)
- β Ignore ATR when sizing positions
- β Trade breakouts without volume confirmation
- β Use same parameters for all instruments
- β Fade strong trends just because price is at band
Common Pitfallsβ
1. Fading Strong Trendsβ
Problem: Selling at upper band in strong uptrend Solution: Use trend filter (EMA or ADX) before mean reversion trades
2. Fixed Stop Losses in Volatile Marketsβ
Problem: Stops too tight, get stopped out frequently Solution: Use ATR-based stops that adapt to volatility
3. Ignoring Volume on Breakoutsβ
Problem: False breakouts without volume Solution: Require volume confirmation for breakout trades
Related Documentationβ
- Indicators Overview - All available indicators
- Trend Indicators - MACD, ADX, Parabolic SAR
- How to Use Bollinger Bands - Practical guide
- Position Sizing Configuration - ATR-based sizing