Navigation:Home > Content >

PotenzaFX_DLS_Trader.mq4

Time: 2017-02-07 | Download file:PotenzaFX_DLS_Trader.mq4

///////////////////////////////////////////////////////////////////
//Generated by ex4 to mq4 decompile Service                      // 
//Website: http://decompile.ru                                   //
//E-mail : [email protected] ; [email protected]      //
///////////////////////////////////////////////////////////////////
#property copyright "Copyright © 2012, Andrea Salvatore"
#property link      "http://www.pimpmyea.com"

//#include 
#import "stdlib.ex4"
   string ErrorDescription(int a0); // DA69CBAFF4D38B87377667EEC549DE5A
#import "Cerbero.dll"
   double aaa(int a0, double a1, double a2)                                 {return(a1+a2);}
   double bbb(int a0, double a1, double a2)                                 {return(a1-a2);}
   double ccc(int a0, double a1, double a2)                                 {return(a1*a2);}
   double cccc(int a0, double a1, double a2, double a3)                  {return(a1*a2*a3);}
   double ddd(int a0, double a1, double a2)                                 {return(a1/a2);}
   int xxx(int a0)                                                              {return(1);}
#import "wininet.dll"
   int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
   int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5);
   int InternetReadFile(int a0, string a1, int a2, int& a3[]);
   int InternetCloseHandle(int a0);
#import

string Gsa_76[12];
int Gia_80[12];
int Gi_84 = 0;
int Gi_88 = 60000;
int Gi_92 = 180000;
int Gi_96 = 0;
int Gi_100 = 0;
int Gi_104 = 0;
string Gsa_108[100];
int Gia_112[100];
int Gi_116 = 0;
int Gi_120 = 2000;
int Gi_124 = 60000;
int Gi_128 = 0;
int Gi_132 = 0;
int Gi_136 = 0;
bool Gi_140 = FALSE;
bool Gi_144 = FALSE;
bool Gi_148 = TRUE;
int Gi_152 = 16711680;
int Gi_156 = 255;
int Gi_160;
bool Gi_164 = FALSE;
int G_datetime_168 = 0;
int G_datetime_172 = 0;
bool Gi_176 = FALSE;
double Gd_180 = 0.0;
int Gi_188 = 86400;
string Gs_192 = "update.html";
bool Gi_unused_200 = FALSE;
string Gs_dummy_204;
int Gi_unused_212 = 0;
int Gi_216 = 1;
string Gs_dummy_220;
bool Gi_228 = FALSE;
int Gi_232 = 0;
int G_count_236 = 0;
string Gs_240;
int Gia_248[1];
string Gs_256 = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
int Gia_264[64] = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47};
int Gia_unused_268[1];
datetime G_time_272;
extern string e_mail = "";
extern string note_1 = "-- DLS Settings --";
extern int algo = 2;
extern bool use_default_periods = TRUE;
extern string period = "20";
extern int timeframe = 0;
extern int smoothing = 1;
extern bool enable_trading = TRUE;
extern bool enable_dls = TRUE;
extern double non_dls_lot_size = 0.1;
extern string note_2 = "-- Money Management Settings --";
extern bool automatic_max_lot_size = FALSE;
extern double leverage = 1.0;
extern double max_lot_size = 0.1;
extern int lot_steps = 10;
extern int bar = 0;
extern string note_3 = "-- Strategy Settings --";
extern bool wait_for_cross = TRUE;
extern bool sound_alert_on_cross = TRUE;
extern string sound_file = "alert.wav";
extern bool visual_alert_on_cross = FALSE;
extern bool check_corr_to_enter = TRUE;
extern double max_corr_level = 0.0;
extern bool realtime_scaleout = TRUE;
extern bool dont_scaleout_entry_bar = TRUE;
extern string note_4 = "-- EA Settings --";
extern int minutes_for_checking = 1440;
extern int slippage = 5;
extern string EA_comment = "PotenzaFX DLS Trader";
extern bool debug_print = FALSE;
int Gi_444;
double Gd_452;
bool Gi_460;
bool Gi_464 = FALSE;
color G_color_468 = Blue;
double Gd_472;
double Gd_480;
bool Gi_488 = FALSE;
double Gda_492[3];
double Gda_496[3];
double Gda_500[3];
double Gda_504[3];
bool Gi_508 = FALSE;
bool Gi_512 = TRUE;
int Gi_516;
int Gi_520;

// DD3DB597DF009D42822D6E053AFA76B8
void f0_40(int Ai_0) {
   Gi_148 = Ai_0;
}
		  		 	  	      			 	    		  		 	  		  		   	  						      	   		     	 	 		   		 									      		 		 	 	 	   			  	   	 	    		     		   	  		
// 890E0EC4DD2253F2CDC4F67B8D9E1BCA
void f0_26() {
   if (Gi_144 == FALSE) {
      for (int index_0 = 0; index_0 < 12; index_0++) {
         Gsa_76[index_0] = "";
         Gia_80[index_0] = 0;
      }
      for (index_0 = 0; index_0 < 100; index_0++) {
         Gsa_108[index_0] = "";
         Gia_112[index_0] = 0;
      }
      Gi_144 = TRUE;
   }
}
		 	 		 	 			 					 					 	 	   		 	 			 	 					 		  				  	  		 	 		 	 		    		 	   	   		 	 			 	 		 	  		  		 									  	 		 	 		 	    	  	  
