Navigation:Home > Content >

ReticoloFX_Ring_CAD-EUR-USD_(2).mq4

Time: 2018-04-16 | Download file:ReticoloFX_Ring_CAD-EUR-USD_(2).mq4

/*
   Generated by EX4-TO-MQ4 decompiler LITE V4.0.438.1 [-]
   Website: https://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2012, PimpMyEA.com"
#property link      "http://www.pimpmyea.com"

//#include 
#import "stdlib.ex4"
   string ErrorDescription(int a0);
#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

int gi_76 = 30;
int gi_80 = 60;
int gi_84 = 0;
int gi_88 = 0;
string gsa_92[12];
int gia_96[12];
int gi_100 = 0;
int gi_104 = 60000;
int gi_108 = 180000;
int gi_112 = 0;
int gi_116 = 0;
int gi_120 = 0;
string gsa_124[12];
int gia_128[12];
int gi_132 = 0;
int gi_136 = 2000;
int gi_140 = 60000;
int gi_144 = 0;
int gi_148 = 0;
int gi_152 = 0;
bool gi_156 = FALSE;
bool gi_160 = FALSE;
int gi_164;
bool gi_168 = FALSE;
int gi_172 = 0;
int gi_176 = 0;
bool gi_180 = FALSE;
double gd_184 = 0.0;
int gi_192 = 86400;
string gs_196 = "update.html";
bool gi_204 = FALSE;
string gs_208;
int gi_216 = 0;
int gi_220 = 1;
string gs_224;
int gi_232 = 0;
int gi_236 = 0;
int gi_240 = 0;
string gs_244;
int gia_252[1];
string gs_260 = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
int gia_268[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_272[1];
string e_mail = "";
extern double lot_size = 0.01;
extern double target_profit = 10.0;
bool gi_304 = TRUE;
double gd_308 = 3.0;
extern int minimum_step = 20;
extern bool stop_after_close = FALSE;
extern bool trend_following = TRUE;
extern bool closeby_enabled = TRUE;
extern bool on_hold = FALSE;
extern bool show_next_trades = TRUE;
extern bool show_open_trades = TRUE;
extern bool show_alert = TRUE;
extern bool play_sound = TRUE;
double gd_352 = 1.0;
int gi_360 = 30;
int gi_364 = PERIOD_H4;
int gi_368 = 30;
bool gi_372 = TRUE;
int gi_376 = 1;
double gd_380 = 5.0;
int gi_388;
double gd_392;
double gd_400;
double gd_424;
double gd_432;
double gd_440;
double gd_448;
double gd_456;
int gi_480;
int gi_484;
int gi_488;
bool gi_492 = FALSE;
bool gi_496 = FALSE;
string gs_500;
string gs_508;
double gd_516 = 0.0;
double gd_524 = 0.0;
int gi_532;
string gsa_536[];
string gs_540;
bool gi_548 = FALSE;
string gs_552;
string gs_560;
int gia_568[];
int gia_572[];
int gi_576 = SteelBlue;
string gs_580;
bool gi_588 = TRUE;
extern string comment = "ReticoloFX_Ring_CAD-EUR-USD";

   double aaa(int a0, double a1, double a2){return (a1+a2);}
   double aaaa(int a0, double a1, double a2, double a3){return (a1+a2+a3);}
   double aaaaa(int a0, double a1, double a2, double a3, double a4){return (a1+a2+a3+a4);}
   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 ccccc(int a0, double a1, double a2, double a3, double a4){return (a1*a2*a3*a4);}
   double ddd(int a0, double a1, double a2){return (a1/a2);}
   string eee(int a0, string a1, string a2){return (a1+a2);}
   string eeee(int a0, string a1, string a2, string a3){return (a1+a2+a3);}
   string eeeee(int a0, string a1, string a2, string a3, string a4){return (a1+a2+a3+a4);}
   int xxx(int a0){return (1);}
   
void f0_34() {
   if (gi_160 == FALSE) {
      for (int li_0 = 0; li_0 < 12; li_0++) {
         gsa_92[li_0] = "";
         gia_96[li_0] = 0;
      }
      for (li_0 = 0; li_0 < 100; li_0++) {
         gsa_124[li_0] = "";
         gia_128[li_0] = 0;
      }
      gi_160 = TRUE;
   }
}

int f0_2(string as_0, int ai_8, double ad_12, double ad_20, int ai_28, double ad_32, double ad_40, string as_48 = "", int ai_56 = 0, int ai_60 = 0, color ai_64 = -1) {
   f0_34();
   int li_68 = TimeCurrent();
   int li_72 = -2;
   if (li_68 < gi_88 + gi_76) {
      if (gi_84 == 0) {
         gi_84 = li_68 + gi_80;
         if (gi_156) Print("SOS_time_next = ", TimeToStr(gi_84, TIME_DATE|TIME_SECONDS));
      } else {
         gi_84 += gi_80;
         if (gi_156) Print("SOS_time_next = ", TimeToStr(gi_84, TIME_DATE|TIME_SECONDS));
      }
   }
   gi_88 = li_68;
   if (li_68 >= gi_84) {
      gi_84 = 0;
      li_72 = OrderSend(as_0, ai_8, ad_12, ad_20, ai_28, ad_32, ad_40, as_48, ai_56, ai_60, ai_64);
   }
   return (li_72);
}

void f0_50(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_34();
   int li_496 = GetTickCount();
   if (gi_156) gi_148++;
   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_23(ls_500);
   bool li_512 = li_508 == -1 || li_496 >= li_508 + gi_136;
   int li_516 = f0_11();
   bool li_520 = li_516 == 0 || li_496 >= li_516 + gi_140;
   if (li_512 == FALSE && li_496 >= gi_144) {
      gi_144 = li_496 + gi_136;
      if (gi_156) Print("########## Filter1: UPDATED SP_time_next = ", TimeToStr(gi_144 / 1000, TIME_SECONDS), "; counter = ", gi_148);
   }
   if (li_520 == FALSE && li_496 >= gi_144) {
      gi_144 = li_496 + gi_140;
      if (gi_156) Print("########## Filter2: UPDATED SP_time_next = ", TimeToStr(gi_144 / 1000, TIME_SECONDS), "; counter = ", gi_148);
   }
   if (li_496 >= gi_144) {
      if (gi_156) {
         gi_152++;
         Print("SP_time_now = ", TimeToStr(li_496 / 1000, TIME_SECONDS), "; SP_time_next = ", TimeToStr(gi_144 / 1000, TIME_SECONDS), "; counter = ", gi_148, "; counter2 = ",
            gi_152);
      }
      gi_132 = (gi_132 + 1) % 100;
      gsa_124[gi_132] = ls_500;
      gia_128[gi_132] = li_496;
      Print(ls_500);
   }
}

int f0_23(string as_0) {
   int li_12;
   int li_8 = -1;
   for (int li_16 = 0; li_16 < 100; li_16++) {
      li_12 = (gi_132 + 100 - li_16) % 100;
      if (as_0 == gsa_124[li_12]) return (gia_128[li_12]);
   }
   return (li_8);
}

int f0_11() {
   return (gia_128[(gi_132 + 1) % 100]);
}

void f0_59(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_34();
   int li_496 = GetTickCount();
   if (gi_156) gi_116++;
   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_9(ls_500);
   bool li_512 = li_508 == -1 || li_496 >= li_508 + gi_104;
   int li_516 = f0_20();
   bool li_520 = li_516 == 0 || li_496 >= li_516 + gi_108;
   if (li_512 == FALSE && li_496 >= gi_112) {
      gi_112 = li_496 + gi_104;
      if (gi_156) Print("########## Filter1: UPDATED SA_time_next = ", TimeToStr(gi_112 / 1000, TIME_SECONDS), "; counter = ", gi_116);
   }
   if (li_520 == FALSE && li_496 >= gi_112) {
      gi_112 = li_496 + gi_108;
      if (gi_156) Print("########## Filter2: UPDATED SA_time_next = ", TimeToStr(gi_112 / 1000, TIME_SECONDS), "; counter = ", gi_116);
   }
   if (li_496 >= gi_112) {
      if (gi_156) {
         gi_120++;
         Print("SA_time_now = ", TimeToStr(li_496 / 1000, TIME_SECONDS), "; SA_time_next = ", TimeToStr(gi_112 / 1000, TIME_SECONDS), "; counter = ", gi_116, "; counter2 = ",
            gi_120);
      }
      gi_100 = (gi_100 + 1) % 12;
      gsa_92[gi_100] = ls_500;
      gia_96[gi_100] = li_496;
      Alert(ls_500);
   }
}

int f0_9(string as_0) {
   int li_12;
   int li_8 = -1;
   for (int li_16 = 0; li_16 < 12; li_16++) {
      li_12 = (gi_100 + 12 - li_16) % 12;
      if (as_0 == gsa_92[li_12]) return (gia_96[li_12]);
   }
   return (li_8);
}

int f0_20() {
   return (gia_96[(gi_100 + 1) % 12]);
}

int f0_51(string as_0, int ai_8, double ad_12, double ad_20, int ai_28, double ad_32, double ad_40, string as_48 = "", int ai_56 = 0, int ai_60 = 0, int ai_64 = -1) {
   int li_68;
   int li_72;
   f0_50("orderSendReliable(" + as_0 + "," + ai_8 + "," + ad_12 + "," + ad_20 + "," + ai_28 + "," + ad_32 + "," + ad_40 + "," + as_48 + "," + ai_56 + "," + ai_60 + "," +
      ai_64 + ")");
   while (true) {
      if (IsStopped()) {
         f0_50("orderSendReliable(): Trading is stopped!");
         return (-1);
      }
      RefreshRates();
      if (ai_8 == 0) ad_20 = Ask;
      if (ai_8 == 1) ad_20 = Bid;
      if (!IsTradeContextBusy()) {
         li_68 = f0_2(as_0, ai_8, ad_12, NormalizeDouble(ad_20, MarketInfo(as_0, MODE_DIGITS)), ai_28, NormalizeDouble(ad_32, MarketInfo(as_0, MODE_DIGITS)), NormalizeDouble(ad_40,
            MarketInfo(as_0, MODE_DIGITS)), as_48, ai_56, ai_60, ai_64);
         if (li_68 > 0) {
            f0_50("orderSendReliable(): Success! Ticket: " + li_68);
            return (li_68);
         }
         li_72 = GetLastError();
         if (f0_45(li_72)) f0_50("orderSendReliable(): Temporary Error: " + li_72 + " " + ErrorDescription(li_72) + ". waiting.");
         else {
            f0_50("orderSendReliable(): Permanent Error: " + li_72 + " " + ErrorDescription(li_72) + ". giving up.");
            return (-1);
         }
      } else f0_50("orderSendReliable(): Must wait for trade context");
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}

int f0_32(int ai_0, double ad_4, double ad_12, int ai_20, color ai_24 = -1) {
   bool li_28;
   int li_32;
   f0_50("orderCloseReliable(" + ai_0 + ")");
   OrderSelect(ai_0, SELECT_BY_TICKET, MODE_TRADES);
   while (true) {
      if (IsStopped()) {
         f0_50("orderCloseReliable(" + ai_0 + "): Trading is stopped!");
         return (0);
      }
      RefreshRates();
      if (OrderType() == OP_BUY) ad_12 = Bid;
      if (OrderType() == OP_SELL) ad_12 = Ask;
      if (!IsTradeContextBusy()) {
         li_28 = OrderClose(ai_0, ad_4, NormalizeDouble(ad_12, MarketInfo(OrderSymbol(), MODE_DIGITS)), ai_20, ai_24);
         if (li_28) {
            f0_50("orderCloseReliable(" + ai_0 + "): Success!");
            return (1);
         }
         li_32 = GetLastError();
         if (f0_45(li_32)) f0_50("orderCloseReliable(" + ai_0 + "): Temporary Error: " + li_32 + " " + ErrorDescription(li_32) + ". waiting.");
         else {
            f0_50("orderCloseReliable(" + ai_0 + "): Permanent Error: " + li_32 + " " + ErrorDescription(li_32) + ". giving up.");
            return (0);
         }
      } else f0_50("orderCloseReliable(" + ai_0 + "): Must wait for trade context");
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}

int f0_39(int ai_0, int ai_4, color ai_8 = -1) {
   bool li_12;
   int li_16;
   f0_50("orderCloseByReliable()");
   while (true) {
      if (IsStopped()) {
         f0_50("orderCloseByReliable(): Trading is stopped!");
         return (0);
      }
      if (!IsTradeContextBusy()) {
         li_12 = OrderCloseBy(ai_0, ai_4, ai_8);
         if (li_12) {
            f0_50("orderCloseByReliable(): Success!");
            return (1);
         }
         li_16 = GetLastError();
         if (f0_45(li_16)) f0_50("orderCloseByReliable(): Temporary Error: " + li_16 + " " + ErrorDescription(li_16) + ". waiting.");
         else {
            f0_50("orderCloseByReliable(): Permanent Error: " + li_16 + " " + ErrorDescription(li_16) + ". giving up.");
            return (0);
         }
      } else f0_50("orderCloseByReliable(): Must wait for trade context");
      Sleep(MathRand() / 10);
   }
   return /*(WARN)*/;
}

