How would i go about creating a drawline that draws a line from the 20 period moving average 20 periods ago to the current moving average 20 periods. and have it update (re-draw the line) every new period. Without causing infite lines drawn issue?
There you go (not tested):
Defparam DrawOnLastBarOnly = True
MA20 = average[20,0](close)
Drawsegment(Barindex[19],MA20[19],BarIndex,MA20)
Return
Thank you, very helpfull.
haha i really complicated things.