// CA90F199FAD943ECA9B31C7C06A2D1FB
void f0_36(string As_0, string As_8 = "", string As_16 = "", string As_24 = "", string As_32 = "", string As_40 = "", string As_48 = "", string As_56 = "", string As_64 = "", string As_72 = "", string As_80 = "", string As_88 = "", string As_96 = "", string As_104 = "", string As_112 = "", string As_120 = "", string As_128 = "", string As_136 = "", string As_144 = "", string As_152 = "", string As_160 = "", string As_168 = "", string As_176 = "", string As_184 = "", string As_192 = "", string As_200 = "", string As_208 = "", string As_216 = "", string As_224 = "", string As_232 = "", string As_240 = "", string As_248 = "", string As_256 = "", string As_264 = "", string As_272 = "", string As_280 = "", string As_288 = "", string As_296 = "", string As_304 = "", string As_312 = "", string As_320 = "", string As_328 = "", string As_336 = "", string As_344 = "", string As_352 = "", string As_360 = "", string As_368 = "", string As_376 = "", string As_384 = "", string As_392 = "", string As_400 = "", string As_408 = "", string As_416 = "", string As_424 = "", string As_432 = "", string As_440 = "", string As_448 = "", string As_456 = "", string As_464 = "", string As_472 = "", string As_480 = "", string As_488 = "") {
   int Li_496;
   string Ls_500;
   int Li_508;
   bool bool_512;
   int Li_516;
   bool bool_520;
   if (Gi_148 != FALSE) {
      f0_26();
      Li_496 = GetTickCount();
      if (Gi_140) Gi_132++;
      Ls_500 = As_0 + As_8 + As_16 + As_24 + As_32 + As_40 + As_48 + As_56 + As_64 + As_72 + As_80 + As_88 + As_96 + As_104 + As_112 + As_120 + As_128 + As_136 + As_144 +
         As_152 + As_160 + As_168 + As_176 + As_184 + As_192 + As_200 + As_208 + As_216 + As_224 + As_232 + As_240 + As_248 + As_256 + As_264 + As_272 + As_280 + As_288 + As_296 +
         As_304 + As_312 + As_320 + As_328 + As_336 + As_344 + As_352 + As_360 + As_368 + As_376 + As_384 + As_392 + As_400 + As_408 + As_416 + As_424 + As_432 + As_440 + As_448 +
         As_456 + As_464 + As_472 + As_480 + As_488;
      Li_508 = f0_18(Ls_500);
      bool_512 = Li_508 == -1 || Li_496 >= Li_508 + Gi_120;
      Li_516 = f0_9();
      bool_520 = Li_516 == 0 || Li_496 >= Li_516 + Gi_124;
      if (bool_512 == FALSE && Li_496 >= Gi_128) {
         Gi_128 = Li_496 + Gi_120;
         if (Gi_140) Print("########## Filter1: UPDATED SP_time_next = ", TimeToStr(Gi_128 / 1000, TIME_SECONDS), "; counter = ", Gi_132);
      }
      if (bool_520 == FALSE && Li_496 >= Gi_128) {
         Gi_128 = Li_496 + Gi_124;
         if (Gi_140) Print("########## Filter2: UPDATED SP_time_next = ", TimeToStr(Gi_128 / 1000, TIME_SECONDS), "; counter = ", Gi_132);
      }
      if (Li_496 >= Gi_128) {
         if (Gi_140) {
            Gi_136++;
            Print("SP_time_now = ", TimeToStr(Li_496 / 1000, TIME_SECONDS), "; SP_time_next = ", TimeToStr(Gi_128 / 1000, TIME_SECONDS), "; counter = ", Gi_132, "; counter2 = ",
               Gi_136);
         }
         Gi_116 = (Gi_116 + 1) % 100;
         Gsa_108[Gi_116] = Ls_500;
         Gia_112[Gi_116] = Li_496;
         Print(Ls_500);
      }
   }
}
	   			 			   			 		 							    	   				     			  								  	 		      	 	  		 		   			    		  						 	 	 		 	 		  	  				  	  		      	  	  	 	  
// 57ED0000B9C8B25915AEA86CEFE80A52
int f0_18(string As_0) {
   int Li_12;
   int Li_ret_8 = -1;
   for (int count_16 = 0; count_16 < 100; count_16++) {
      Li_12 = (Gi_116 + 100 - count_16) % 100;
      if (As_0 == Gsa_108[Li_12]) return (Gia_112[Li_12]);
   }
   return (Li_ret_8);
}
			  	      	  	 	 			 	   		 	  		  	 				 		 			 	 	 	  	    				 	    			   					 		 		 		  	   						      			  		 	 				  				 	   	 	     	
// 42B02693A1A7707B7E33810EB75E1ECD
int f0_9() {
   return (Gia_112[(Gi_116 + 1) % 100]);
}
		  			 	 	   						 				 		    		  				 	   			 								   	 		 	    	 		 		 		 	 			   			  			 		 	 	  	 	 		 		  					 	  		 	    	     	 	  
// ED0382B1464260CBE615EEEECFCD049B
void f0_42(string As_0, string As_8 = "", string As_16 = "", string As_24 = "", string As_32 = "", string As_40 = "", string As_48 = "", string As_56 = "", string As_64 = "", string As_72 = "", string As_80 = "", string As_88 = "", string As_96 = "", string As_104 = "", string As_112 = "", string As_120 = "", string As_128 = "", string As_136 = "", string As_144 = "", string As_152 = "", string As_160 = "", string As_168 = "", string As_176 = "", string As_184 = "", string As_192 = "", string As_200 = "", string As_208 = "", string As_216 = "", string As_224 = "", string As_232 = "", string As_240 = "", string As_248 = "", string As_256 = "", string As_264 = "", string As_272 = "", string As_280 = "", string As_288 = "", string As_296 = "", string As_304 = "", string As_312 = "", string As_320 = "", string As_328 = "", string As_336 = "", string As_344 = "", string As_352 = "", string As_360 = "", string As_368 = "", string As_376 = "", string As_384 = "", string As_392 = "", string As_400 = "", string As_408 = "", string As_416 = "", string As_424 = "", string As_432 = "", string As_440 = "", string As_448 = "", string As_456 = "", string As_464 = "", string As_472 = "", string As_480 = "", string As_488 = "") {
   f0_26();
   int Li_496 = GetTickCount();
   if (Gi_140) Gi_100++;
   string Ls_500 = As_0 + As_8 + As_16 + As_24 + As_32 + As_40 + As_48 + As_56 + As_64 + As_72 + As_80 + As_88 + As_96 + As_104 + As_112 + As_120 + As_128 + As_136 +
      As_144 + As_152 + As_160 + As_168 + As_176 + As_184 + As_192 + As_200 + As_208 + As_216 + As_224 + As_232 + As_240 + As_248 + As_256 + As_264 + As_272 + As_280 + As_288 +
      As_296 + As_304 + As_312 + As_320 + As_328 + As_336 + As_344 + As_352 + As_360 + As_368 + As_376 + As_384 + As_392 + As_400 + As_408 + As_416 + As_424 + As_432 + As_440 +
      As_448 + As_456 + As_464 + As_472 + As_480 + As_488;
   int Li_508 = f0_7(Ls_500);
   bool bool_512 = Li_508 == -1 || Li_496 >= Li_508 + Gi_88;
   int Li_516 = f0_15();
   bool bool_520 = Li_516 == 0 || Li_496 >= Li_516 + Gi_92;
   if (bool_512 == FALSE && Li_496 >= Gi_96) {
      Gi_96 = Li_496 + Gi_88;
      if (Gi_140) Print("########## Filter1: UPDATED SA_time_next = ", TimeToStr(Gi_96 / 1000, TIME_SECONDS), "; counter = ", Gi_100);
   }
   if (bool_520 == FALSE && Li_496 >= Gi_96) {
      Gi_96 = Li_496 + Gi_92;
      if (Gi_140) Print("########## Filter2: UPDATED SA_time_next = ", TimeToStr(Gi_96 / 1000, TIME_SECONDS), "; counter = ", Gi_100);
   }
   if (Li_496 >= Gi_96) {
      if (Gi_140) {
         Gi_104++;
         Print("SA_time_now = ", TimeToStr(Li_496 / 1000, TIME_SECONDS), "; SA_time_next = ", TimeToStr(Gi_96 / 1000, TIME_SECONDS), "; counter = ", Gi_100, "; counter2 = ",
            Gi_104);
      }
      Gi_84 = (Gi_84 + 1) % 12;
      Gsa_76[Gi_84] = Ls_500;
      Gia_80[Gi_84] = Li_496;
      Alert(Ls_500);
   }
}
		 	  	 	 									 	 			 	 		  		 	  		 	 		 		 		   			  	 			 	 				 		   			 	       		 					 	 	  	  		 			 				 				  				 	 				    	 		  