int f0_45(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);
}

int f0_41(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_27(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_27(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_27(li_16, li_16 & 15);
   }
   return (li_16 & EMPTY_VALUE);
}

int f0_27(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);
}

void f0_60(int ai_0) {
   gi_164 = ai_0;
}

double f0_33(double ad_0, double ad_8) {
   return (aaa(gi_164, ad_0, ad_8));
}

double f0_40(double ad_0, double ad_8, double ad_16) {
   return (aaaa(gi_164, ad_0, ad_8, ad_16));
}

double f0_30(double ad_0, double ad_8, double ad_16, double ad_24) {
   return (aaaaa(gi_164, ad_0, ad_8, ad_16, ad_24));
}

double f0_61(double ad_0, double ad_8) {
   return (bbb(gi_164, ad_0, ad_8));
}

double f0_36(double ad_0, double ad_8) {
   return (ccc(gi_164, ad_0, ad_8));
}

double f0_22(double ad_0, double ad_8, double ad_16) {
   return (cccc(gi_164, ad_0, ad_8, ad_16));
}

double f0_21(double ad_0, double ad_8) {
   return (ddd(gi_164, ad_0, ad_8));
}

string f0_14(string as_0, string as_8) {
   return (eee(gi_164, as_0, as_8));
}

string f0_18(string as_0, string as_8, string as_16, string as_24) {
   return (eeeee(gi_164, as_0, as_8, as_16, as_24));
}

