This script will display the high-low difference both as a histogram and as a label on the chart.
Explanation: highLowDiff = high - low: This calculates the difference between the high and low prices for each candle.
plot(...): This will plot the high-low difference as a blue histogram on the chart.
label.new(...): This will create a label at the top of each candle with the value of the high-low difference. You can adjust the position of the label and its appearance as needed.
Customization: You can change the color, line width, or style of the plot and the labels to suit your preferences. If you'd prefer the label to appear at a different location, you can modify the parameters inside label.new(), such as adjusting the position or the size of the text.
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 publication is governed by House rules. You can favorite it to use it on a chart.
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.