// 360E27735CC367E9045EBAF94F3713B5
int f0_7(string As_0) {
   int Li_12;
   int Li_ret_8 = -1;
   for (int count_16 = 0; count_16 < 12; count_16++) {
      Li_12 = (Gi_84 + 12 - count_16) % 12;
      if (As_0 == Gsa_76[Li_12]) return (Gia_80[Li_12]);
   }
   return (Li_ret_8);
}
		 	 	    			  	 		 		 	  	 	 	  	 	 	 			 			 				  	 	   	   			 		    	     			   		 			 	  	  	 					 		   							 	 	  	  			 		   	  	    	
// 5524B29F09BAA6ECFD52B2F0ADF7FF1E
int f0_15() {
   return (Gia_80[(Gi_84 + 1) % 12]);
}
	      				 		  	 			   									           	     		    		   	      		 		  	 	     	  		  				  					 	  		  	    	 	   	  			      		 	 	   	 	 
// CC7BCB519C24D9B518E44B9452589DB0
int f0_37(string A_symbol_0, int A_cmd_8, double A_lots_12, double A_price_20, int A_slippage_28, double Ad_32, double Ad_40, string A_comment_48 = "", int A_magic_56 = 0, int A_datetime_60 = 0, color A_color_64 = -1) {
   int ticket_68;
   int error_72;
   f0_36("orderSendReliable(" + A_symbol_0 + "," + A_cmd_8 + "," + A_lots_12 + "," + A_price_20 + "," + A_slippage_28 + "," + Ad_32 + "," + Ad_40 + "," + A_comment_48 +
      "," + A_magic_56 + "," + A_datetime_60 + "," + A_color_64 + ")");
   while (true) {
      if (IsStopped()) {
         f0_36("orderSendReliable(): Trading is stopped!");
         return (-1);
      }
      RefreshRates();
      if (A_cmd_8 == OP_BUY) A_price_20 = Ask;
      if (A_cmd_8 == OP_SELL) A_price_20 = Bid;
      if (!IsTradeContextBusy()) {
         ticket_68 = OrderSend(A_symbol_0, A_cmd_8, A_lots_12, NormalizeDouble(A_price_20, MarketInfo(A_symbol_0, MODE_DIGITS)), A_slippage_28, NormalizeDouble(Ad_32, MarketInfo(A_symbol_0,
            MODE_DIGITS)), NormalizeDouble(Ad_40, MarketInfo(A_symbol_0, MODE_DIGITS)), A_comment_48, A_magic_56, A_datetime_60, A_color_64);
         if (ticket_68 > 0) {
            f0_36("orderSendReliable(): Success! Ticket: " + ticket_68);
            return (ticket_68);
         }
         error_72 = GetLastError();
         if (f0_33(error_72)) f0_36("orderSendReliable(): Temporary Error: " + error_72 + " " + ErrorDescription(error_72) + ". waiting.");
         else {
            f0_36("orderSendReliable(): Permanent Error: " + error_72 + " " + ErrorDescription(error_72) + ". giving up.");
            return (-1);
         }
      } else f0_36("orderSendReliable(): Must wait for trade context");
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}
	 	    	 	  		     		    	 					  	     	 	 	   	  	     		  	  	 	 		 	  		 	  	 		  			  			   	 		 	 		   	  	   	     				  	 	 		 				  	 		
// 7F9D690F5900BF2302A8515E54A2A5E6
int f0_23(int A_ticket_0, double A_lots_4, double A_price_12, int A_slippage_20, color A_color_24 = -1) {
   bool is_closed_28;
   int error_32;
   f0_36("orderCloseReliable(" + A_ticket_0 + ")");
   OrderSelect(A_ticket_0, SELECT_BY_TICKET, MODE_TRADES);
   while (true) {
      if (IsStopped()) {
         f0_36("orderCloseReliable(" + A_ticket_0 + "): Trading is stopped!");
         return (0);
      }
      RefreshRates();
      if (OrderType() == OP_BUY) A_price_12 = Bid;
      if (OrderType() == OP_SELL) A_price_12 = Ask;
      if (!IsTradeContextBusy()) {
         is_closed_28 = OrderClose(A_ticket_0, A_lots_4, NormalizeDouble(A_price_12, MarketInfo(OrderSymbol(), MODE_DIGITS)), A_slippage_20, A_color_24);
         if (is_closed_28) {
            f0_36("orderCloseReliable(" + A_ticket_0 + "): Success!");
            return (1);
         }
         error_32 = GetLastError();
         if (f0_33(error_32)) f0_36("orderCloseReliable(" + A_ticket_0 + "): Temporary Error: " + error_32 + " " + ErrorDescription(error_32) + ". waiting.");
         else {
            f0_36("orderCloseReliable(" + A_ticket_0 + "): Permanent Error: " + error_32 + " " + ErrorDescription(error_32) + ". giving up.");
            return (0);
         }
      } else f0_36("orderCloseReliable(" + A_ticket_0 + "): Must wait for trade context");
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}
		 	 			  			 	  		 			   	 	  	 	 	 		 		 				 			  		    	  	 		 		 		 	    	 		   	 				 	 	   	 		  	 		  	 							  	  	 	 		 		 			  	  			
// 6D102BFA4D0541C929A10570A4C4302C
int f0_19(int A_ticket_0) {
   int error_8;
   bool is_deleted_4 = FALSE;
   f0_36("orderDeleteReliable(" + A_ticket_0 + ")");
   while (true) {
      while (IsTradeContextBusy()) {
         f0_36("OrderDeleteReliable(" + A_ticket_0 + "): Waiting for trade context.");
         Sleep(MathRand() / 10);
      }
      is_deleted_4 = OrderDelete(A_ticket_0);
      if (is_deleted_4) {
         f0_36("orderDeleteReliable(" + A_ticket_0 + "): success.");
         return (1);
      }
      error_8 = GetLastError();
      if (f0_33(error_8)) f0_36("orderDeleteReliable(" + A_ticket_0 + "): Temporary Error: " + error_8 + " " + ErrorDescription(error_8) + ". waiting.");
      else {
         f0_36("orderDeleteReliable(" + A_ticket_0 + "): Permanent Error: " + error_8 + " " + ErrorDescription(error_8) + ". giving up.");
         return (0);
      }
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}
			 	  		    	  		 	    	  	 						 	    		      	 		   	 	 		   		  	 							   				 		 	 	 	  	  	  	     		   	      				 	   		  	 	  	 		 	 
// B805B6CC986BBED9EDB59296A5C8F329
int f0_33(int Ai_0) {
   return (Ai_0 == 0 || Ai_0 == 2 || Ai_0 == 4 || Ai_0 == 6 || Ai_0 == 132 || Ai_0 == 135 || Ai_0 == 129 || Ai_0 == 136 || Ai_0 == 137 || Ai_0 == 138 || Ai_0 == 128 ||
      Ai_0 == 146);
}
	 		   			 			  	   	   		  					 		      			           				 	    				 		 	  	    	   		    		  		  	 	  	 	 	     		   	 	 		    				 	 			 	 	 
// AEBE538A40881ACCA42864A3A711FC63
int f0_28(string As_0) {
   int Li_12;
   int Li_16 = 0;
   if (IsTesting()) As_0 = "_" + As_0;
   for (int Li_8 = 0; Li_8 < StringLen(As_0); Li_8++) {
      Li_12 = StringGetChar(As_0, Li_8);
      Li_16 += Li_12;
      Li_16 = f0_21(Li_16, 5);
   }
   for (Li_8 = 0; Li_8 < StringLen(As_0); Li_8++) {
      Li_12 = StringGetChar(As_0, Li_8);
      Li_16 += Li_12;
      Li_16 = f0_21(Li_16, Li_12 & 15);
   }
   for (Li_8 = StringLen(As_0); Li_8 > 0; Li_8--) {
      Li_12 = StringGetChar(As_0, Li_8 - 1);
      Li_16 += Li_12;
      Li_16 = f0_21(Li_16, Li_16 & 15);
   }
   return (Li_16 & EMPTY_VALUE);
}
	  	 	   				  	  	 		 	 		 	 	    	 	 		  			 		 	  	 	 	 	   		  		          		    		 	 	 	  	 		 								   		 				 	    	  		  		   		 	    	
// 713AD45692B8B4933C4F136056ABC98E
int f0_21(int Ai_0, int Ai_4) {
   int Li_16 = 1 << Ai_4 - 1;
   int Li_12 = Ai_0 & Li_16;
   Ai_0 >>= Ai_4;
   Ai_0 |= Li_12 << (32 - Ai_4);
   return (Ai_0);
}
	 	 		  		     		  	 	 			 	  	 	 	 		 	  	  	 	   			 				 	  	  	     	 			  	  					    	   			 	 			 	  	  	     	 		 		   	  	      		 	    
// DBC53651ED5164E55A83349D2C249A4C
double f0_39(string A_symbol_0, int A_magic_8) {
   double Ld_ret_12 = 0;
   int order_total_24 = OrdersTotal();
   for (int pos_20 = 0; pos_20 < order_total_24; pos_20++) {
      OrderSelect(pos_20, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == A_magic_8 || OrderComment() == DoubleToStr(A_magic_8, 0) && OrderSymbol() == A_symbol_0) {
         if (OrderType() == OP_BUY) Ld_ret_12 += OrderLots();
         if (OrderType() == OP_SELL) Ld_ret_12 -= OrderLots();
      }
   }
   return (Ld_ret_12);
}
		 			 	  		     		  	    	   		 	 			  		 	 	  			 		     		   		 	   	 	  	   		  							       	  		 	 			   				 	   	      		 	   		  		  		
// 4A6ABD64D2481AE3539300FFEA9B2A7C
void f0_11(string As_0, int Ai_8, int Ai_12) {
   int order_total_16;
   double price_24;
   int Li_32;
   int cmd_36;
   int Lia_40[];
   int ticket_48;
   f0_36("closeOpenOrders(" + Ai_8 + "," + Ai_12 + ")");
   while (f0_29(Ai_8, Ai_12) > 0) {
      while (IsTradeContextBusy()) {
         f0_36("closeOpenOrders(): waiting for trade context.");
         Sleep(MathRand() / 10);
      }
      order_total_16 = OrdersTotal();
      RefreshRates();
      if (Ai_8 == 0) {
         price_24 = Bid;
         Li_32 = Gi_156;
      } else {
         price_24 = Ask;
         Li_32 = Gi_152;
      }
      f0_31(Lia_40, As_0, Ai_8, Ai_12);
      for (int index_44 = 0; index_44 < ArraySize(Lia_40); index_44++) {
         ticket_48 = Lia_40[index_44];
         f0_36("closeOpenOrdersBySymbol() is now dealing with ticket ", ticket_48);
         if (OrderSelect(ticket_48, SELECT_BY_TICKET)) {
            f0_36("closeOpenOrdersBySymbol(): OrderSelect(", ticket_48, ") was successful");
            if (IsTradeContextBusy()) break;
            cmd_36 = OrderType();
            if (cmd_36 == OP_BUYSTOP || cmd_36 == OP_SELLSTOP || cmd_36 == OP_BUYLIMIT || cmd_36 == OP_SELLLIMIT) {
               f0_19(ticket_48);
               break;
            }
            f0_23(ticket_48, OrderLots(), price_24, 999, Li_32);
            break;
         }
         f0_36("closeOpenOrdersBySymbol(): OrderSelect(", ticket_48, ") FAILED");
      }
   }
}
		  	 	 	 	  							  			 		 	  		  	 		 	    		 				 			   				 	   		 		 					 	 		    			 				 		   	  	 				 		   				 	 			 	   		     			  
// 105AC455BDA77E61CCC6AB05A8558636
double f0_1(string As_0, int Ai_8, double Ad_12, int Ai_20) {
   double price_32;
   int Li_40;
   int Lia_44[];
   int ticket_48;
   f0_36("reducePosition()");
   RefreshRates();
   if (Ai_8 == 0) {
      price_32 = Bid;
      Li_40 = Gi_156;
   }
   if (Ai_8 == 1) {
      price_32 = Ask;
      Li_40 = Gi_152;
   }
   f0_31(Lia_44, As_0, Ai_8, Ai_20);
   for (int index_24 = 0; index_24 < ArraySize(Lia_44); index_24++) {
      ticket_48 = Lia_44[index_24];
      f0_36("reducePositionBySymbol() is now dealing with ticket ", ticket_48);
      if (OrderSelect(ticket_48, SELECT_BY_TICKET)) {
         f0_36("reducePositionBySymbol(): OrderSelect(", ticket_48, ") was successful");
         if (NormalizeDouble(OrderLots() - Ad_12, 2) >= 0.0) {
            f0_36("reducePositionBySymbol(", ticket_48, "): now trying to partially close order");
            if (f0_23(ticket_48, Ad_12, price_32, 100, Li_40) == 1) {
               f0_36("reducePositionBySymbol(", ticket_48, "): success!");
               return (0);
            }
            f0_36("reducePositionBySymbol(", ticket_48, "): order found but failed to close: " + GetLastError());
            return (Ad_12);
         }
         f0_36("reducePositionBySymbol(", ticket_48, "): now trying to completely close order");
         if (f0_23(ticket_48, OrderLots(), price_32, 100, Li_40) == 1) {
            Ad_12 -= OrderLots();
            f0_36("reducePositionBySymbol(", ticket_48, "): order completely closed. " + OrderLots() + " Remaining lots to close: " + Ad_12);
         } else {
            f0_36("reducePositionBySymbol(", ticket_48, "): order found but failed to close: " + GetLastError());
            return (Ad_12);
         }
         if (NormalizeDouble(Ad_12, 2) != 0.0) continue;
         return (0);
      } else f0_36("reducePositionBySymbol(): OrderSelect(", ticket_48, ") FAILED");
   }
   f0_36("reducePosition(): nothing more to close. " + Ad_12 + " could not be closed");
   return (Ad_12);
}
	  	     					 	  	 	  	 		 			    	   		  		  		 	    	 	 	 	 		  			       	 		     	 	 	 		 	 		 	 						 	 		 			  	    		 		  			  		 	 	  	
// B3231C25F5F411DBA987D224D9961439
void f0_31(int &Aia_0[], string A_symbol_4, int A_cmd_12, int A_magic_16) {
   int Li_24;
   int Lia_28[];
   int Lia_32[];
   int order_total_36;
   int Lia_44[];
   bool Li_20 = TRUE;
   while (Li_20) {
      Li_20 = FALSE;
      Li_24 = 0;
      order_total_36 = OrdersTotal();
      ArrayResize(Lia_28, order_total_36);
      ArrayResize(Lia_32, order_total_36);
      for (int pos_40 = 0; pos_40 < order_total_36; pos_40++) {
         if (OrderSelect(pos_40, SELECT_BY_POS, MODE_TRADES)) {
            if (A_cmd_12 == -1 || OrderType() == A_cmd_12 && A_magic_16 == -1 || OrderMagicNumber() == A_magic_16 && OrderSymbol() == A_symbol_4) {
               Lia_28[Li_24] = OrderOpenTime();
               Lia_32[Li_24] = OrderTicket();
               Li_24++;
            }
         } else {
            Li_20 = TRUE;
            break;
         }
      }
   }
   ArrayResize(Lia_28, Li_24);
   ArrayResize(Lia_44, Li_24);
   ArrayResize(Lia_32, Li_24);
   ArrayResize(Aia_0, Li_24);
   if (Li_24 > 0) {
      ArrayCopy(Lia_44, Lia_28);
      ArraySort(Lia_44);
      for (pos_40 = 0; pos_40 < Li_24; pos_40++) {
         for (int index_48 = 0; index_48 < Li_24; index_48++)
            if (Lia_44[pos_40] == Lia_28[index_48]) Aia_0[pos_40] = Lia_32[index_48];
      }
   }
}
	  			 	 			      	  	   		   		   			  	  	 	  	 	 		   	 		   	  	   	    	   	   					 	      		  		 					   	 		 	          	  	   			 		  		
// 3553B2BEFFB0F4DDDBBD0FF72C130D8A
double f0_6(string A_symbol_0, int A_magic_8) {
   double Ld_ret_16 = 0;
   int order_total_24 = OrdersTotal();
   for (int pos_12 = 0; pos_12 < order_total_24; pos_12++) {
      OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == A_magic_8 && OrderSymbol() == A_symbol_0) Ld_ret_16 += OrderProfit() + OrderSwap() + OrderCommission();
   }
   return (Ld_ret_16);
}
	 	 	 		 	   		    	  	  	 	 	 	  	 	 	 	 	   	 	  		 	  		 			 	 	  			  					 	 			  		  	 		  	 	    		  			 	     	   		 		 	 	  						 					
// C3E2743759B30CAA374DC065876D30BB
double f0_34(string A_symbol_0, int A_magic_8) {
   double Ld_ret_12 = 0;
   int hist_total_20 = OrdersHistoryTotal();
   if (hist_total_20 > 0) {
      for (int pos_24 = 0; pos_24 < hist_total_20; pos_24++) {
         OrderSelect(pos_24, SELECT_BY_POS, MODE_HISTORY);
         if (OrderSymbol() == A_symbol_0 && OrderMagicNumber() == A_magic_8) Ld_ret_12 += OrderProfit() + OrderSwap() + OrderCommission();
      }
      return (Ld_ret_12);
   }
   return (0.0);
}
	 				   	 	   	     	 	 	    	   				 		 		 	 		   		 	 				  		 		      	 	  		 	 			 	      	 	   					 		  		  	 	 	  	    		 		    					   	
// B60C2A8A3952AD867507CD47A1554271
void f0_32(double Ad_0, double Ad_8, int Ai_16, int Ai_20, string As_24) {
   if (Ad_0 == 0.0) {
      if (Ad_8 > 0.0) f0_11(Symbol(), 0, Ai_20);
      if (Ad_8 < 0.0) f0_11(Symbol(), 1, Ai_20);
   }
   if (Ad_0 < 0.0) {
      if (Ad_8 == 0.0) f0_37(Symbol(), OP_SELL, MathAbs(Ad_0), Bid, Ai_16, 0, 0, As_24, Ai_20, 0, Red);
      if (Ad_8 > 0.0) {
         f0_11(Symbol(), 0, Ai_20);
         f0_37(Symbol(), OP_SELL, MathAbs(Ad_0), Bid, Ai_16, 0, 0, As_24, Ai_20, 0, Red);
      }
      if (Ad_8 < 0.0) {
         if (Ad_8 < Ad_0) f0_1(Symbol(), 1, MathAbs(Ad_8 - Ad_0), Ai_20);
         if (Ad_8 > Ad_0) f0_37(Symbol(), OP_SELL, MathAbs(Ad_0 - Ad_8), Bid, Ai_16, 0, 0, As_24 + " - ScaleIN", Ai_20, 0, Red);
      }
   }
   if (Ad_0 > 0.0) {
      if (Ad_8 == 0.0) f0_37(Symbol(), OP_BUY, Ad_0, Ask, Ai_16, 0, 0, As_24, Ai_20, 0, Blue);
      if (Ad_8 > 0.0) {
         if (Ad_8 > Ad_0) f0_1(Symbol(), 0, Ad_8 - Ad_0, Ai_20);
         if (Ad_8 < Ad_0) f0_37(Symbol(), OP_BUY, Ad_0 - Ad_8, Ask, Ai_16, 0, 0, As_24 + " - ScaleIN", Ai_20, 0, Blue);
      }
      if (Ad_8 < 0.0) {
         f0_11(Symbol(), 1, Ai_20);
         f0_37(Symbol(), OP_BUY, Ad_0, Ask, Ai_16, 0, 0, As_24, Ai_20, 0, Blue);
      }
   }
}
	  		 		 			 		   	   	  		  	 	   		 	 	  	  	 	 	 	 	  	 				 	  	 			    			 	   	  		 	  		  		     							 	 		  	      		 	  	 					 						
// AEDD1EC29E6ACAEB04C2F9AB35B0521B
int f0_29(int A_cmd_0, int A_magic_4) {
   int count_12 = 0;
   int order_total_16 = OrdersTotal();
   for (int pos_8 = 0; pos_8 < order_total_16; pos_8++) {
      OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES);
      if (A_magic_4 == -1 || OrderMagicNumber() == A_magic_4 && A_cmd_0 == -1 || OrderType() == A_cmd_0) count_12++;
   }
   return (count_12);
}
 		   	 	 			      	    	  				  		    	 			   	        			 	  	 				 	  	  	  	 	   			   		   	  	 	 		 	 	  	  		     	 		  	 				 					 	 		
// 831729A4F56963E1CC71DB4161E91EE3
double f0_24(double Ad_0, double Ad_8) {
   return (aaa(Gi_160, Ad_0, Ad_8));
}
	 	 	 		 	   		    	  	  	 	 	 	  	 	 	 	 	   	 	  		 	  		 			 	 	  			  					 	 			  		  	 		  	 	    		  			 	     	   		 		 	 	  						 					
// F1F348EBF7E6886FC1E743A675246401
double f0_44(double Ad_0, double Ad_8) {
   return (bbb(Gi_160, Ad_0, Ad_8));
}
	 		 		 		 		 			   						  	   	 		 			  						     							  		  			 	 	 	   		  	  	      	 				  		 	 	 	  		   						 	 	 		  			 	  			  	  
// 96776285244E8BDFE045ED78CE27F9F8
double f0_27(double Ad_0, double Ad_8) {
   return (ccc(Gi_160, Ad_0, Ad_8));
}
		 		   	 		 	 				    		 	  		 		 		  	 	 	   	 		 	  		  			 	 	 	 	  		  		 	 	  	 	  		  	 		 	   		  				 	 			   			   	 	 	 	 	     			   
// 579ECB8C7EC1A360770417B70DD4C717
double f0_17(double Ad_0, double Ad_8, double Ad_16) {
   return (cccc(Gi_160, Ad_0, Ad_8, Ad_16));
}
							 	  	  				   				       								 			 			 	  					 			 		 			  	 			 	 		 		 		   	    			    	 	   		 		 	 	 						   		 			  	   			 	  
// 5595D7EADE87C6016BF6DC47201779C6
double f0_16(double Ad_0, double Ad_8) {
   return (ddd(Gi_160, Ad_0, Ad_8));
}
			 	        	 	 	 	   	   	 		  		 	  				    			 		  	  	 		 				  	   					 						 	 		 	 	 	   	  			   		 			     	 			 	 				  	  	 	 		  	
// 53DE7D064BF91D226B6295C5946DC7FB
int f0_13() {
   if (xxx(Gi_160) == 1) return (1);
   return (0);
}
	 		 			 		 		 			   	 	 	  	 			 		 	  	 	  	  		 	 	 	  				  	 	 					  			  	  	  	 		  		 	 	       					  			  	 		   		  	 	 			   					 
// 16299D7A8EEA25FE62FC48C14B3643B5
int f0_3() {
   if (G_time_272 == Time[0]) return (0);
   G_time_272 = Time[0];
   return (1);
}
		 				 	 		  					  				 	     		 					 	 	 			 		 					  		 		 	 	  	 		  	 		 	  		   		   			 	  	 	  			 		 			 					    		 	 	  	    		 	  
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   f0_4();
   Gi_176 = TRUE;
   return (0);
}
	    	 				 	   	 				  					 			    	      		    		 	  		          	  		  	       	 			  			   							  		       	 		  	  		       	  	 	     	 
