I would like to create a simple indicator that can compare the last X candles (for now let's say 3) and draw a rectangle around them (or highlight them in some way) if they meet specific criteria.
For example:
Above EMA13
Bar1 above Bar2
Bar3 above Bar2
Bar2 1tick or more above EMA13
Below EMA13
Bar1 below Bar2
Bar3 below Bar2
Bar2 1tick or more below EMA13
I have the concept of how to compare bars with High[x], Low[x], Open[x], Close[x] but I don't know how to draw a rectangle or highlight.
Any assistance would be greatly appreciated.
Thank you in advance for any help

Comment