#property copyright "© 2007 RickD" #property link "www.e2e-fx.net" #define major 1 #define minor 0 #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Gold extern int MA.Period = 25; double MABuf[]; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void init() { SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1); SetIndexDrawBegin(0, MA.Period); SetIndexBuffer(0, MABuf); IndicatorShortName("AMMA ("+MA.Period+")"); } void deinit() { } void start() { int counted = IndicatorCounted(); if (counted < 0) return (-1); if (counted > 0) counted--; int limit = Bars-counted; for (int i=limit-1; i >= 0; i--) { if (i == Bars-1) MABuf[i] = Close[i]; else MABuf[i] = ((MA.Period-1)*MABuf[i+1] + Close[i])/MA.Period; } }