// 1C86E8D4535299BB79FDC73CA04439CC
int f0_4() {
   Comment("");
   if (timeframe <= 0) timeframe = Period();
   Gi_444 = f0_28("PotenzaFX_DLS_Trader" + Symbol() + timeframe);
   f0_36("Magic Number = ", Gi_444);
   string Ls_0 = StringSubstr(Symbol(), 0, 3);
   string Ls_8 = StringSubstr(Symbol(), 3, 3);
   if (Ls_0 == "AUD") Gi_516 = 0;
   if (Ls_0 == "CAD") Gi_516 = 1;
   if (Ls_0 == "CHF") Gi_516 = 2;
   if (Ls_0 == "EUR") Gi_516 = 3;
   if (Ls_0 == "GBP") Gi_516 = 4;
   if (Ls_0 == "NZD") Gi_516 = 6;
   if (Ls_0 == "USD") Gi_516 = 7;
   if (Ls_8 == "AUD") Gi_520 = 0;
   if (Ls_8 == "CAD") Gi_520 = 1;
   if (Ls_8 == "CHF") Gi_520 = 2;
   if (Ls_8 == "GBP") Gi_520 = 4;
   if (Ls_8 == "JPY") Gi_520 = 5;
   if (Ls_8 == "NZD") Gi_520 = 6;
   if (Ls_8 == "USD") Gi_520 = 7;
   double icustom_16 = iCustom(Symbol(), timeframe, "PotenzaFX_Correlation", e_mail, "", algo, use_default_periods, period, smoothing, 0, 0, 0, bar);
   f0_0(icustom_16);
   return (0);
}
	 		   	 	 			      	    	  				  		    	 			   	        			 	  	 				 	  	  	  	 	   			   		   	  	 	 		 	 	  	  		     	 		  	 				 					 	 		
