Hello denis , The average is shifted back 9-bars. it should be x= Ref(MA(mp,18) , -9 );
--- On Wed, 1/9/10, Dennis Lipter <blackca...@verizon.net> wrote: From: Dennis Lipter <blackca...@verizon.net> Subject: [amibroker] Moving Average To: amibroker@yahoogroups.com Date: Wednesday, 1 September, 2010, 12:07 PM The code below is for a centered moving average. The average is shifted back 9-bars. The problem is that for those 9-bars, a flat line is plotted. I would prefer to have that portion of the plot blank instead of the flat line. mp=IIf(C,(H+L+C)/3,(H+L)/2); x= Ref(MA(mp,18),9); Plot(x,"Centered MA-18 ",colorRed); Ideas would be appreciated. Thanks