int f0_17() {
   if (xxx(gi_164) == 1) return (1);
   return (0);
}

string f0_26(string as_0, string as_8, string as_16) {
   string ls_24;
   string ls_32;
   f0_31(as_16, ls_24);
   return (f0_10(f0_56(as_0 + as_8 + "/" + ls_24 + ".html")));
}

string f0_12(string as_0, string as_8, string as_16) {
   string ls_24;
   return (f0_10(f0_56(as_0 + as_8 + "/" + as_16)));
}

void f0_31(string as_0, string &as_8) {
   int li_28;
   int li_32;
   int li_36;
   int li_40;
   int li_44;
   int li_48;
   int li_52;
   int li_16 = 0;
   int li_20 = 0;
   int li_24 = StringLen(as_0);
   while (li_16 < li_24) {
      li_36 = StringGetChar(as_0, li_16);
      li_16++;
      if (li_16 >= li_24) {
         li_32 = 0;
         li_28 = 0;
         li_20 = 2;
      } else {
         li_32 = StringGetChar(as_0, li_16);
         li_16++;
         if (li_16 >= li_24) {
            li_28 = 0;
            li_20 = 1;
         } else {
            li_28 = StringGetChar(as_0, li_16);
            li_16++;
         }
      }
      li_40 = li_36 >> 2;
      li_44 = (li_36 & 3 * 16) | li_32 >> 4;
      li_48 = (li_32 & 15 * 4) | li_28 >> 6;
      li_52 = li_28 & 63;
      as_8 = as_8 + CharToStr(gia_268[li_40]);
      as_8 = as_8 + CharToStr(gia_268[li_44]);
      switch (li_20) {
      case 0:
         as_8 = as_8 + CharToStr(gia_268[li_48]);
         as_8 = as_8 + CharToStr(gia_268[li_52]);
         break;
      case 1:
         as_8 = as_8 + CharToStr(gia_268[li_48]);
         as_8 = as_8 + "=";
         break;
      case 2:
         as_8 = as_8 + "==";
      }
   }
}