// 52D46093050F38C27267BCE42543EF60
int deinit() {
   for (int count_0 = 0; count_0 < 7; count_0++) {
      for (int count_4 = 0; count_4 < 30; count_4++) {
         ObjectDelete("background" + count_0 + count_4);
         ObjectDelete("background" + count_0 + ((count_4 + 1)));
         ObjectDelete("background" + count_0 + ((count_4 + 2)));
      }
   }
   return (0);
}
	    			 		 	 	   					  				  	     		 	   			 	 		 		  	    	 	   	 		   	  	 	  	 	 		 			 	  					  			   	 	 	 			    		 	 	   	 				    			
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   if (!Gi_176) {
      f0_4();
      Gi_176 = TRUE;
   }
   f0_38();
   return (0);
}
		  			   	   		 			 			  		     	  						   											    	 				    	  	 		 				 			  				  		  		 	 		 	 	 					  			 	 	  				    	 	   	 	 	
// CE950C824EB925C8055E76804B523700
int f0_38() {
   double icustom_12;
   f0_40(debug_print);
   if (minutes_for_checking > timeframe) minutes_for_checking = Period();
   if (automatic_max_lot_size) max_lot_size = NormalizeDouble(AccountEquity() / 100000.0 * leverage, 2);
   for (int index_8 = 0; index_8 < 3; index_8++) {
      Gda_492[index_8] = iCustom(Symbol(), timeframe, "PotenzaFX_Powerlines", e_mail, "", algo, use_default_periods, period, smoothing, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255,
         255, 255, 255, 255, 255, 255, 255, 0, 100, 0, 0, 1, 10, "", Gi_516, index_8);
      Gda_496[index_8] = iCustom(Symbol(), timeframe, "PotenzaFX_Powerlines", e_mail, "", algo, use_default_periods, period, smoothing, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255,
         255, 255, 255, 255, 255, 255, 255, 0, 100, 0, 0, 1, 10, "", Gi_520, index_8);
      Gda_500[index_8] = f0_24(Gda_492[index_8], -Gda_496[index_8]);
      Gda_504[index_8] = NormalizeDouble(max_lot_size * NormalizeDouble(f0_17(Gda_500[index_8], 0.005, lot_steps), 0) / lot_steps, 2);
      if (Gda_504[index_8] > max_lot_size) Gda_504[index_8] = max_lot_size;
      if (Gda_504[index_8] < -1.0 * max_lot_size) Gda_504[index_8] = f0_27(-1, max_lot_size);
   }
   double Ld_0 = f0_39(Symbol(), Gi_444);
   Gi_460 = TRUE;
   if (check_corr_to_enter == TRUE) {
      icustom_12 = iCustom(Symbol(), timeframe, "PotenzaFX_Correlation", e_mail, "", algo, use_default_periods, period, smoothing, 0, 0, 0, bar);
      if (icustom_12 > max_corr_level) Gi_460 = FALSE;
   }
   if (wait_for_cross == FALSE) Gi_464 = TRUE;
   if (wait_for_cross == TRUE && Gi_464 == FALSE) {
      if ((Gda_504[bar + 1] <= 0.0 && Gda_504[bar] > 0.0) || (Gda_504[bar + 1] >= 0.0 && Gda_504[bar] < 0.0)) Gi_464 = TRUE;
      else Gi_464 = FALSE;
   }
   Gd_452 = 60 * Hour() + Minute();
   if (MathAbs(Gda_504[0] - Ld_0) > 0.0 && MathMod(Gd_452, minutes_for_checking) == 0.0 || (realtime_scaleout == TRUE && Gi_508 == FALSE && MathAbs(Gda_504[0]) < MathAbs(Ld_0)) &&
      Gi_488 == FALSE) {
      if (Ld_0 == 0.0) {
         if (Gi_464 && Gi_460) {
            if (enable_trading && f0_13()) {
               if (enable_dls) f0_32(Gda_504[0], Ld_0, slippage, Gi_444, EA_comment);
               else {
                  if (Gda_504[bar] > 0.0) f0_32(non_dls_lot_size, Ld_0, slippage, Gi_444, EA_comment);
                  if (Gda_504[bar] < 0.0) f0_32(-non_dls_lot_size, Ld_0, slippage, Gi_444, EA_comment);
               }
            }
            if (sound_alert_on_cross) PlaySound(sound_file);
            if (visual_alert_on_cross) f0_42("PotenzaFX - " + Symbol() + " - " + timeframe + " - Entry Signal");
            Gi_488 = TRUE;
            Gi_508 = TRUE;
         }
      }
      if (Ld_0 != 0.0) {
         if (enable_trading && f0_13()) {
            if (enable_dls) f0_32(Gda_504[0], Ld_0, slippage, Gi_444, EA_comment);
            else {
               if (Ld_0 < 0.0 && Gda_504[bar] > 0.0) f0_32(non_dls_lot_size, Ld_0, slippage, Gi_444, EA_comment);
               if (Ld_0 > 0.0 && Gda_504[bar] < 0.0) f0_32(-non_dls_lot_size, Ld_0, slippage, Gi_444, EA_comment);
            }
         }
         Gi_488 = TRUE;
      }
   }
   if (MathMod(Gd_452, minutes_for_checking) > 0.0) Gi_488 = FALSE;
   if (f0_3() && Gi_508 == TRUE) Gi_508 = FALSE;
   f0_0(icustom_12);
   return (0);
}
		    	 	 	 									 			 				  		    		 	  	 		 			  			    			 	  			 		 	 			 	 	     								 			  	  	  			 		 	 				 					 	  			      		  
