//+------------------------------------------------------------------+ //| ALLIGATOR_IND.mq4 | //| tradertobe@gmail.com | //| | //+------------------------------------------------------------------+ #property copyright "more" #property link "more" //--- #include #include #include //---- string Indicator_Name = "ALLIGATOR_IND: "; //---- #property indicator_separate_window #property indicator_buffers 1 #property indicator_level1 0 #property indicator_levelcolor Red #property indicator_color1 White //--- 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 jaw_val =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW , i); double teeth_val =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, i); double lips_val =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS , i); //--- double bar = NormalizeDouble( (lips_val - teeth_val) + (teeth_val-jaw_val),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,"(lips-teeth) + (teeth-jaw)"); return(0); } // end ofint init() //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- return(0); } //----------------------------------------------------------------------------