//+------------------------------------------------------------------+ //| MTF 3_Level_ZZ_Semafor.mq4 | //+------------------------------------------------------------------+ // mtf2008forextsd ki kerris f-la #property copyright "asystem2000" #property link "asystem2000@yandex.ru" #property indicator_chart_window #property indicator_buffers 6 #property indicator_color1 Chocolate #property indicator_color2 Chocolate #property indicator_color3 MediumVioletRed #property indicator_color4 MediumVioletRed #property indicator_color5 Yellow #property indicator_color6 Yellow #property indicator_width1 0 #property indicator_width2 0 #property indicator_width3 1 #property indicator_width4 1 #property indicator_width5 1 #property indicator_width6 1 //---- input parameters //---- input parameters extern int TimeFrame=0; extern double Period1=5; extern double Period2=13; extern double Period3=34; extern string Dev_Step_1="1,3"; extern string Dev_Step_2="8,5"; extern string Dev_Step_3="13,8"; extern int Symbol_1_Kod=140;//129 extern int Symbol_2_Kod=141;//130 extern int Symbol_3_Kod=142;//131 extern string note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF"; extern string Arrow_Codes = "140(129)=1; 141(130)=2; 142(131)=3"; //---- buffers double FP_BuferUp[]; double FP_BuferDn[]; double NP_BuferUp[]; double NP_BuferDn[]; double HP_BuferUp[]; double HP_BuferDn[]; /************************************************************************* PERIOD_M1 1 PERIOD_M5 5 PERIOD_M15 15 PERIOD_M30 30 PERIOD_H1 60 PERIOD_H4 240 PERIOD_D1 1440 PERIOD_W1 10080 PERIOD_MN1 43200 You must use the numeric value of the timeframe that you want to use when you set the TimeFrame' value with the indicator inputs. --------------------------------------- PRICE_CLOSE 0 Close price. PRICE_OPEN 1 Open price. PRICE_HIGH 2 High price. PRICE_LOW 3 Low price. PRICE_MEDIAN 4 Median price, (high+low)/2. PRICE_TYPICAL 5 Typical price, (high+low+close)/3. PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4. You must use the numeric value of the Applied Price that you want to use when you set the 'applied_price' value with the indicator inputs. **************************************************************************/ //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicator line // if (Period1>0) // { SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,Symbol_1_Kod); SetIndexBuffer(0,FP_BuferUp); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,Symbol_1_Kod); SetIndexBuffer(1,FP_BuferDn); SetIndexEmptyValue(1,0.0); // } //---- Обрабатываем 2 буфер // if (Period2>0) // { SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,Symbol_2_Kod); SetIndexBuffer(2,NP_BuferUp); SetIndexEmptyValue(2,0.0); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,Symbol_2_Kod); SetIndexBuffer(3,NP_BuferDn); SetIndexEmptyValue(3,0.0); // } //---- Обрабатываем 3 буфер // if (Period3>0) // { SetIndexStyle(4,DRAW_ARROW); SetIndexArrow(4,Symbol_3_Kod); SetIndexBuffer(4,HP_BuferUp); SetIndexEmptyValue(4,0.0); SetIndexStyle(5,DRAW_ARROW); SetIndexArrow(5,Symbol_3_Kod); SetIndexBuffer(5,HP_BuferDn); SetIndexEmptyValue(5,0.0); //---- name for DataWindow and indicator subwindow label switch(TimeFrame) { case 1 : string TimeFrameStr="M1" ; break; case 5 : TimeFrameStr= "M5" ; break; case 15 : TimeFrameStr= "M15"; break; case 30 : TimeFrameStr= "M30"; break; case 60 : TimeFrameStr= "H1" ; break; case 240 : TimeFrameStr= "H4" ; break; case 1440 : TimeFrameStr= "D1" ; break; case 10080 : TimeFrameStr= "W1" ; break; case 43200 : TimeFrameStr= "MN1"; break; default : TimeFrameStr= "CurrTF"; } if (TimeFramePeriod()) { int PerINT=TimeFrame/Period()+1; datetime TimeArr[]; ArrayResize(TimeArr,PerINT); ArrayCopySeries(TimeArr,MODE_TIME,Symbol(),Period()); for(i=0;i=TimeArray[0]) { /******************************************************** Refresh buffers: buffer[i] = buffer[0]; ********************************************************/ FP_BuferUp[i]=FP_BuferUp[0]; FP_BuferDn[i]=FP_BuferDn[0]; NP_BuferUp[i]=NP_BuferUp[0]; NP_BuferDn[i]=NP_BuferDn[0]; HP_BuferUp[i]=HP_BuferUp[0]; HP_BuferDn[i]=HP_BuferDn[0]; } } } //+++++++++++++++++++++++++++++++++++++++++++++ Raff return(0); } //+------------------------------------------------------------------+