// 0021B962A6B2F5C54E9D820A33FBD187
void f0_0(double Ad_0) {
   string Ls_16;
   double Ld_8 = f0_39(Symbol(), Gi_444);
   Gd_472 = f0_34(Symbol(), Gi_444);
   Gd_480 = f0_6(Symbol(), Gi_444);
   Ls_16 = Ls_16 
   + "\n " + "POTENZA FX DLS Trader v1.4";
   Ls_16 = Ls_16 
   + "\n      www.pimpmyea.com";
   Ls_16 = Ls_16 
   + "\n --------------------------------------------";
   Ls_16 = Ls_16 
   + "\n ";
   for (int count_24 = 0; count_24 < Seconds() % 34; count_24++) {
      if (Gi_460 == TRUE) Ls_16 = Ls_16 + "|";
      else Ls_16 = Ls_16 + ".";
   }
   Ls_16 = Ls_16 
   + "\n --------------------------------------------";
   Ls_16 = Ls_16 
   + "\n  " + StringSubstr(Symbol(), 0, 3) + " Score: " + DoubleToStr(Gda_492[0], 2) + " (" + DoubleToStr(Gda_492[1], 2) + ")";
   if (Gda_492[0] > Gda_492[1]) Ls_16 = Ls_16 + " +";
   if (Gda_492[0] < Gda_492[1]) Ls_16 = Ls_16 + " -";
   Ls_16 = Ls_16 
   + "\n  " + StringSubstr(Symbol(), 3, 3) + " Score: " + DoubleToStr(Gda_496[0], 2) + " (" + DoubleToStr(Gda_496[1], 2) + ")";
   if (Gda_496[0] > Gda_496[1]) Ls_16 = Ls_16 + " +";
   if (Gda_496[0] < Gda_496[1]) Ls_16 = Ls_16 + " -";
   Ls_16 = Ls_16 
   + "\n  Spread: " + DoubleToStr(Gda_500[0], 2) + " (" + DoubleToStr(Gda_500[1], 2) + ")";
   if (Gda_500[0] > Gda_500[1]) Ls_16 = Ls_16 + " +";
   if (Gda_500[0] < Gda_500[1]) Ls_16 = Ls_16 + " -";
   Ls_16 = Ls_16 
   + "\n --------------------------------------------";
   Ls_16 = Ls_16 
   + "\n  DLS Lots: " + DoubleToStr(Gda_504[0], 2) + " (" + DoubleToStr(Gda_504[1], 2) + ")";
   Ls_16 = Ls_16 
   + "\n  Open Lots: " + DoubleToStr(Ld_8, 2) + " (" + DoubleToStr(f0_44(Gda_504[0], Ld_8), 2) + ")";
   if (check_corr_to_enter == TRUE) {
      Ls_16 = Ls_16 
      + "\n --------------------------------------------";
      Ls_16 = Ls_16 
      + "\n  Correlation Limit: " + DoubleToStr(max_corr_level, 2);
      Ls_16 = Ls_16 
      + "\n  Correlation: " + DoubleToStr(Ad_0, 2);
      if (Gi_460 == TRUE) Ls_16 = Ls_16 + " (OK!)";
      else Ls_16 = Ls_16 + " (not OK)";
   }
   if (wait_for_cross == TRUE) {
      Ls_16 = Ls_16 
      + "\n --------------------------------------------";
      Ls_16 = Ls_16 
      + "\n  Cross: ";
      if (Gi_464 == TRUE) Ls_16 = Ls_16 + " (OK!)";
      else Ls_16 = Ls_16 + " (not OK)";
   }
   Ls_16 = Ls_16 
   + "\n --------------------------------------------";
   Ls_16 = Ls_16 
   + "\n  Closed Profits: $" + DoubleToStr(Gd_472, 2);
   Ls_16 = Ls_16 
   + "\n  Open Profits: $" + DoubleToStr(Gd_480, 2);
   Ls_16 = Ls_16 
   + "\n --------------------------------------------";
   Ls_16 = Ls_16 
   + "\n  Minutes For Checking: " + DoubleToStr(minutes_for_checking, 0);
   Ls_16 = Ls_16 
   + "\n  Next Check in: " + DoubleToStr(minutes_for_checking - MathMod(Gd_452, minutes_for_checking), 0) + " min";
   Comment(Ls_16);
   if (Gda_500[0] < 0.0) G_color_468 = f0_2(255, 0, 0, 0, 0, 0, 0, 200, MathAbs(Gda_500[0]));
   if (Gda_500[0] > 0.0) G_color_468 = f0_2(0, 255, 0, 0, 0, 0, 0, 200, MathAbs(Gda_500[0]));
   int Li_28 = 10;
   if (check_corr_to_enter) Li_28++;
   if (wait_for_cross) Li_28++;
   if (Gi_512 || Seconds() % 5 == 0) {
      Gi_512 = FALSE;
      for (int count_32 = 0; count_32 < 7; count_32++) {
         for (int count_36 = 0; count_36 < Li_28; count_36++) {
            ObjectDelete("background" + count_32 + count_36);
            ObjectDelete("background" + count_32 + ((count_36 + 1)));
            ObjectDelete("background" + count_32 + ((count_36 + 2)));
            ObjectCreate("background" + count_32 + count_36, OBJ_LABEL, 0, 0, 0);
            ObjectSetText("background" + count_32 + count_36, "n", 30, "Wingdings", G_color_468);
            ObjectSet("background" + count_32 + count_36, OBJPROP_XDISTANCE, 20 * count_32);
            ObjectSet("background" + count_32 + count_36, OBJPROP_YDISTANCE, 23 * count_36 + 9);
         }
      }
   }
}
	 		 	  		 		  		   		 			  	 	 	 		 	 	  				 	     	 					   	  			   	 	    	  	  		     	  			  				 	 	   	   			 		 	 	  	  			    			     
