#property copyright "Arik Karish"
#property link      ""

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Lime
#property indicator_color3 Lime
#property indicator_color4 Lime

#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1


extern int F1_Brulaity_Power_Level = 1;
extern int F2_Brulaity_Power_Level = 2;

extern int F1_Brulaity_Power_Level_Method = 1;
extern int F2_Brulaity_Power_Level_Method = 3;

extern int F1_Brulaity_Power_Level_Show_On = 0;
extern int F2_Brulaity_Power_Level_Show_On = 0;


bool Changer = TRUE;
string xxxxx = "";
double box1[];
double box2[];
double box3[];
double box4[];
bool bChanger = FALSE;
bool cChanger = FALSE;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   SetIndexLabel(0,NULL); //NAME KILLER! <<
   SetIndexLabel(1,NULL);
   SetIndexLabel(2,NULL);
   SetIndexLabel(3,NULL);
   SetIndexLabel(4,NULL);
   SetIndexLabel(5,NULL);
   SetIndexLabel(6,NULL);
   SetIndexLabel(7,NULL);
   SetIndexLabel(8,NULL);
   //////////////////////////////////////////////
   IndicatorShortName(" ");
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, DRAW_NONE);
   SetIndexStyle(2, DRAW_ARROW, EMPTY);
   SetIndexArrow(2, 233);
   SetIndexStyle(3, DRAW_ARROW, EMPTY);
   SetIndexArrow(3, 234);
   SetIndexBuffer(0, box1);
   SetIndexBuffer(1, box2);
   SetIndexBuffer(2, box3);
   SetIndexBuffer(3, box4);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));

   return (0);
}
			 			 	     			  			 	    	  	 		 												 	 	 	  	 	 		   			    	  		 			  	          	   		   			  		 						 		 				   			 		   			 		 	
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   string char[256];
   bool liner1;
   bool liner2;
   double double1;
   double double2;
   int XYZ;
   for (int pix = 0; pix < 256; pix++) char[pix] = CharToStr(pix);
   
   
   int Counter = IndicatorCounted();
   if (Counter < 0) return (-1);
   if (Counter > 0) Counter--;
   int xct = Bars - Counter;
   for (int Count = xct; Count >= 0; Count--) {
      box1[Count] = iMA(NULL, 0, F1_Brulaity_Power_Level, 0, F1_Brulaity_Power_Level_Method, F1_Brulaity_Power_Level_Show_On, Count);
      box2[Count] = iMA(NULL, 0, F2_Brulaity_Power_Level, 0, F2_Brulaity_Power_Level_Method, F2_Brulaity_Power_Level_Show_On, Count);
      double2 = 0;
      liner1 = FALSE;
      liner2 = FALSE;
      XYZ = Count;
      while (XYZ <= Count + 9) {
         double2 += MathAbs(High[XYZ] - Low[XYZ]);
         XYZ++;
      }
      double1 = double2 / 10.0;
      liner1 = box1[Count + 1] >= box2[Count + 1] && box1[Count + 2] <= box2[Count + 2] && box1[Count] > box2[Count];
      liner2 = box1[Count + 1] <= box2[Count + 1] && box1[Count + 2] >= box2[Count + 2] && box1[Count] < box2[Count];
      if (liner1) {
         box3[Count + 1] = box2[Count + 1] - 0.7 * double1;
         box4[Count + 1] = EMPTY_VALUE;
         liner2 = FALSE;
      }
      if (liner2) {
         box4[Count + 1] = box2[Count + 1] + 0.7 * double1;
         box3[Count + 1] = EMPTY_VALUE;
         liner1 = FALSE;
      }
      if ((!liner1) && !liner2) {
         box4[Count + 1] = EMPTY_VALUE;
         box3[Count + 1] = EMPTY_VALUE;
      }
      if (liner1 && (!(bChanger == TRUE)) && Count == 0 && Changer) {
         bChanger = TRUE;
         cChanger = FALSE;
         Alert(Symbol(), " ", Period(), "BUY BUY BUY");
         if (xxxxx != "") PlaySound(xxxxx);
      }
      if (liner2 && (!(cChanger == TRUE)) && Count == 0 && Changer) {
         bChanger = FALSE;
         cChanger = TRUE;
         Alert(Symbol(), " ", Period(), "SELL SELL SELL");
         if (xxxxx != "") PlaySound(xxxxx);
      }
   }
   return (0);
}