I am trying to create an indicator in tradingview that plot the high of the day and low of the day. The below mentioned pine code is working and indicator is plotting the line expected.
//@version=5
indicator(title="HOD-LOD", shorttitle="Current Day High and Low", overlay=true)
[dh,dl] = request.security(syminfo.ticker, "D", [high,low], lookahead=barmerge.lookahead_on)
plot(dh, title="HOD", color=color.rgb(90, 208, 153), linewidth=2, trackprice=true)
plot(dl, title="LOD", color=color.rgb(207, 64, 64), linewidth=2, trackprice=true)
I have tried using the text and shape in pine script version5 but then I need to remove the trackprice=true
without which the tracking the new high and new low is not possible. PFB for the excepted output image. Any help would be appreciated.
[https://www.tradingview.com/pine-script-docs/en/v5/concepts/Text_and_shapes.html#labels]