Vol Regime -- Volatility Regime Classifier
Contents
Overview
The Volatility Regime Classifier categorizes the current volatility environment into three discrete regimes: low (1), medium (2), and high (3). Instead of requiring you to set raw ATR or RSTD thresholds that are asset-specific and timeframe-specific, vol_regime automatically classifies the current volatility by comparing it against its own recent history using rolling standard deviation percentiles.
The calculation works by computing the rolling standard deviation of price over the lookback period, then determining which percentile the current value falls into relative to the distribution of recent values. The bottom third maps to regime 1 (low), the middle third to regime 2 (medium), and the top third to regime 3 (high). This makes the indicator self-calibrating -- it adapts to the asset and timeframe automatically.
The key insight: instead of guessing absolute volatility thresholds (which differ for every trading pair and timeframe), vol_regime gives you a universal classification. Regime 1 means volatility is compressed relative to recent history -- compression precedes breakout, so this is the setup phase. Regime 2 means normal conditions -- most strategies work here. Regime 3 means volatility is elevated relative to recent history -- chaotic conditions where wider stops are needed and risk is higher. This single number replaces the need to manually calibrate ATR or RSTD thresholds for each pair.
Format
vol_regime_{period}
The period defines the lookback window -- how many candles of data are used to compute the rolling standard deviation and its percentile classification.
| Example | Period | Use Case |
|---|---|---|
vol_regime_50 | 50 | Faster adaptation -- reacts quickly to volatility shifts, but more regime flickering |
vol_regime_100 | 100 | Standard -- good balance of stability and responsiveness |
vol_regime_200 | 200 | Very stable -- slower to reclassify, but fewer false regime changes |
Period range: 50 to 500.
Value range: Discrete: 1, 2, or 3.
Understanding Vol Regime Values
Unlike most indicators that produce continuous floating-point values, Vol Regime outputs one of three discrete integers:
| Value | Regime | Interpretation |
|---|---|---|
| 1 | Low volatility | The market is calm and compressed. Volatility is in the bottom third of its recent range. This is the squeeze/setup phase -- low volatility periods often precede explosive breakouts. Good for accumulation and squeeze-breakout strategies. |
| 2 | Medium volatility | Normal market conditions. Volatility is in the middle third of its recent range. Most strategies work here without special adjustments. This is the "default" regime. |
| 3 | High volatility | The market is chaotic and volatile. Volatility is in the top third of its recent range. Wider stops are needed, position sizes should be reduced, and false signals increase. Some strategies should stay flat entirely in regime 3. |
Because vol_regime outputs discrete values (1, 2, 3), you use fractional thresholds like 1.5 and 2.5 with < and > operators to identify specific regimes. vol_regime < 1.5 means "regime 1 (low)." vol_regime > 2.5 means "regime 3 (high)." This avoids the floating-point equality problem.
Understanding Operators with Vol Regime
Each operator behaves differently with Vol Regime. Because the indicator outputs discrete values (1, 2, 3), the operator thresholds are set between values (1.5 and 2.5) to cleanly identify regimes.
< (Less Than) -- State-Based
What it does: The trigger is true on every candle where the vol regime value is below the threshold.
On the chart: The market is in a low-volatility phase. Price is moving in small increments relative to recent history. This trigger stays active for the entire duration of the low-vol regime.
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "<"
target = "1.5"
timeframe = "1h"
Typical use: "Only enter when volatility is compressed." Low-volatility regimes are the setup phase for squeeze breakouts. Combining vol_regime < 1.5 with a directional breakout signal captures the expansion move from a compressed base.
> (Greater Than) -- State-Based
What it does: The trigger is true on every candle where the vol regime value is above the threshold.
On the chart: The market is in a high-volatility phase. Price is swinging wildly relative to recent history. This trigger stays active for the entire duration of the high-vol regime.
[[actions.triggers]]
indicator = "vol_regime_100"
operator = ">"
target = "2.5"
timeframe = "1h"
Typical use: Defensive filter -- "exit or do not enter during high-volatility regimes." Regime 3 conditions produce more false signals, wider spreads, and larger drawdowns. Some strategies use vol_regime > 2.5 as a sell trigger or as a gate to prevent new entries.
cross_below -- Event-Based
What it does: Fires once, at the exact candle where vol regime transitions from above the threshold to below it. The previous candle had vol_regime >= the target, and the current candle has vol_regime < the target.
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "cross_below"
target = "1.5"
timeframe = "1h"
Typical use: Detect the moment the market enters a low-volatility regime. This signals that the squeeze phase has begun -- start watching for directional breakout signals.
cross_above -- Event-Based
What it does: Fires once, at the exact candle where vol regime transitions from below the threshold to above it. The previous candle had vol_regime <= the target, and the current candle has vol_regime > the target.
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "cross_above"
target = "2.5"
timeframe = "1h"
Typical use: Detect the moment volatility spikes into the high regime. This can trigger a defensive exit -- when vol regime crosses above 2.5, the market just became chaotic and existing positions may need to be closed or hedged.
= (Equal) -- Not Recommended for Vol Regime
Why: Although vol_regime outputs integers (1, 2, 3), the underlying computation may produce floating-point values that are very close to but not exactly equal to these integers. Use < 1.5 for regime 1, > 1.5 combined with < 2.5 for regime 2, and > 2.5 for regime 3.
- Use
< 1.5to identify low-volatility regimes (regime 1) for squeeze-breakout strategies. - Use
> 2.5to identify high-volatility regimes (regime 3) for defensive exits or position sizing. - Use
cross_below 1.5/cross_above 2.5to detect the exact moment of regime transitions.
TOML Examples
Buy Only in Low Volatility Regime
Enter when the market is in a low-volatility squeeze and price breaks above the upper Bollinger Band. The compressed volatility (regime 1) combined with a directional breakout often produces outsized moves.
[[actions]]
type = "open_long"
amount = "100 USDC"
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "<"
target = "1.5"
timeframe = "1h"
[[actions.triggers]]
indicator = "price"
operator = ">"
target = "bb_upper"
timeframe = "1h"
Exit When High Volatility Arrives
Sell the position when the market enters a high-volatility regime. Regime 3 conditions are chaotic -- protect profits by exiting before volatility causes a sharp drawdown.
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "cross_above"
target = "2.5"
timeframe = "1h"
Adaptive Entry: Low Vol + Trend
Combine the low-volatility squeeze with a trend confirmation. Only buy when volatility is compressed (regime 1) AND the daily trend is bullish (SMA 50 above SMA 200). This is the classic "buy the quiet before the storm" setup within a confirmed uptrend.
[[actions]]
type = "open_long"
amount = "100 USDC"
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "<"
target = "1.5"
timeframe = "1h"
[[actions.triggers]]
indicator = "sma_50"
operator = ">"
target = "sma_200"
timeframe = "1d"
[[actions.triggers]]
indicator = "roc_10"
operator = ">"
target = "0.5"
timeframe = "1h"
Vol Regime + Hurst Combo
The ultimate regime-aware strategy. Hurst confirms the market is trending, vol regime confirms volatility is not chaotic, and MACD provides the entry signal. This triple filter produces high-conviction entries in favorable conditions.
[[actions]]
type = "open_long"
amount = "100 USDC"
[[actions.triggers]]
indicator = "hurst_200"
operator = ">"
target = "0.55"
timeframe = "1h"
[[actions.triggers]]
indicator = "vol_regime_100"
operator = "<"
target = "2.5"
timeframe = "1h"
[[actions.triggers]]
indicator = "macd_12_26_9"
operator = "cross_above"
target = "macd_signal"
timeframe = "1h"
Tips
Because vol_regime outputs discrete integers (1, 2, 3), use fractional thresholds to cleanly identify regimes: < 1.5 for low volatility (regime 1), > 2.5 for high volatility (regime 3). For medium volatility, use > 1.5 AND < 2.5 as two separate triggers. This is cleaner and more reliable than trying to use = with integer values.
Short periods (50) cause more frequent regime flickering -- the classification bounces between regimes as individual candles enter and leave the lookback window. Longer periods (100--200) produce more stable regime reads. Use 100 as a good default, and increase to 200 if you see too many false regime transitions.
Vol Regime tells you about volatility conditions. Hurst tells you about trend/mean-reversion character. Together they give you a complete market regime picture: Is the market trending or mean-reverting? (Hurst.) Is volatility compressed, normal, or elevated? (Vol Regime.) Use both to select the right strategy AND the right risk parameters for the current environment.
Volatility regimes are structural -- they describe the market's character over days and weeks, not minutes. While vol_regime works on any timeframe, it is most meaningful on the daily chart where it captures true regime shifts rather than intraday noise. Use the hourly or daily timeframe for regime classification, even if your entries are on lower timeframes like 15m or 5m.