OPEN-SOURCE SCRIPT
Atualizado Boshmann's Volatility Hist

Boshmann's Volatility Hist
The theory behind tracking normalized volatility is that market movement is highly cyclical, constantly alternating between periods of tight contraction and explosive expansion. Using raw volatility measures (like a flat Average True Range value) is flawed because the meaning of those points changes drastically as an asset's price scales up or down over time. By applying a statistical Z-Score to the ATR, we normalize the volatility relative to the asset's own historical baseline, allowing traders to objectively identify when price action is anomalously quiet (predicting a breakout) or unsustainably aggressive (predicting exhaustion or mean-reversion).
How the Script Works: The script calculates a standard 14-period Average True Range (ATR) to measure current price movement. It then runs a 250-period lookback to compute the rolling mean and standard deviation of that ATR, ultimately calculating a real-time Z-Score. This Z-Score is plotted as an oscillating histogram below the chart. The script uses fixed thresholds to color the histogram bars: Green for "Quiet" (Z-score < -0.5), Yellow for "Normal" (Z-score between -0.5 and 0.5), and Red for "Volatile" (Z-score > 0.5). It also plots dotted threshold lines so you can instantly see when volatility crosses into extreme territory.
Why You Should Use It: This script is the final pillar of the Boshmann's suite, engineered to be used in strict combination with the Regime Counters and the Market Direction Hist.
While the Regime Counter gives you the structural trend and the Direction Hist gives you the momentum conviction, this Volatility Hist reveals the energy state of the market. You should use this indicator because knowing the market's speed dictates your risk management and strategy timing. For example, if you spot a long string of "Quiet" (green) volatility bars while the Regime Counter just flipped to Bullish, you have found an optimal, low-risk entry before an explosive breakout. Conversely, if you are riding a trend and this histogram spikes deep into the "Volatile" (red) zone, it serves as a mathematical warning that the market is overextended, signaling that you should tighten stops or take profits before the inevitable pullback.
The theory behind tracking normalized volatility is that market movement is highly cyclical, constantly alternating between periods of tight contraction and explosive expansion. Using raw volatility measures (like a flat Average True Range value) is flawed because the meaning of those points changes drastically as an asset's price scales up or down over time. By applying a statistical Z-Score to the ATR, we normalize the volatility relative to the asset's own historical baseline, allowing traders to objectively identify when price action is anomalously quiet (predicting a breakout) or unsustainably aggressive (predicting exhaustion or mean-reversion).
How the Script Works: The script calculates a standard 14-period Average True Range (ATR) to measure current price movement. It then runs a 250-period lookback to compute the rolling mean and standard deviation of that ATR, ultimately calculating a real-time Z-Score. This Z-Score is plotted as an oscillating histogram below the chart. The script uses fixed thresholds to color the histogram bars: Green for "Quiet" (Z-score < -0.5), Yellow for "Normal" (Z-score between -0.5 and 0.5), and Red for "Volatile" (Z-score > 0.5). It also plots dotted threshold lines so you can instantly see when volatility crosses into extreme territory.
Why You Should Use It: This script is the final pillar of the Boshmann's suite, engineered to be used in strict combination with the Regime Counters and the Market Direction Hist.
While the Regime Counter gives you the structural trend and the Direction Hist gives you the momentum conviction, this Volatility Hist reveals the energy state of the market. You should use this indicator because knowing the market's speed dictates your risk management and strategy timing. For example, if you spot a long string of "Quiet" (green) volatility bars while the Regime Counter just flipped to Bullish, you have found an optimal, low-risk entry before an explosive breakout. Conversely, if you are riding a trend and this histogram spikes deep into the "Volatile" (red) zone, it serves as a mathematical warning that the market is overextended, signaling that you should tighten stops or take profits before the inevitable pullback.
Notas de Lançamento
The Y-Axis is a "Standard Deviation" ScoreThe grey zero-line in the middle represents your exact historical average volatility. The numbers on the right (+1.00, +2.00, etc.) tell you how many Standard Deviations the current volatility is above or below that average.
The Colors and Extremes
Green (Quiet): Look at the period around June 3rd. The histogram drops into the green, hitting nearly -2.00. This means the market is "dead quiet"—volatility is two standard deviations below normal. If you look at the price chart straight above it, the candles are tiny and grinding slowly upward. This is a very safe, low-risk environment.
Yellow (Normal): The transition zones where the bars stay tightly between the -0.5 and +0.5 dotted lines. This is business as usual.
Red (Volatile & Dangerous): Look at the massive explosion starting around June 9th. The histogram goes deep red and shoots up to nearly +5.00. This means volatility is 5 standard deviations higher than normal—an extreme statistical anomaly
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.