- Length: Lookback for the detection of peaks.
- Number Of Levels: Determines the number of levels to display.
- Levels Color Mode: Determines how the levels should be colored. "Relative" will color the levels based on their location relative to the current price. "Random" will apply a random color to each level. "Fixed" will use a single color for each level.
- Levels Style: Style of the displayed levels. Styles include solid, dashed, and dotted.
- Show Histogram: Determines whether to display the histogram or not.
- Histogram Window: Lookback period of the histogram calculation.
- Bins Colors: Control the color of the histogram bins.
The indicator can be used to display ready-to-use . These are constructed from peaks in . When a peak occurs, we take the price where this peak occurred and use it as the value for our level.
If one of the levels was previously tested, we can hypothesize that the level might be used as in the future. Additional analysis using can be done in order to confirm a potential bounce.
The histogram can return various information to the user. It can show if the price stayed within two levels for a long time and if the price within two levels was mostly made of or candles.
In the chart above, we can see that over the most recent 200 bars (determined by Histogram Window) 68 closing prices fall between levels A and B, with 27 bars being .
Additionally, the width of a bin and its length can sometimes give information about the of a specific price variation. If a bin is very wide but short (a low number of closing prices fallen within the levels) then we can conclude a most of the movement was done on a short amount of time.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.