0
votes

I want to highlight which bar has a bigger close within a range. The range would be all bars that are above a SMA line.

It's a bit difficult to explan and the following image explains what I want to achieve:

enter image description here

I have manually highlighted (in "yellow") the start end of the range, which is where the SMA cross up and down ocurred. From within that range, I would like to highly the bar with a bigger close (in the image the one with the "blue" arrow)

Is that possible to be done in Pine? Because I can know if the current bar is the higher one from the start of the range and I can display an "arrow" on that bar, but later a new bar will appear with higher close so I will put another "arrow", having several arrows within the specific range.

Thanks!

1

1 Answers

1
votes

You need to define a label once, and then move it with label.set_x() when a higher close occurs.
Example: How to change a label's price coordinate in TradingView Pine Script?