//+------------------------------------------------------------------+ //| Begin_Trend_v02.mq4 | //+------------------------------------------------------------------+ #property copyright "Inkov Evgeni ew123@mail.ru" #property link "+7-988-140-68-11" //+------------------------------------------------------------------+ // Нормализованный вариант //+------------------------------------------------------------------+ #property version "1.00" #property strict #include //--- indicator settings #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 clrGreen #property indicator_color2 clrRed #property indicator_color3 clrGreen #property indicator_color4 clrRed #property indicator_width1 2 #property indicator_width2 2 #property indicator_level1 100 #property indicator_level2 -100 #property indicator_level3 50 #property indicator_level4 -50 #property indicator_levelstyle STYLE_SOLID #property indicator_levelcolor clrBlue #property indicator_levelwidth 1 //--- indicator parameters input int Period_Channel=70; input int Period_Input=48; //--- indicator buffers double BufUP[]; double BufDW[]; double BufUP1[]; double BufDW1[]; //+------------------------------------------------------------------+ int OnInit(void) { IndicatorDigits(2); //--- drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_HISTOGRAM); //--- indicator buffers mapping SetIndexBuffer(0,BufUP); SetIndexBuffer(1,BufDW); SetIndexBuffer(2,BufUP1); SetIndexBuffer(3,BufDW1); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ int OnCalculate (const int rates_total, const int prev_calculated, const datetime& time[], const double& open[], const double& high[], const double& low[], const double& close[], const long& tick_volume[], const long& volume[], const int& spread[]) { int i,limit; //--- limit=rates_total-prev_calculated; if(prev_calculated>0)limit++; double n1,n2,n3,d; for(i=0; i0)BufDW1[i]=BufDW[i]; } return(rates_total); } //+------------------------------------------------------------------+