string f0_56(string as_0) {
   string ls_12;
   string ls_20;
   for (int li_8 = StringFind(as_0, " "); li_8 != -1; li_8 = StringFind(as_0, " ")) {
      ls_12 = StringTrimLeft(StringTrimRight(StringSubstr(as_0, 0, StringFind(as_0, " ", 0))));
      ls_20 = StringTrimLeft(StringTrimRight(StringSubstr(as_0, StringFind(as_0, " ", 0))));
      as_0 = ls_12 + "%20" + ls_20;
   }
   return (as_0);
}

string f0_10(string as_0) {
   gi_240 = 0;
   for (gi_232 = FALSE; gi_240 < 3 && gi_232 == FALSE; gi_240++) {
      if (gi_236 != 0) gi_232 = InternetOpenUrlA(gi_236, as_0, 0, 0, -2079850240, 0);
      if (gi_232 == FALSE) {
         InternetCloseHandle(gi_236);
         gi_236 = InternetOpenA("mymt4InetSession", gi_220, 0, 0, 0);
      }
   }
   gs_244 = "";
   gia_252[0] = 1;
   while (gia_252[0] > 0) {
      InternetReadFile(gi_232, gs_260, 200, gia_252);
      if (gia_252[0] > 0) gs_244 = gs_244 + StringSubstr(gs_260, 0, gia_252[0]);
   }
   InternetCloseHandle(gi_232);
   return (gs_244);
}

string f0_8(string as_0) {
   int li_8;
   for (int li_12 = 0; li_12 < StringLen(as_0); li_12++) {
      li_8 = StringGetChar(as_0, li_12);
      if (li_8 >= 'A' && li_8 <= 'Z') as_0 = StringSetChar(as_0, li_12, li_8 + 32);
   }
   return (as_0);
}

int f0_49(string as_0, string as_8, string &asa_16[], int ai_20 = 0) {
   int li_24;
   int li_28;
   int li_32;
   if (StringFind(as_0, as_8) < 0) {
      ArrayResize(asa_16, 1);
      asa_16[0] = as_0;
   } else {
      li_24 = 0;
      li_28 = 0;
      li_32 = 0;
      while (li_28 > -1) {
         li_32++;
         li_28 = StringFind(as_0, as_8, li_24);
         ArrayResize(asa_16, li_32);
         if (li_28 > -1) {
            if (li_28 - li_24 > 0) asa_16[li_32 - 1] = StringSubstr(as_0, li_24, li_28 - li_24);
         } else asa_16[li_32 - 1] = StringSubstr(as_0, li_24, 0);
         li_24 = li_28 + 1;
      }
   }
   if (ai_20 == 0 || ai_20 == ArraySize(asa_16)) return (1);
   return (0);
}

void f0_19(double ad_0, string as_8 = "update.html") {
   gd_184 = ad_0;
   gs_196 = as_8;
}

int f0_15(string as_0, string as_8, string as_16, int ai_24) {
   string ls_32;
   string ls_40;
   int li_48;
   string ls_52;
   string lsa_60[];
   double ld_64;
   string ls_72;
   int li_28 = 300;
   if (gi_168) li_28 = 21600;
   if (TimeCurrent() >= gi_172 + li_28) {
      gi_172 = TimeCurrent();
      ls_32 = f0_8(as_0);
      if (ai_24 == 1 && IsDemo() == FALSE) ls_32 = ls_32 + "@" + AccountNumber();
      Print("authorization = ", ls_32);
      ls_40 = f0_26(as_8, as_16, ls_32);
      li_48 = StrToInteger(ls_40);
      if (xxx(li_48) == 1) {
         gi_168 = TRUE;
         f0_60(li_48);
         Print("Authenticated");
      } else {
         gi_168 = FALSE;
         Print("NOT Authenticated");
         Comment("\n Authorization Failed.\n Please contact us at\n http://www.pimpmyea.com");
      }
   }
   if (gi_168 && TimeCurrent() >= gi_176 + gi_192) {
      gi_176 = TimeCurrent();
      ls_52 = f0_12(as_8, as_16, gs_196);
      if (f0_49(ls_52, "#", lsa_60, 2)) {
         ld_64 = StrToDouble(lsa_60[0]);
         ls_72 = lsa_60[1];
         if (gd_184 > 0.0 && ld_64 > gd_184) Alert(WindowExpertName(), ": ", ls_72);
      }
   }
   return (gi_168);
}

void f0_42() {
   gi_172 = 0;
}

int f0_29(string as_0) {
   f0_19(1.51);
   f0_42();
   if (f0_15(e_mail, "http://www.pimpmyea.com/auth/", as_0, 1) == 0) return (0);
   f0_6(as_0);
   gi_180 = TRUE;
   return (0);
}

