OPEN-SOURCE SCRIPT
Updated

range_stat

1315
A basic statistic to describe "ranges". There are three inputs:

- short range
- long range
- moving average length

The output is a ratio of the short range to the long range. In the screenshot example, the short range is a single day (bar) and the long range is five days. A value near "1" would mean that every day entirely fills the five day range, and that a consolidation is likely present. A value near 0 would mean that each day fills only a small portion of the five day range, and price is probably "trending".

The moving average length is for smoothing the result (which also lags it of course).

The mean, and +- 2 standard deviations are plotted as fuchsia colored lines.
Release Notes
renamed variable and fixed chart

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.