//+------------------------------------------------------------------+ //| Parabolic_ZZ.mq4 | //| Copyright © 2009, Vic2008 | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, Vic2008" #property link "" #include #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Magenta //---- input parameters extern double SAR_step=0.02; //Параметры параболика. extern double SAR_maximum=0.2; extern int BarsCount = 500; //Дистанция в барах для отрисовки индикатора. extern bool Fibo1_off = False; //Отключение уровней Fibo. extern bool Fibo2_off = False; extern bool Fibo_Absolut_Value = False; //Включение абслютных значений цены на Fibo уровнях. extern color Label_Color = Gray; extern color Fibo_Color = Blue; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(0,DRAW_SECTION); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(1,DRAW_SECTION,0,2,Magenta); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectsDeleteAll(0,OBJ_ARROW); ObjectDelete("FiboZZLast"); ObjectDelete("FiboZZPrev"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //int counted_bars=IndicatorCounted(); string txt; int w,PosLow,PosHigh; double LPic=1000000,HPic=0,price; datetime TimeTmp; //---- ExtMapBuffer1[0]=Close[0]; ExtMapBuffer2[0]=EMPTY_VALUE; for( w=0;w Close[w] && LPic>=Low[w] ){ LPic=Low[w]; PosLow=w; } if( iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && HPic<=High[w] ){ HPic=High[w]; PosHigh=w; } // H -> L if( iSAR(NULL,0,SAR_step,SAR_maximum,(w+1)) > Close[w+1] && iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && HPic!=0) { ExtMapBuffer1[PosHigh]=HPic; ExtMapBuffer2[PosHigh]=HPic; HPic=0; } // L -> H if( iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && iSAR(NULL,0,SAR_step,SAR_maximum,w+1) > Close[w+1] && LPic!=1000000 ) { ExtMapBuffer1[PosLow]=LPic; ExtMapBuffer2[PosLow]=LPic; LPic=1000000; } } if( Fibo1_off ) ObjectDelete("FiboZZLast"); if( Fibo2_off ) ObjectDelete("FiboZZPrev"); //Рисуем ценовые метки и уровни FIBO int wave_cnt=0; for( w=0;w