int f0_6(string as_0) {
   gi_532 = f0_41(as_0);
   string ls_8 = gi_532;
   GlobalVariableDel(ls_8);
   GlobalVariableDel(ls_8 + "_" + Symbol() + "_ASK");
   GlobalVariableDel(ls_8 + "_" + Symbol() + "_BID");
   gs_500 = f0_14(ls_8, "_CLOSE");
   gs_508 = f0_14(ls_8, "_MAXDD");
   if (!GlobalVariableCheck(gs_500)) GlobalVariableSet(gs_500, 0);
   if (!GlobalVariableCheck(gs_508)) GlobalVariableSet(gs_508, 0);
   gi_388 = Digits;
   if (gi_388 == 3 || gi_388 == 5) {
      gd_392 = 10.0 * Point;
      gd_400 = 10;
   } else {
      gd_392 = Point;
      gd_400 = 1;
   }
   gs_540 = StringSubstr(Symbol(), 6, 0);
   if (as_0 == "ReticoloFX_Basket_USD") {
      ArrayResize(gsa_536, 7);
      gsa_536[0] = f0_14("AUDUSD", gs_540);
      gsa_536[1] = f0_14("USDCAD", gs_540);
      gsa_536[2] = f0_14("USDCHF", gs_540);
      gsa_536[3] = f0_14("EURUSD", gs_540);
      gsa_536[4] = f0_14("GBPUSD", gs_540);
      gsa_536[5] = f0_14("USDJPY", gs_540);
      gsa_536[6] = f0_14("NZDUSD", gs_540);
   }
   if (as_0 == "ReticoloFX_Basket_JPY") {
      ArrayResize(gsa_536, 7);
      gsa_536[0] = f0_14("AUDJPY", gs_540);
      gsa_536[1] = f0_14("CADJPY", gs_540);
      gsa_536[2] = f0_14("CHFJPY", gs_540);
      gsa_536[3] = f0_14("EURJPY", gs_540);
      gsa_536[4] = f0_14("GBPJPY", gs_540);
      gsa_536[5] = f0_14("USDJPY", gs_540);
      gsa_536[6] = f0_14("NZDJPY", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_AUD-NZD-USD") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("AUDUSD", gs_540);
      gsa_536[1] = f0_14("AUDNZD", gs_540);
      gsa_536[2] = f0_14("NZDUSD", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_CAD-EUR-USD") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("EURUSD", gs_540);
      gsa_536[1] = f0_14("EURCAD", gs_540);
      gsa_536[2] = f0_14("USDCAD", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_CHF-EUR-USD") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("EURCHF", gs_540);
      gsa_536[1] = f0_14("EURUSD", gs_540);
      gsa_536[2] = f0_14("USDCHF", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_CHF-GBP-JPY") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("CHFJPY", gs_540);
      gsa_536[1] = f0_14("GBPCHF", gs_540);
      gsa_536[2] = f0_14("GBPJPY", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_EUR-GBP-USD") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("EURGBP", gs_540);
      gsa_536[1] = f0_14("EURUSD", gs_540);
      gsa_536[2] = f0_14("GBPUSD", gs_540);
   }
   if (as_0 == "ReticoloFX_Ring_EUR-JPY-USD") {
      ArrayResize(gsa_536, 3);
      gsa_536[0] = f0_14("EURJPY", gs_540);
      gsa_536[1] = f0_14("EURUSD", gs_540);
      gsa_536[2] = f0_14("USDJPY", gs_540);
   }
   if (f0_46(as_0) == 0) return (0);
   if (show_next_trades) {
      gs_552 = f0_18(as_0, "_", Symbol(), "_NEXT_BUY");
      if (StringLen(gs_552) > 0) {
         ObjectCreate(gs_552, OBJ_HLINE, 0, 0, 0);
         ObjectSet(gs_552, OBJPROP_COLOR, Blue);
         ObjectSet(gs_552, OBJPROP_STYLE, STYLE_DASH);
      }
      gs_560 = f0_18(as_0, "_", Symbol(), "_NEXT_SELL");
      if (StringLen(gs_560) > 0) {
         ObjectCreate(gs_560, OBJ_HLINE, 0, 0, 0);
         ObjectSet(gs_560, OBJPROP_COLOR, Red);
         ObjectSet(gs_560, OBJPROP_STYLE, STYLE_DASH);
      }
   }
   if (gi_304 == FALSE) {
      gi_368 = gd_308;
      if (gi_368 <= 0) gi_368 = minimum_step;
   }
   gs_580 = as_0;
   f0_0(as_0);
   return (0);
}

int f0_48() {
   ObjectsDeleteAll();
   return (0);
}

int f0_46(string as_0) {
   bool li_8 = FALSE;
   for (int li_12 = 0; li_12 < ArraySize(gsa_536); li_12++) {
      if (gsa_536[li_12] == Symbol()) {
         li_8 = TRUE;
         break;
      }
   }
   if (li_8 == FALSE) {
      Comment("\nATTENTION PLEASE!" 
      + "\n " + as_0 + " is not made to work on " + Symbol());
      return (0);
   }
   if (gi_304 && Period() != gi_364) {
      Comment("\nATTENTION PLEASE!" 
      + "\n " + as_0 + " is made to run on 4H timeframe.");
      return (0);
   }
   if (gi_304 && Bars < gi_360) {
      Comment("\nATTENTION PLEASE!" 
      + "\n " + Symbol() + " has not enough historical data to run.");
      return (0);
   }
   return (1);
}

int f0_4(string as_0, string as_8) {
   if (f0_15(e_mail, "http://www.pimpmyea.com/auth/", as_0, 1) == 0) return (0);
   if (!gi_180) {
      f0_6(as_0);
      gi_180 = TRUE;
   }
   f0_53(as_0, as_8);
   return (0);
}

int f0_53(string as_0, string as_8) {
   int li_36;
   string ls_44;
   if (f0_46(as_0) == 0) return (0);
   int li_16 = GlobalVariableGet(gs_500);
   gi_480 = f0_57(Symbol(), OP_BUY, gi_532);
   gi_484 = f0_57(Symbol(), OP_SELL, gi_532);
   if (gi_304) {
      gi_368 = f0_21(f0_36(iATR(Symbol(), gi_364, gi_360, 0), gd_352), gd_392);
      if (gi_368 < minimum_step) gi_368 = minimum_step;
   }
   if (gi_480 == 0 && gi_484 == 0) {
      gi_548 = stop_after_close;
      if (gd_516 == 0.0 || gd_524 == 0.0 || gi_548) {
         f0_5(f0_33(Ask, f0_36(gi_368, gd_392)));
         f0_16(f0_61(Bid, f0_36(gi_368, gd_392)));
      }
      if (li_16 == 0 && gi_492) {
         if (gi_548 == FALSE && on_hold == FALSE) {
            if (f0_17())
               if (f0_51(Symbol(), 0, lot_size, Ask, gd_380, 0, 0, f0_38(as_8, gi_480), gi_532, 0, 32768) > 0) gi_492 = FALSE;
         }
      }
      if (li_16 == 0 && gi_496) {
         if (gi_548 == FALSE && on_hold == FALSE) {
            if (f0_17())
               if (f0_51(Symbol(), 1, lot_size, Bid, gd_380, 0, 0, f0_38(as_8, gi_484), gi_532, 0, 255) > 0) gi_496 = FALSE;
         }
      }
   }
   if (gi_480 > 0 && gi_484 == 0) {
      gd_432 = f0_3(gi_532);
      f0_5(f0_33(gd_432, f0_36(gi_368, gd_392)));
      gd_448 = f0_58(gi_532);
      f0_16(f0_40(gd_448, -(Ask - Bid), -f0_22(2, gi_368, gd_392)));
   }
   if (gi_480 == 0 && gi_484 > 0) {
      gd_440 = f0_43(gi_532);
      f0_16(f0_61(gd_440, f0_36(gi_368, gd_392)));
      gd_456 = f0_1(gi_532);
      f0_5(f0_40(gd_456, Ask - Bid, f0_22(2, gi_368, gd_392)));
   }
   if (gi_480 > 0 && gi_484 > 0) {
      gd_432 = f0_3(gi_532);
      f0_5(f0_33(gd_432, f0_36(gi_368, gd_392)));
      gd_440 = f0_43(gi_532);
      f0_16(f0_61(gd_440, f0_36(gi_368, gd_392)));
   }
   if (li_16 == 0 && Ask >= gd_516) {
      if (gi_548 == FALSE && on_hold == FALSE)
         if (f0_17()) f0_51(Symbol(), 0, lot_size, Ask, gd_380, 0, 0, f0_38(as_8, gi_480), gi_532, 0, 32768);
   }
   if (li_16 == 0 && Bid <= gd_524) {
      if (gi_548 == FALSE && on_hold == FALSE)
         if (f0_17()) f0_51(Symbol(), 1, lot_size, Bid, gd_380, 0, 0, f0_38(as_8, gi_484), gi_532, 0, 255);
   }
   int li_20 = f0_37(OP_BUY, gi_532) + f0_37(OP_SELL, gi_532);
   if (li_20 == 0) GlobalVariableSet(gs_500, 0);
   double ld_24 = f0_35(gi_532);
   int li_32 = GlobalVariableGet(gs_500);
   if (li_32 == 0) gi_488 = f0_25(Symbol(), gi_532);
   if (ld_24 >= target_profit || li_32 > 0) {
      li_36 = 0;
      if (closeby_enabled) li_36 = f0_7(Symbol(), gi_532);
      else {
         li_36 = f0_54(Symbol(), 0, gi_532);
         li_36 += f0_54(Symbol(), 1, gi_532);
      }
      if (li_32 == 0) GlobalVariableSet(gs_500, 1);
      if (play_sound) PlaySound("alert.wav");
      if (show_alert && li_36 > 0) f0_59(as_0 + ": " + li_36 + " orders closed on " + Symbol() + "!");
      if (li_32 == 2) stop_after_close = TRUE;
      if (stop_after_close) gi_548 = TRUE;
      f0_5(0);
      f0_16(0);
      gi_492 = FALSE;
      gi_496 = FALSE;
      if (trend_following) {
         if (gi_488 == 0) gi_492 = TRUE;
         if (gi_488 == 1) gi_496 = TRUE;
      }
      for (int li_40 = 0; li_40 < 100; li_40++) {
         ls_44 = as_0 + f0_18("_", Symbol(), "_TRADE_", li_40);
         ObjectDelete(ls_44);
      }
   }
   gd_424 = GlobalVariableGet(gs_508);
   if (ld_24 < gd_424) {
      gd_424 = ld_24;
      GlobalVariableSet(gs_508, gd_424);
      f0_50("Max Floating DD: $", DoubleToStr(gd_424, 2));
   }
   f0_0(as_0);
   return (0);
}

void f0_0(string as_0) {
   string ls_16;
   double ld_8 = f0_35(gi_532);
   for (int li_32 = 0; li_32 < Seconds() % 40; li_32++) ls_16 = ls_16 + "|";
   string ls_24 = "RUNNING";
   if (stop_after_close) ls_24 = "RUNNING (stop after close)";
   if (on_hold) ls_24 = "RUNNING (on hold)";
   if (gi_548) ls_24 = "STOPPED";
   if (MarketInfo(Symbol(), MODE_TRADEALLOWED) == 0.0) ls_24 = "TRADE_NOT_ALLOWED";
   double ld_36 = f0_52(Symbol(), gi_532);
   Comment("\n " + gs_580 + " " + "v1.5b" 
      + "\n by PimpMyEA.com", 
      "\n ======================", 
      "\n ", ls_16, 
      "\n ----------------------------------------------------", 
      "\n Status: ", ls_24, 
      "\n ----------------------------------------------------", 
      "\n " + Symbol() + " Spread: ", DoubleToStr((Ask - Bid) / gd_392, 2), 
      "\n " + Symbol() + " Step: ", DoubleToStr(gi_368, 2), 
      "\n " + Symbol() + " Next BUY @ ", DoubleToStr(gd_516, Digits), 
      "\n " + Symbol() + " Next Sell @ ", DoubleToStr(gd_524, Digits), 
      "\n ----------------------------------------------------", 
      "\n " + Symbol() + " Orders: BUY ", f0_57(Symbol(), OP_BUY, gi_532), "  \\  SELL ", f0_57(Symbol(), OP_SELL, gi_532), 
      "\n " + Symbol() + " Orders Value: $", DoubleToStr(ld_36, 2), 
      "\n " + Symbol() + " Closed Profit: $", DoubleToStr(f0_47(Symbol(), gi_532), 2), 
      "\n ----------------------------------------------------", 
      "\n TOTAL Orders: BUY ", f0_37(OP_BUY, gi_532), "  \\  SELL ", f0_37(OP_SELL, gi_532), 
      "\n TOTAL Orders Value: $", DoubleToStr(ld_8, 2), 
      "\n TOTAL Closed Profit: $", DoubleToStr(f0_24(gi_532), 2), 
      "\n TOTAL Max Floating DD: $", DoubleToStr(gd_424, 2), 
      "\n ----------------------------------------------------", 
      "\n Magic Number: ", gi_532, 
   "\n ----------------------------------------------------");
   gi_576 = SteelBlue;
   if (ld_36 > 0.0) gi_576 = SteelBlue;
   if (ld_36 < 0.0) gi_576 = SteelBlue;
   int li_44 = 12;
   if (gi_588 || Seconds() % 5 == 0) {
      gi_588 = FALSE;
      for (int li_48 = 0; li_48 < 8; li_48++) {
         for (int li_52 = 0; li_52 < li_44; li_52++) {
            ObjectDelete("background" + li_48 + li_52);
            ObjectDelete("background" + li_48 + ((li_52 + 1)));
            ObjectDelete("background" + li_48 + ((li_52 + 2)));
            ObjectCreate("background" + li_48 + li_52, OBJ_LABEL, 0, 0, 0);
            ObjectSetText("background" + li_48 + li_52, "n", 30, "Wingdings", gi_576);
            ObjectSet("background" + li_48 + li_52, OBJPROP_XDISTANCE, 20 * li_48);
            ObjectSet("background" + li_48 + li_52, OBJPROP_YDISTANCE, 23 * li_52 + 11);
         }
      }
      f0_5(gd_516);
      f0_16(gd_524);
      if (show_open_trades) f0_13(as_0, Symbol(), gi_532);
   }
}

void f0_5(double ad_0) {
   if (f0_17()) {
      gd_516 = ad_0;
      if (show_next_trades) ObjectSet(gs_552, OBJPROP_PRICE1, ad_0);
   }
}

void f0_16(double ad_0) {
   if (f0_17()) {
      gd_524 = ad_0;
      if (show_next_trades) ObjectSet(gs_560, OBJPROP_PRICE1, ad_0);
   }
}

string f0_38(string as_0, int ai_8) {
   if (StringLen(as_0) > 0) return (as_0 + "_" + ((ai_8 + 1)));
   return ("");
}

int f0_44(int &aia_0[], string as_4, int ai_12, int ai_16) {
   ArrayResize(aia_0, 100);
   int li_20 = 0;
   int li_24 = OrdersTotal();
   if (li_24 > 0) {
      for (int li_28 = 0; li_28 < li_24; li_28++) {
         OrderSelect(li_28, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_4 && OrderType() == ai_12 && OrderMagicNumber() == ai_16) {
            aia_0[li_20] = OrderTicket();
            li_20++;
         }
      }
   }
   ArrayResize(aia_0, li_20);
   return (li_20);
}

int f0_57(string as_0, int ai_8, int ai_12) {
   int li_16 = 0;
   int li_20 = OrdersTotal();
   if (li_20 > 0) {
      for (int li_24 = 0; li_24 < li_20; li_24++) {
         OrderSelect(li_24, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_0 && OrderType() == ai_8 && OrderMagicNumber() == ai_12) li_16++;
      }
   }
   return (li_16);
}

int f0_13(string as_0, string as_8, int ai_16) {
   string ls_32;
   bool li_20 = FALSE;
   int li_24 = OrdersTotal();
   if (li_24 > 0) {
      for (int li_28 = 0; li_28 < li_24; li_28++) {
         OrderSelect(li_28, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_8 && OrderMagicNumber() == ai_16) {
            ls_32 = as_0 + f0_18("_", Symbol(), "_TRADE_", li_28);
            if (ObjectFind(ls_32) == -1) {
               ObjectCreate(ls_32, OBJ_HLINE, 0, 0, 0);
               ObjectSet(ls_32, OBJPROP_COLOR, Yellow);
               ObjectSet(ls_32, OBJPROP_STYLE, STYLE_DASHDOT);
            }
            ObjectSet(ls_32, OBJPROP_PRICE1, OrderOpenPrice());
         }
      }
   }
   return (li_20);
}

int f0_37(int ai_0, int ai_4) {
   int li_8 = 0;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderType() == ai_0 && OrderMagicNumber() == ai_4) li_8++;
      }
   }
   return (li_8);
}

int f0_25(string as_0, int ai_8) {
   int li_12 = -1;
   int li_16 = OrdersTotal();
   if (li_16 > 0) {
      for (int li_20 = 0; li_20 < li_16; li_20++) {
         OrderSelect(li_20, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_0 && OrderMagicNumber() == ai_8) li_12 = OrderType();
      }
   }
   return (li_12);
}

double f0_35(int ai_0) {
   double ld_4 = 0;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderMagicNumber() == ai_0) ld_4 = f0_30(ld_4, OrderProfit(), OrderSwap(), OrderCommission());
      }
   }
   return (ld_4);
}

