OPEN-SOURCE SCRIPT
Volatility Regime (Latest) New!

This indicator is designed to separate two different market concepts: volatility regime and price displacement.
The main visualization focuses on Volatility Regime, calculated from the standard deviation of log returns over a selected lookback period. The result is ranked against its own historical distribution using a rolling percentile filter, allowing the market to be classified into Low, Mid, or High Volatility regimes without assuming a normal distribution.
A secondary reference metric, Price Displacement, is also included. It measures how far the current price is from its rolling mean using a price z-score. This helps identify whether price is extended from its local average, while keeping it separate from the main volatility regime logic.
Core concept:
* Volatility Regime measures how unstable returns are.
* Price Displacement measures how far price is from its mean.
* Rolling percentile ranking is used to classify regimes empirically.
* The model does not assume that market returns follow a normal distribution.
This tool is intended for regime awareness, risk context, volatility filtering, and market condition analysis. It should not be used as a standalone buy or sell signal.
P-Value
The main visualization focuses on Volatility Regime, calculated from the standard deviation of log returns over a selected lookback period. The result is ranked against its own historical distribution using a rolling percentile filter, allowing the market to be classified into Low, Mid, or High Volatility regimes without assuming a normal distribution.
A secondary reference metric, Price Displacement, is also included. It measures how far the current price is from its rolling mean using a price z-score. This helps identify whether price is extended from its local average, while keeping it separate from the main volatility regime logic.
Core concept:
* Volatility Regime measures how unstable returns are.
* Price Displacement measures how far price is from its mean.
* Rolling percentile ranking is used to classify regimes empirically.
* The model does not assume that market returns follow a normal distribution.
This tool is intended for regime awareness, risk context, volatility filtering, and market condition analysis. It should not be used as a standalone buy or sell signal.
P-Value
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.