//+------------------------------------------------------------------+ //| ADD.mq4 | //| Copyright © 2006, | //| | //+------------------------------------------------------------------+ #property copyright "Copyright ©" #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_level1 0 //---- input parameters extern int ADD=28; //---- indicahtor buffa double Buf0[]; double Buf1[]; //+------------------------------------------------------------------+ //| indicator Initialization function | //+------------------------------------------------------------------+ int init() { //---- Allocation of buffer to indicator SetIndexBuffer(0, Buf0); SetIndexBuffer(1, Buf1); //---- Setting of kind of indicator SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2, Red); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2, Blue); return(0); } //+------------------------------------------------------------------+ //| Indicator processing function | //+------------------------------------------------------------------+ int start() { int limit=Bars-IndicatorCounted(); for(int i=limit-1; i>=0; i--) { Buf0[i] = iAD(NULL,0,i); } for(i=limit-1; i>=0; i--) { Buf1[i] = iMAOnArray(Buf0,0,ADD,0,MODE_SMA,i); } return(0); } //+------------------------------------------------------------------+