double f0_52(string as_0, int ai_8) {
   double ld_12 = 0;
   int li_20 = OrdersTotal();
   if (li_20 > 0) {
      for (int li_24 = 0; li_24 < li_20; li_24++) {
         OrderSelect(li_24, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_0 && OrderMagicNumber() == ai_8) ld_12 = f0_30(ld_12, OrderProfit(), OrderSwap(), OrderCommission());
      }
      return (ld_12);
   }
   return (0.0);
}

int f0_55(int aia_0[], int aia_4[]) {
   int li_8 = 0;
   int li_12 = ArraySize(aia_0);
   int li_16 = ArraySize(aia_4);
   for (int li_20 = 0; li_20 < MathMax(li_12, li_16); li_20++) {
      if (li_20 < li_12 && li_20 < li_16) {
         if (f0_17())
            if (f0_39(aia_0[li_20], aia_4[li_20], Yellow)) li_8 += 2;
      } else {
         if (li_20 < li_12) {
            OrderSelect(aia_0[li_20], SELECT_BY_TICKET, MODE_TRADES);
            if (f0_17())
               if (f0_32(OrderTicket(), OrderLots(), Bid, gd_380, Blue)) li_8++;
         }
         if (li_20 < li_16) {
            OrderSelect(aia_4[li_20], SELECT_BY_TICKET, MODE_TRADES);
            if (f0_17())
               if (f0_32(OrderTicket(), OrderLots(), Ask, gd_380, Red)) li_8++;
         }
      }
   }
   return (li_8);
}

