//+------------------------------------------------------------------+ //| MA_MTF.mq4 | //+------------------------------------------------------------------+ #property strict //--- indicator settings #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 clrBlack #property indicator_color2 clrGreen #property indicator_color3 clrRed #property indicator_color4 clrLime #property indicator_color5 clrOrangeRed //--- buffers double ExtAOBuffer[]; double ExtUpBuffer[]; double ExtDnBuffer[]; double ExtUpBuffer2[]; double ExtDnBuffer2[]; //--- enum ENUM_TF { current=0,M1=1,M5=5,M15=15,M30=30,H1=60,H4=240,D1=1440,W1=10080,MN1=43200 }; input string _1_="___ Настройки Fast MA ___"; input int Period_=8, Shift_=0; input ENUM_MA_METHOD Method_MA_=MODE_EMA; input ENUM_APPLIED_PRICE Apply_to_=PRICE_CLOSE; input string _2_="___ Настройки Slow MA ___"; input int Period__=21, Shift__=0; input ENUM_MA_METHOD Method_MA__=MODE_EMA; input ENUM_APPLIED_PRICE Apply_to__=PRICE_CLOSE; input string _3_="___ Symbol ___"; input string SYMBOL=""; input string _4_="___ Time frame ___"; input ENUM_TF TF=current; string Symb; bool Activate; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { Activate=false; if(SYMBOL=="") Symb=Symbol(); else { if((int)MarketInfo(SYMBOL,MODE_DIGITS)>0) Symb=SYMBOL; else { Alert("'",SYMBOL,"'"," - этот символ указан некорректно или не добавлен в 'Обзор рынка'!"); return(INIT_PARAMETERS_INCORRECT); } } if(TF!=current && TF0) { limit++; prev=ExtAOBuffer[limit]; shift=iBarShift(Symb,0,iTime(Symb,TF,0)); if(limit-1=0; i--) { current=ExtAOBuffer[i]; if(current>prev && current>0.0) dir=1; else if(current0.0) dir=-1; else if(current>prev && current<0.0) dir=2; else if(current