//+------------------------------------------------------------------+ //| ISHIMOKU_IND.mq4 | //| tradertobe@gmail.com | //| | //+------------------------------------------------------------------+ #property copyright "more" #property link "more" //--- #include #include #include //---- string Indicator_Name = "ISHIMOKU_IND: "; //---- #property indicator_separate_window #property indicator_buffers 1 #property indicator_level1 0 #property indicator_levelcolor Red #property indicator_color1 White //--- //--- extern int tenkan_sen = 9; extern int kijun_sen = 26; extern int senkou_span_b = 52; //--- extern int Style = DRAW_HISTOGRAM; // DRAW_HISTOGRAM, DRAW_LINE extern color IndColor = White; extern int Line_Thickness = 1; extern int History = 1000; // в минутах это сутки //---- double IndBuffer[]; //--- int i,j,k,Counted_bars; double dv; string sv; string Sym; int last_error; //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ //-------------------------------------------------------------------- int start() { //-------------------------------------------------------------------- Counted_bars = IndicatorCounted(); // Количество просчитанных баров i = Bars - Counted_bars - 1; // Индекс первого непосчитанного if (i > History-1) // Если много баров то .. i = History-1; // ..рассчитывать заданное колич. //----------------------------------------------------------------------- while(i >= 0) // Цикл по непосчитанным барам { double bar_tenkan_sen = iIchimoku(NULL,0,tenkan_sen,kijun_sen,senkou_span_b, MODE_TENKANSEN, i); double bar_kijun_sen = iIchimoku(NULL,0,tenkan_sen,kijun_sen,senkou_span_b, MODE_KIJUNSEN, i); //--- double bar = NormalizeDouble(bar_tenkan_sen - bar_kijun_sen,Digits); //--- //--- IndBuffer[i] = bar*1000000; //--- i--; // Расчёт индекса следующего бара } // end of while(i >= 0) //-------------------------------------------------------------------- return; } // end of int start() //-------------------------------------------------------------------- //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { Sym = Symbol(); //---- indicator IndicatorShortName(Indicator_Name); IndicatorDigits(0); SetIndexStyle (0, Style, DRAW_LINE, Line_Thickness, IndColor); // DRAW_HISTOGRAM SetIndexBuffer(0, IndBuffer); SetIndexLabel (0,"tenkan_sen-kijun_sen"); return(0); } // end ofint init() //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- return(0); } //----------------------------------------------------------------------------