/*
   Generated by EX4-TO-MQ4 decompiler V4.0.469.1 [-]
   Website: https://purebeam.biz
   E-mail : purebeam@gmail.com
*/

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 White
#property indicator_color2 Yellow
#property indicator_color3 White
#property indicator_color4 Blue
#property indicator_color5 Yellow

extern int SignalPeriod = 48;
int gi_80 = 64;
extern double FilterNumber = 2.0;
extern int aTake_Profit = 35;
extern int aStop_Loss = 20;
extern bool aAlerts = TRUE;
extern bool EmailOn = TRUE;
extern color BuyColor = Blue;
extern color SellColor = Red;
int gi_116 = 0;
int gi_120 = 0;
string gs_trpt_124 = "trpt";
int gi_unused_132 = 0;
int gi_unused_136 = 3;
int gi_unused_140 = 0;
int g_width_144 = 3;
int g_width_148 = 1;
double gda_152[];
double gda_156[];
string gs_160;
string gs_dummy_184;
string gs_dummy_192;
double g_ibuf_200[];
double g_ibuf_204[];
double g_ibuf_208[];
double g_ibuf_212[];
double g_ibuf_216[];

int init() {
   gs_160 = "  BUYSELLSECRET (" + SignalPeriod + ", " + gi_80 + ")";
   IndicatorShortName(gs_160);
   IndicatorBuffers(5);
   SetIndexBuffer(0, g_ibuf_200);
   SetIndexLabel(0, " BUYSELLSECRET");
   SetIndexShift(0, 0);
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 1, White);
   SetIndexBuffer(1, g_ibuf_204);
   SetIndexShift(1, 0);
   SetIndexStyle(1, DRAW_NONE, STYLE_SOLID, 1, Yellow);
   SetIndexBuffer(2, g_ibuf_208);
   SetIndexShift(2, 0);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 1, White);
   SetIndexBuffer(3, g_ibuf_212);
   SetIndexLabel(3, " BUYSELLSECRET");
   SetIndexShift(3, 0);
   SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 4, Blue);
   SetIndexBuffer(4, g_ibuf_216);
   SetIndexLabel(4, " BUYSELLSECRET");
   SetIndexShift(4, 0);
   SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, 4, Yellow);
   return (0);
}
			 			       		 	 		  	  			 		 	 			      	  		   					  						  			 		 	  	   			    			 	      	    			 	 			 			 	    				 	 		 			 			  	 	
int start() {
   f0_1();
   for (int index_0 = 0; index_0 <= Bars; index_0++) {
      g_ibuf_200[index_0] = f0_3(0, index_0 + 1);
      g_ibuf_204[index_0] = f0_3(1, index_0 + 1);
      g_ibuf_208[index_0] = f0_3(2, index_0 + 1);
      g_ibuf_212[index_0] = f0_3(3, index_0 + 1);
      g_ibuf_216[index_0] = f0_3(4, index_0 + 1);
   }
   return (0);
}
	 	  		  	  	 		   	   	 			  		   	 	   	     			   					 	 					 	 	 				 		    			   	 	      	 		   	 	   						  	  	 	 		 								  			 	 	
double f0_3(int ai_0, int ai_4) {
   double icustom_8;
   icustom_8 = iCustom(Symbol(), 0, "buysell4code", SignalPeriod, gi_80, FilterNumber, aTake_Profit, aStop_Loss, aAlerts, EmailOn, BuyColor, SellColor, SignalPeriod,
      gi_80, aTake_Profit, aStop_Loss, aAlerts, EmailOn, BuyColor, SellColor, ai_0, ai_4);
   return (icustom_8);
}
	 	 	   		   	 		  											 		  		 	 		  				 	  	  	 	 		  	 	 		 		 		   	 	 		 		   	 			 		 	 		   	 		 	 					  		 		    			   		 		 	   
void f0_1() {
   int li_4;
   int ind_counted_0 = IndicatorCounted();
   if (ind_counted_0 >= 0) {
      li_4 = Bars - ind_counted_0 + 1;
      for (int li_8 = 1; li_8 < li_4; li_8++) {
         if (gda_152[li_8 + 1] == EMPTY_VALUE && gda_152[li_8] != EMPTY_VALUE) f0_2(li_8);
         if (gda_156[li_8 + 1] == EMPTY_VALUE && gda_156[li_8] != EMPTY_VALUE) f0_0(li_8);
      }
   }
}
		   		 	 	 	 						   		  	  						 	  	 	    	  	  			  		 			  		 	 	    		  		 		    	      	 			    	    		   	  	 	 		 		    							 		 	  
void f0_2(int ai_0) {
   string name_4 = gs_trpt_124 + "_1" + DoubleToStr(Time[ai_0], 0);
   string name_12 = gs_trpt_124 + "_2" + DoubleToStr(Time[ai_0], 0);
   if (ObjectFind(name_4) == -1) {
      if (ObjectCreate(name_4, OBJ_ARROW, 0, Time[ai_0 - 1], Low[ai_0 - 1] - gi_116 * Point)) {
         ObjectSet(name_4, OBJPROP_ARROWCODE, 233);
         ObjectSet(name_4, OBJPROP_COLOR, BuyColor);
         ObjectSet(name_4, OBJPROP_WIDTH, g_width_144);
      }
   }
   int window_20 = WindowFind(gs_160);
   if (window_20 != -1) {
      if (ObjectFind(name_12) == -1) {
         if (ObjectCreate(name_12, OBJ_ARROW, window_20, Time[ai_0 - 1], gda_152[ai_0 - 1] - gi_120 * Point)) {
            ObjectSet(name_12, OBJPROP_ARROWCODE, 233);
            ObjectSet(name_12, OBJPROP_COLOR, BuyColor);
            ObjectSet(name_12, OBJPROP_WIDTH, g_width_148);
         }
      }
   }
}
	 	  		  	  	 		   	   	 			  		   	 	   	     			   					 	 					 	 	 				 		    			   	 	      	 		   	 	   						  	  	 	 		 								  			 	 	
void f0_0(int ai_0) {
   string name_4 = gs_trpt_124 + "_1" + DoubleToStr(Time[ai_0], 0);
   string name_12 = gs_trpt_124 + "_2" + DoubleToStr(Time[ai_0], 0);
   if (ObjectFind(name_4) == -1) {
      if (ObjectCreate(name_4, OBJ_ARROW, 0, Time[ai_0 - 1], High[ai_0 - 1] + gi_116 * Point)) {
         ObjectSet(name_4, OBJPROP_ARROWCODE, 234);
         ObjectSet(name_4, OBJPROP_COLOR, SellColor);
         ObjectSet(name_4, OBJPROP_WIDTH, g_width_144);
      }
   }
   int window_20 = WindowFind(gs_160);
   if (window_20 != -1) {
      if (ObjectFind(name_12) == -1) {
         if (ObjectCreate(name_12, OBJ_ARROW, window_20, Time[ai_0 - 1], gda_156[ai_0 - 1] + gi_120 * Point)) {
            ObjectSet(name_12, OBJPROP_ARROWCODE, 234);
            ObjectSet(name_12, OBJPROP_COLOR, SellColor);
            ObjectSet(name_12, OBJPROP_WIDTH, g_width_148);
         }
      }
   }
}
