Navigation:Home > Content >

FXG_iAlligatorZone.mq4

Time: 2018-07-18 | Download file:FXG_iAlligatorZone.mq4

//+------------------------------------------------------------------+
//|                                           FXG_iAlligatorZone.mq4 |
//|                                                 FXGeneral,© 2010 |
//|                                       |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_separate_window    
#property  indicator_buffers 5         
#property  indicator_color1  Black     
#property  indicator_color2  Lime     
#property  indicator_color3  Red
#property  indicator_color4  Lime  
#property  indicator_color5  Red        

//---- indicator parameters 
extern bool    alert=true;
int            History    =3000;           

double     ExtBuffer0[];                
double     ExtBuffer1[];
double     ExtBuffer2[];
double     ExtBuffer3[];
double     ExtBuffer4[];
datetime bar;

//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
  { 
  bar=0;
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,2);
   SetIndexStyle(4,DRAW_HISTOGRAM,EMPTY,2);

   SetIndexBuffer(0,ExtBuffer0);
   SetIndexBuffer(1,ExtBuffer1);
   SetIndexBuffer(2,ExtBuffer2);
   SetIndexBuffer(3,ExtBuffer3);
   SetIndexBuffer(4,ExtBuffer4);

   IndicatorShortName("Al_Zone");
   
         ObjectCreate("copyright",OBJ_LABEL,0,0,0,0,0); 
   	ObjectSet("copyright",OBJPROP_CORNER,2);
   	ObjectSet("copyright",OBJPROP_XDISTANCE,21);
		ObjectSet("copyright",OBJPROP_YDISTANCE,20);
		ObjectSetText("copyright","",12,"Times New Roman",Gray);
		ObjectSet("copyright",OBJPROP_WIDTH,1); 

//---- initialization done
   return(0);
  } 
//+------------------------------------------------------------------+ 
//| Custor indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit() 
  { 
//---- TODO: add your code here 
    ObjectDelete("copyright");


//---- 
   return(0); 
  } 
int start()                         // Специальная функция start()
  {
   double jaw,teeth,lips,EMA4,close;                 
   int i,n,Counted_bars;

   Counted_bars=IndicatorCounted(); // Количество просчитанных баров 
   i=Bars-Counted_bars-1;           // Индекс первого непосчитанного
   if (i>History-1)                 // Если много баров то ..
      i=History-1;                  // ..рассчитывать заданное колич.
      ExtBuffer1[i] = 0;            // обнуление значений массивов линий индикатора
      ExtBuffer2[i] = 0;
      ExtBuffer0[i] = 0;
      ExtBuffer3[i] = 0;
      ExtBuffer4[i] = 0;
      
   while(i>=0)                      // Цикл по непосчитанным барам
     {       
      jaw=iAlligator(Symbol(),Period(),13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORJAW,i); // 
      teeth=iAlligator(Symbol(),Period(),13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORTEETH,i); 
      lips=iAlligator(Symbol(),Period(),13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORLIPS,i); 
      EMA4=iMA(NULL,0,3,1,MODE_SMMA,PRICE_MEDIAN,i); //
      close=iClose(NULL,0,i);
      ExtBuffer1[i] = 0;
      ExtBuffer2[i] = 0;
      ExtBuffer0[i] = 0; 
      ExtBuffer3[i] = 0; 
      ExtBuffer4[i] = 0; 
     
      if (close>jaw && close>teeth && close>lips)ExtBuffer1[i]=1; 
      if (closejaw && close>teeth && close>lips && close>EMA4)ExtBuffer3[i]=1;
      if (closejaw && close>teeth && close>lips && lips>=teeth && teeth>=jaw && bar        

Recommend