int f0_28(string as_0, int ai_8, int ai_12) {
   int li_16 = 0;
   if (OrdersTotal() > 0) {
      for (int li_20 = OrdersTotal(); li_20 >= 0; li_20--) {
         OrderSelect(li_20, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == as_0 && OrderType() == ai_8 && OrderMagicNumber() == ai_12) {
            if (OrderType() == OP_BUY) {
               if (f0_17())
                  if (f0_32(OrderTicket(), OrderLots(), Bid, gd_380, Blue)) li_16++;
            }
            if (OrderType() == OP_SELL) {
               if (f0_17())
                  if (f0_32(OrderTicket(), OrderLots(), Ask, gd_380, Red)) li_16++;
            }
         }
      }
   }
   return (li_16);
}

int f0_54(string as_0, int ai_8, int ai_12) {
   for (int li_16 = FALSE; f0_57(Symbol(), ai_8, ai_12) > 0; li_16 = f0_33(li_16, f0_28(Symbol(), ai_8, ai_12))) RefreshRates();
   return (li_16);
}

int f0_7(string as_0, int ai_8) {
   for (int li_12 = FALSE; f0_44(gia_568, Symbol(), OP_BUY, ai_8) + f0_44(gia_572, Symbol(), OP_SELL, ai_8) > 0; li_12 = f0_33(li_12, f0_55(gia_568, gia_572))) RefreshRates();
   return (li_12);
}

