FractalBest





//+------------------------------------------------------------------+
//|                                                  FractalBest.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 Lime
//---- input parameters
extern int       ExtParam1;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,241);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,242);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start(){
   int shift;
   double up,dw,nul=0.0001;
   int i;

      for(shift=Bars-3;shift>=0;shift--){
         ExtMapBuffer1[shift]=0;	
         ExtMapBuffer2[shift]=0;
      }

//----Up and Down Fractals

//----5 bars Fractal
 
   if(High[3]>High[4] && High[3]>High[5] && High[3]>High[2] && High[3]>High[1]){ 
      up=Low[0]-3*Point;
      ExtMapBuffer1[0]=up;
   }
   else{
      ExtMapBuffer1[0]=nul;
   }
    
   if(Low[3]<Low[4] && Low[3]<Low[5] && Low[3]<Low[2] && Low[3]<Low[1]){ 
      dw=High[0]+3*Point;
      ExtMapBuffer2[0]=dw;
   }
   else{
      ExtMapBuffer2[0]=nul;
   }
                                 

   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_ARROW


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: