I'm new to afl coding. I wrote the fallowing code to plot line from candle (High / Low ) where Two MA Crossed. The problem with this code it is plot the line along the chart . What i need is to plot the line from the bar (High / Low ) where MA Crossed level was established and extend for 5 bars only after that.
Thank you in advance.
MACross = Cross(MA(C,8),MA(C,50)); CrossH = ValueWhen(MACross,H); CrossL = ValueWhen(MACross,L); Plot( CrossH, "CrossH", colorLightBlue, styleLine | styleThick ); Plot( CrossL, "CrossL", colorDarkRed, styleLine | styleThick );