//+------------------------------------------------------------------+ //| ForsesMomentum.mq4 | //| Cheshir | //| inst.rabot@gmail.com | //+------------------------------------------------------------------+ #property copyright "Cheshir" #property link "inst.rabot@gmail.com" #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 LawnGreen #property indicator_color2 Tomato #property indicator_color3 DeepSkyBlue // Результирующий индикатор... #property indicator_color4 White #property indicator_level1 0.01 #property indicator_level2 -0.01 #property indicator_levelwidth 1 #property indicator_levelcolor Red #property indicator_levelstyle STYLE_DOT //--- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //---- extern extern int barsToProcess=100; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ double bar0 = 0; double bar1 = 0; int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle(3,DRAW_LINE,EMPTY,2); SetIndexBuffer(3,ExtMapBuffer4); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(), limit; if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; // if(limit>barsToProcess) // limit=barsToProcess; //---- for(int i=0;i