How to do a plot conditionally

I saw a forumula somewhere as follow, which draw Var1 if it’s larger than its previous value and draw nothing if else:
"IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),POINTDOT,COLORFF00FF; "
here DRAWNULL is the ‘draw nothing’ directive while POINTDOT is our equivalent line type.

Is it possible to emulate DRAWNULL in afl?
Thanks

Yes, just use Null.

Plot(IIf(Var1 > Ref(Var1, -1), Var1, Null), "Indicator", colorBlack, styleDots);

4 Likes

Thank you HelixTrader!!