// 889574AEBACDA6BFD3E534E2B49B8028
int f0_25(int Ai_0, int Ai_4, int Ai_8) {
   int Li_ret_12 = MathMin(255, MathAbs(Ai_0)) + 256.0 * MathMin(255, MathAbs(Ai_4)) + 65536.0 * MathMin(255, MathAbs(Ai_8));
   return (Li_ret_12);
}
	 		   	 	 			      	    	  				  		    	 			   	        			 	  	 				 	  	  	  	 	   			   		   	  	 	 		 	 	  	  		     	 		  	 				 					 	 		
// 11941B95814292EFDC0F75562856CCE6
int f0_2(int Ai_0, int Ai_4, int Ai_8, int Ai_12, int Ai_16, int Ai_20, double Ad_24, double Ad_32, double Ad_40) {
   double Ld_48 = Ad_32 - Ad_24;
   Ad_40 = Ad_32 - Ad_40;
   double Ld_56 = f0_16(f0_44(Ai_0, Ai_12), f0_44(Ld_48, 1));
   double Ld_64 = f0_16(f0_44(Ai_4, Ai_16), f0_44(Ld_48, 1));
   double Ld_72 = f0_16(f0_44(Ai_8, Ai_20), f0_44(Ld_48, 1));
   return (f0_25(f0_44(Ai_0, f0_27(Ld_56, Ad_40)), f0_44(Ai_4, f0_27(Ld_64, Ad_40)), f0_44(Ai_8, f0_27(Ld_72, Ad_40))));
}

Recommend