//+------------------------------------------------------------------+
//|                                             Basketting_alert.mq4 |
//|                                                           Ananth |
//|                                             http://www.ananth.me |
//+------------------------------------------------------------------+
#property copyright "Ananth"
#property link      "http://www.ananth.me"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 RoyalBlue

double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW,0,0);
   SetIndexStyle(1,DRAW_ARROW,0,0);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexArrow(0,234);
   SetIndexArrow(1,233);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   for(int i=Bars-1;i>=0;i--)
   {
      double HA00=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,0,i);
      double HA10=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,1,i);
      double HA20=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,2,i);
      double HA30=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,3,i);
      double HA01=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,0,i+1);
      double HA11=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,1,i+1);
      double HA21=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,2,i+1);
      double HA31=iCustom(NULL, 0, "Heiken_Ashi_Smoothed",2,15,2,15,3,i+1);
      double VQz20=iCustom(NULL, 0, "VQzz2",60,6,2,2,5,false,3,i);
      if((HA00 > HA10 && HA20 > HA30) && (HA01 < HA11 || HA21 < HA31) && VQz20 < 0 ) ExtMapBuffer1[i] = HA00+(300*Point);
      if((HA00 < HA10 && HA20 < HA30) && (HA01 > HA11 || HA21 > HA31) && VQz20 > 0 ) ExtMapBuffer2[i] = HA20-(300*Point);
   }
   return(0);
  }
//+------------------------------------------------------------------+