//+------------------------------------------------------------------+ //| 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; extern int Signal=5; //---- indicator settings #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 Black #property indicator_color2 Purple #property indicator_color3 DarkOrange #property indicator_color4 Red #property indicator_width2 2 #property indicator_width3 2 //---- indicator buffers double ExtBuffer0[]; double ExtBuffer1[]; double ExtBuffer2[]; double ExtBuffer3[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_NONE); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_LINE); IndicatorDigits(Digits+1); //---- 4 indicator buffers mapping SetIndexBuffer(0,ExtBuffer0); SetIndexBuffer(1,ExtBuffer1); SetIndexBuffer(2,ExtBuffer2); SetIndexBuffer(3,ExtBuffer3); //---- name for DataWindow and indicator subwindow label IndicatorShortName("w35260"); SetIndexLabel(1,"sdo"); SetIndexLabel(2,"sdo"); SetIndexLabel(3,"Signal"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Awesome Oscillator | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); double prev,current; //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- macd for(int i=0; i=0; i--) { current=ExtBuffer0[i]; prev=ExtBuffer0[i+1]; if(current>prev) up=true; if(current