//+------------------------------------------------------------------+ //| Rodrigo Acima_Abaixo_AccelarationBands.mq4 | //| Rodrigo Munhoz | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Rodrigo Munhoz" #property link "**" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 White //---- input parameters extern double Factor=2;// extern int smPeriod=15;// extern int smMethod=1;// 0 - SMA, 1 - EMA, 2 - SMMA, 3 - LWMA double a[]; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(3, DRAW_LINE, EMPTY, 2, White); SetIndexBuffer(0,ExtMapBuffer1); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit=Bars-IndicatorCounted(); for(int i=limit-1;i>=0;i--) { ExtMapBuffer3[i]=High[i]*(1+Factor*(High[i]-Low[i])/((High[i]+Low[i])/2)); ExtMapBuffer4[i]=Low[i]*(1-Factor*(High[i]-Low[i])/((High[i]+Low[i])/2)); ExtMapBuffer5[i]=iMAOnArray(ExtMapBuffer3,0,smPeriod,0,smMethod,i); ExtMapBuffer6[i]=iMAOnArray(ExtMapBuffer4,0,smPeriod,0,smMethod,i); } while(i>=0) { if(High[i]>ExtMapBuffer5[i]==true) { a[i]=1; } if(Low[i]