High/Low Volume

In this indicator, I show you a better way to define high/low values of volume (or any other indicator).

Quite often, I get requests from my clients that an indicator level should be “high” or that it should be above a certain absolute level.
The first request is hard to interpret mathematically, but traders can easily spot it on the chart. The second one is not flexible, and it might not make sense in another market regime.

To solve that, you can compute dynamic high/low levels that represent unexpected extreme values that are adaptable to recent conditions.
There are two pretty simple methods I’m using quite often in my scripts percentiles and sigma (standard deviations).

Percentile looks back at X bars and computes the value under which a certain % of data points are located. So, for example, if we’re computing 90%tile and we’re looking at 100 bars, we’ll get a value under which we have values of precisely 90 bars for this indicator. It’s a good idea to use something like 5%tile for low level and 95%tile for high level.

Sigma(σ) is related to standard deviation. If we assume that our data is normally distributed, then 68% of data points should be in the range of mean +-1σ, 95% → mean +-2σ. So we can assume that something above 2σ is a pretty rare and extreme event.

In this script, I give you an example of how to compute both on volume, but you can easily change this to another indicator.

The issue with volume is that it’s not normally distributed, and your low level will be quite often too low to detect any low levels. Ideally, we have to use a more sophisticated formula that fits volume distribution better.

In this indicator, you can set the following parameters:

  • Choose type: Percentile or Sigma
  • Lookback Period
  • High/Low Percentiles
  • Sigmas #

You can also receive alerts for high/low volume events.

Please remember that past performance may not indicate future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.

My First Live Course: qntly.com/101
Pine Programming v5: qntly.com/pineprog
Adv.Pine Use-Cases: qntly.com/advpine

Hire Me: qntly.com/hirepine
Telegram: qntly.com/tel
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?