double f0_24(int ai_0) {
   double ld_4 = 0;
   int li_12 = OrdersHistoryTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_HISTORY);
         if (OrderMagicNumber() == ai_0) ld_4 = f0_30(ld_4, OrderProfit(), OrderSwap(), OrderCommission());
      }
      return (ld_4);
   }
   return (0.0);
}

double f0_47(string as_0, int ai_8) {
   double ld_12 = 0;
   int li_20 = OrdersHistoryTotal();
   if (li_20 > 0) {
      for (int li_24 = 0; li_24 < li_20; li_24++) {
         OrderSelect(li_24, SELECT_BY_POS, MODE_HISTORY);
         if (OrderSymbol() == as_0 && OrderMagicNumber() == ai_8) ld_12 = f0_30(ld_12, OrderProfit(), OrderSwap(), OrderCommission());
      }
      return (ld_12);
   }
   return (0.0);
}

double f0_3(int ai_0) {
   double ld_4 = 0;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderType() == OP_BUY || OrderType() == OP_BUYSTOP && OrderMagicNumber() == ai_0)
            if (OrderOpenPrice() > ld_4) ld_4 = OrderOpenPrice();
      }
      return (ld_4);
   }
   return (0.0);
}

double f0_43(int ai_0) {
   double ld_4 = 999999999;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderType() == OP_SELL || OrderType() == OP_SELLSTOP && OrderMagicNumber() == ai_0)
            if (OrderOpenPrice() < ld_4) ld_4 = OrderOpenPrice();
      }
      return (ld_4);
   }
   return (0.0);
}

double f0_58(int ai_0) {
   double ld_4 = 999999999;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderType() == OP_BUY || OrderType() == OP_BUYSTOP && OrderMagicNumber() == ai_0)
            if (OrderOpenPrice() < ld_4) ld_4 = OrderOpenPrice();
      }
      return (ld_4);
   }
   return (0.0);
}

double f0_1(int ai_0) {
   double ld_4 = 0;
   int li_12 = OrdersTotal();
   if (li_12 > 0) {
      for (int li_16 = 0; li_16 < li_12; li_16++) {
         OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderType() == OP_SELL || OrderType() == OP_SELLSTOP && OrderMagicNumber() == ai_0)
            if (OrderOpenPrice() > ld_4) ld_4 = OrderOpenPrice();
      }
      return (ld_4);
   }
   return (0.0);
}

int init() {
   f0_29("ReticoloFX_Ring_CAD-EUR-USD");
   return (0);
}

int deinit() {
   f0_48();
   return (0);
}

int start() {
   f0_4("ReticoloFX_Ring_CAD-EUR-USD", comment);
   return (0);
}

Recommend