Show study only on current bar

AlphaTrader

New member
HI everybody,

I have a custom study, let's say it's something like:

Code:
plot TP;
TP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
TP.setdefaultColor(color.green);

plot SL;
SL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
SL.setdefaultColor(color.red);


TP = close + (ATR(21) * 2);
SL = close - ((ATR(21) * 2)/2);

How can I only show the study for the last bar.

With the code above I'm getting this:

RVERklg.png


But what I want to get this (look at the last bar):

0RvGAZl.png


I appreciate your help here. :)
 
Last edited:

Similar threads

Top