//+------------------------------------------------------------------+ //| AllMA.mq4 | //| Copyright © 2011, MetaQuotes Software Corp. | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, MetaQuotes Software Corp." #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Green //--- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ extern int AllMAper=10; int start() { int limit; int counted_bars=IndicatorCounted(); //---- if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //for(int i=0; i2) pos=Bars-ExtCountedBars-1; //---- main calculation loop while(pos>=0) { Jaws=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORJAW, pos); Teeth=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORTEETH, pos); Lips=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORLIPS, pos); sum=len(Jaws, Teeth, Per*3)+len(Teeth, Lips, Per*2); if(pos==Bars-Per) ExtMapBuffer1[pos+1]=AllMA(Per, Per); ExtMapBuffer1[pos]=sum*pr+ExtMapBuffer1[pos+1]*(1-pr); pos--; } } double AllEMA2(int Per) { int pos=Bars-Per; double Jaws, Teeth, Lips, sum; //if(ExtCountedBars>2) pos=Bars-ExtCountedBars-1; //---- main calculation loop while(pos>=0) { Jaws=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORJAW, pos); Teeth=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORTEETH, pos); Lips=iAlligator(NULL, NULL, 13, 8, 8, 5, 5, 3, MODE_EMA, PRICE_MEDIAN, MODE_GATORLIPS, pos); sum=(Jaws+Teeth+Lips)/3; ExtMapBuffer2[pos]=iMA(NULL, 0, Per/3, 0, MODE_EMA, PRICE_CLOSE, pos)-sum; pos--; } }