QuantNomad

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.

Disclaimer
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
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?