How can I implement simple moving average that plots from first bar on chart

It should plot from first bar on chart and not after minimum bar periods...like plotting running average before plotting correct values

Although this does not make much sense, it can be done

Period = 20;
m = MA( C, Min( BarIndex(), Period ) );
Plot( m, "MA", colorRed );
2 Likes

Ha ha ha, had to read the topic twice to correlate with your solution :rofl:
I like it too, instead of having Null for the first N period bars ( visually appealing ) but wonder how useful it is mathematically for OP.

@varun.nia,

read here for visual proof (on similar topic) why it does not make much sense as you end up with same MA. What's the benefit?

Thanks, it was really helpful.