//+------------------------------------------------------------------+ //| w35260.mq4 | //| IgorS | //| igor.senych@gmail.com | //+------------------------------------------------------------------+ #property copyright "IgorS" #property link "igor.senych@gmail.com" extern int p_fast = 21; extern int t_fast = 3; extern int pr_fast = 0; extern int p_slow = 34; extern int t_slow = 3; extern int pr_slow = 0; //---- indicator settings #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Purple #property indicator_color2 Red #property indicator_width1 2 //---- indicator parameters extern int Signal=9; //---- indicator buffers double sdlBuffer[]; double SignalBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexStyle(1,DRAW_LINE); //---- indicator buffers mapping SetIndexBuffer(0,sdlBuffer); SetIndexBuffer(1,SignalBuffer); //---- name for DataWindow and indicator subwindow label IndicatorShortName("w35260"); SetIndexLabel(0,"sdl_CD"); SetIndexLabel(1,"Signal"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| w35260 | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- sdlcd counted in the 1-st buffer for(int i=0; i