//+------------------------------------------------------------------------------------+ //| Din_fibo_high.mq4 | //| unknown author, get from kaizer, converted by Rosh | //| link to kaizer: http://forum.alpari-idc.ru/profile.php?mode=viewprofile&u=4196161 | //| http://forexsystems.ru/phpBB/index.php| //+------------------------------------------------------------------------------------+ #property copyright "unknown author, get from kaizer, conversed by Rosh" #property link "http://forexsystems.ru/phpBB/index.php" //---- #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 clrBlue #property indicator_color2 clrYellow //---- input parameters extern int Ch_Period=3; extern double Ratio=0.786; extern bool SetAllBars=false; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double tvBuffer[]; //--- int hh,ll,first,counterPeriod; double tv,MaH,MaL; //+------------------------------------------------------------------+ //| Проверим - разделитель диапазона или нет | //+------------------------------------------------------------------+ bool isDelimeter(int tf,int _shift) { bool result=false; //---- switch(tf) { case 5:result=(TimeMinute(Time[_shift])==0) && (TimeHour(Time[_shift])==0); break; case 15:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 30:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 60:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 240:result=(TimeDayOfWeek(Time[_shift])==1) && (TimeHour(Time[_shift])==0); break; case 1440:result=(TimeDay(Time[_shift])==1) || ((TimeDay(Time[_shift])==2 && TimeDay(Time[_shift+1])!=1)) || ((TimeDay(Time[_shift])==3 && TimeDay(Time[_shift+1])!=2)); break; case 10080:result=TimeDay(Time[_shift])<=7 && TimeMonth(Time[_shift])==1; break; default: Print("Недопустимый период!!!"); } //---- return(result); } //+------------------------------------------------------------------+ //| Установим MaH и MaL на границе диапазона | //+------------------------------------------------------------------+ void SetHnL(int _shift) { //---- int i=_shift+1; counterPeriod=0; while(counterPeriod_shift;j--) { ExtMapBuffer1[j]=0.0; ExtMapBuffer2[j]=0.0; } i=_shift; counterPeriod=0; while(counterPeriod0) limit=Bars-counted_bars; if(counted_bars==0) { // найти первый и второй разделитель и установить limit cnt=Bars-1; while(!isDelimeter(Period(),cnt)) cnt--; first=cnt; cnt--; counterPeriod=0; while(counterPeriod=0;shift--) { if(isDelimeter(Period(),shift)) SetHnL(shift);// else SetMovingHnL(shift); if(shift==0) { SetValuesNullBar(shift); } } return(0); } //+------------------------------------------------------------------+