10评论

0收藏

不明白源码的意思,哪位大神能解释一下吗

avatar zhqqyqr | 6520 人阅读 | 10 人评论 | 2015-09-03

//+------------------------------------------------------------------+
//|                                                   Martingale.mq4 |
//|                                                           よ?Щ |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "よ?Щ"
#property link      "http://www.metaquotes.net"
#import "wininet.dll"
   int InternetAttemptConnect(int a0);
   int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
   int InternetConnectA(int a0, string a1, int a2, string a3, string a4, int a5, int a6, int a7);
   bool InternetCloseHandle(int a0);
   bool FtpGetFileA(int a0, string a1, string a2, bool a3, int a4, int a5, int a6);
#import
int gia_76[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_80[256] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
string gs_unused_84 = "";
int gi_92 = 8;
extern string T0 = "-------------焚ó╰参------------";
extern bool BrakeSystem = TRUE;
int gi_108 = 14;
extern string T1 = "K?盎代";
extern int Energy = 40;
extern string T2 = "焚ó?丁";
extern int SleepTime = 15;
int gi_136 = 0;
int gi_140 = 0;
string T3 = "-------------箇牡筽笷北?家舱--------------";
bool NewsSW = FALSE;
int Min_before = 30;
int Min_after = 30;
string T4 = "筽笷箇牡玡碭だ牧赣驹初瞒初秨闽";
bool NewsOut = FALSE;
int NewsOutTime = 10;
string T5 = "-------------玂靡?ゑㄒ北?家舱--------------";
bool MarginSleep = FALSE;
double MarginLimit = 1000.0;
string T6 = "-------------疊莲北?家舱(??肂璸衡)-------------";
bool FloatEq = FALSE;
double FloatAm = -6000.0;
extern string T7 = "秨﹍?丁??Α?hh";
extern int start_t = 7;
extern string T8 = "挡??丁??Α?hh";
extern int stop_t = 7;
extern string T9 = "砞﹚?秅?笲??丁";
extern string T10 = "秅?秅?龄?12???摸崩";
extern string weekday = "1234";
extern bool Week15SW = TRUE;
extern string W1 = "搂??碭翴秨﹍";
extern int W1Start = 7;
extern string W2 = "程??ぱ碭翴挡?";
extern int W5Over = 17;
extern string T11 = "ゎ穕ゎ?セ?璸衡膀非";
extern double I_balance = 0;
extern string T12 = "ゎ穕?讽らぃ???";
extern bool SleepLoss = TRUE;
extern string T13 = "程?羆疊莲氨穕(%)";
extern double SLpercent = 100.0;
extern string T14 = "Ωゎ??–Ω程?莉?%?笷Θミ?キ?耴箂?币";
extern double takepercent = 1.;
extern string T15 = "らゎ??–ら程?莉?%?笷Θミ?キ?耴箂?币";
extern double takepercent_day = 100.0;
extern string T16 = "–Ы挡?碭だ牧??穝币笆";
extern double NextTime = 2.0;
extern string T9_ = "-------------?墓家舱-------------";
extern string T17 = "–Ы程??丁(だ牧)";
extern int MaxTime = 150;
extern string T18 = "–Ы程???";
extern int MaxIn = 15;
extern string T19 = "笷Θ??兵ン?墓";
extern double MaxP = 0.3;
extern string T20 = "--------------------------------------";
extern string T21 = "も计";
extern double Lots = 0.01;
extern string T22 = "皑??瞯";
extern double LotExponent = 1.618;
extern string T23 = "----------------?よ?旧?-----------------";
extern bool BSB = TRUE;
int gi_500 = 2;
double gd_unused_504 = 5.0;
bool gi_512 = FALSE;
extern string T24 = "莉?翴计";
extern double TakeProfit = 100.0;
bool gi_532 = FALSE;
double gd_536 = 20.0;
string gs_unused_544 = "Time Setting";
bool gi_552 = FALSE;
int gi_556 = 17;
bool gi_560 = FALSE;
int gi_564 = 0;
string gs_unused_568 = "";
string gs_unused_356 = "–Ωゎ?秨闽";
bool gi_364 = TRUE;
extern string T25 = "A家舱程?虫计";
extern int MaxTrades_A = 10;
bool gi_588 = FALSE;
double gd_592 = 48.0;
bool gi_600 = FALSE;
double g_pips_604 = 500.0;
double gd_612 = 10.0;
double gd_620 = 5.0;
extern string TTTT1 = "A家舱丁禯";
extern double g_pips_628 = 200.0;

double g_slippage_636 = 3.0;
int g_magic_644 = 9220933;
double g_price_648;
double gd_656;
double gd_unused_664;
double gd_unused_672;
double g_price_680;
double g_bid_688;
double g_ask_696;
double gd_704;
double gd_712;
double gd_720;
bool gi_728;
string gs_732 = "";
int gi_740 = 0;
int gi_744;
int gi_748 = 0;
double gd_752;
int g_pos_760 = 0;
int gi_764;
double gd_768 = 0.0;
bool gi_776 = FALSE;
bool gi_780 = FALSE;
bool gi_784 = FALSE;
int gi_788;
bool gi_792 = FALSE;
double gd_796;
double gd_804;
string gs_unused_812 = "";
extern string T26 = "B家舱程?虫计";
extern int MaxTrades_B = 10;
int g_timeframe_832 = PERIOD_H1;
bool gi_836 = FALSE;
double g_pips_840 = 500.0;
double gd_848 = 10.0;
double gd_856 = 5.0;
bool gi_864 = FALSE;
double gd_868 = 48.0;
extern string TTTT2 = "B家舱丁禯";
extern double g_pips_876 = 200.0;
double g_slippage_884 = 3.0;
int g_magic_892 = 9812324;
double g_price_896;
double gd_904;
double gd_unused_912;
double gd_unused_920;
double g_price_928;
double g_bid_936;
double g_ask_944;
double gd_952;
double gd_960;
double gd_968;
bool gi_976;
string gs_980 = "";
int gi_988 = 0;
int gi_992;
int gi_996 = 0;
double gd_1000;
int g_pos_1008 = 0;
int gi_1012;
double gd_1016 = 0.0;
bool gi_1024 = FALSE;
bool gi_1028 = FALSE;
bool gi_1032 = FALSE;
int gi_1036;
bool gi_1040 = FALSE;
double gd_1044;
double gd_1052;
int g_datetime_1060 = 1;
string gs_unused_1064 = "";
extern string T27 = "C家舱程?虫计";
extern int MaxTrades_C = 10;
int g_timeframe_1084 = PERIOD_M1;
bool gi_1088 = FALSE;
double g_pips_1092 = 500.0;
double gd_1100 = 10.0;
double gd_1108 = 5.0;
bool gi_1116 = FALSE;
double gd_1120 = 48.0;
extern string TTTTT3 = "C家舱丁禯";
extern double g_pips_1128 = 200.0;
double g_slippage_1136 = 3.0;
int g_magic_1144 = 1967943;
double g_price_1148;
double gd_1156;
double gd_unused_1164;
double gd_unused_1172;
double g_price_1180;
double g_bid_1188;
double g_ask_1196;
double gd_1204;
double gd_1212;
double gd_1220;
bool gi_1228;
string gs_1232 = "";
int gi_1240 = 0;
int gi_1244;
int gi_1248 = 0;
double gd_1252;
int g_pos_1260 = 0;
int gi_1264;
double gd_1268 = 0.0;
bool gi_1276 = FALSE;
bool gi_1280 = FALSE;
bool gi_1284 = FALSE;
int gi_1288;
bool gi_1292 = FALSE;
double gd_1296;
double gd_1304;
int g_datetime_1312 = 1;
int gi_unused_1316 = 1;
int gi_unused_1320 = 5;
int gi_unused_1324 = 15;
int gi_unused_1328 = 30;
int gi_unused_1332 = 60;
int gi_unused_1336 = 240;
int gi_unused_1340 = 1440;
bool gi_unused_1344 = TRUE;
int gi_unused_1348 = 0;
int gi_unused_1352 = 10;
int gi_unused_1356 = 0;
bool gi_unused_1360 = TRUE;
bool gi_unused_1364 = TRUE;
bool gi_unused_1368 = FALSE;
int gi_unused_1372 = 8421504;
int gi_unused_1376 = 8421504;
int gi_unused_1380 = 8421504;
int gi_unused_1384 = 36095;
int gi_unused_1388 = 36095;
int gi_1392 = 65280;
int gi_1396 = 17919;
int gi_1400 = 65280;
int gi_1404 = 17919;
int gi_unused_1408 = 65280;
int gi_unused_1412 = 255;
int gi_unused_1416 = 42495;
int gi_unused_1420 = 8;
int gi_unused_1424 = 17;
int gi_unused_1428 = 9;
int gi_unused_1432 = 0;
int gi_unused_1436 = 65280;
int gi_unused_1440 = 4678655;
int gi_unused_1444 = 32768;
int gi_unused_1448 = 255;
string gs_unused_1452 = "<<<< STR Indicator Settings >>>>>>>>>>>>>";
string gs_unused_1460 = "<<<< RSI Settings >>>>>>>>>>>>>";
int gi_unused_1468 = 9;
int gi_unused_1472 = 0;
string gs_unused_1476 = "<<<< CCI Settings >>>>>>>>>>>>>>";
int gi_unused_1484 = 13;
int gi_unused_1488 = 0;
string gs_unused_1492 = "<<<< STOCH Settings >>>>>>>>>>>";
int gi_unused_1500 = 5;
int gi_unused_1504 = 3;
int gi_unused_1508 = 3;
int gi_unused_1512 = 1;
string gs_unused_1516 = "<<<< STR Colors >>>>>>>>>>>>>>>>";
int gi_unused_1524 = 65280;
int gi_unused_1528 = 255;
int gi_unused_1532 = 42495;
string gs_unused_1536 = "<<<< MA Settings >>>>>>>>>>>>>>";
int gi_unused_1544 = 5;
int gi_unused_1548 = 9;
int gi_unused_1552 = 1;
int gi_unused_1556 = 0;
string gs_unused_1560 = "<<<< MA Colors >>>>>>>>>>>>>>";
int gi_unused_1568 = 65280;
int gi_unused_1572 = 255;
string gs_dummy_1576;
string g_text_1584;
string g_text_1592;
bool gi_unused_1600 = TRUE;
string gs_unused_1604 = "";
int gi_1628;
string gsa_1632[300][7];
double gd_1636;
double gd_1644;
int gi_1652;
int gi_1656;
int g_bars_1664;
int g_y_1668 = 50;
int gi_1672 = 0;
int gi_1676;
int gi_1680;
bool gi_1684 = FALSE;
double gd_1688 = -1.0;
int g_datetime_1696 = 0;
int gi_1708 = 0;
string gs_1712 = "0";
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   string ls_unused_12;
   string ls_unused_20;
   string text_28;
   string text_36;
   string ls_unused_44;
   string ls_unused_52;
   string ls_unused_60;
   string ls_unused_68;
   string ls_unused_76;
   string ls_unused_84;
   if (IsTesting() == TRUE) return (0);
   GlobalVariableSet("Martingale" + Symbol(), WindowHandle(Symbol(), Period()));
   ObjectCreate("Expert", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Expert", OBJPROP_CORNER, 1);
   ObjectSet("Expert", OBJPROP_COLOR, White);
   ObjectSet("Expert", OBJPROP_XDISTANCE, 150);
   ObjectSet("Expert", OBJPROP_YDISTANCE, 0);
   ObjectSetText("Expert", "Martingale", 15, "稬硁タ堵砰", White);
   gi_1628 = Energy;
   g_bars_1664 = Bars;
   if (Digits == 5 || Digits == 3) gd_1644 = 10.0 * Point;
   else gd_1644 = Point;
   double ld_0 = Bid + gi_140 * gd_1644;
   ObjectCreate("Light", OBJ_ARROW, 0, 0, 0);
   ObjectSet("Light", OBJPROP_ARROWCODE, 108);
   ObjectSet("Light", OBJPROP_CORNER, 1);
   ObjectSet("Light", OBJPROP_COLOR, Lime);
   ObjectSet("Light", OBJPROP_TIME1, TimeCurrent() + 300);
   ObjectSet("Light", OBJPROP_PRICE1, ld_0);
   ObjectSet("Light", OBJPROP_WIDTH, 5);
   ObjectCreate("Light2", OBJ_ARROW, 0, 0, 0);
   ObjectSet("Light2", OBJPROP_ARROWCODE, 161);
   ObjectSet("Light2", OBJPROP_CORNER, 1);
   ObjectSet("Light2", OBJPROP_COLOR, LawnGreen);
   ObjectSet("Light2", OBJPROP_TIME1, TimeCurrent() + 300);
   ObjectSet("Light2", OBJPROP_PRICE1, ld_0);
   ObjectSet("Light2", OBJPROP_WIDTH, 5);
   ObjectCreate("lightstatus", OBJ_LABEL, 0, 0, 0);
   ObjectSet("lightstatus", OBJPROP_CORNER, 1);
   ObjectSet("lightstatus", OBJPROP_COLOR, Gold);
   ObjectSet("lightstatus", OBJPROP_XDISTANCE, 20);
   ObjectSet("lightstatus", OBJPROP_YDISTANCE, g_y_1668 + 135);
   GlobalVariableSet("next_sw", 0);
   if (!GlobalVariableCheck("start_balance")) GlobalVariableSet("start_balance", AccountBalance());
   if (I_balance == 0.0) gd_1636 = GlobalVariableGet("start_balance");
   else gd_1636 = I_balance;
   if (!GlobalVariableCheck("start_p")) GlobalVariableSet("start_p", TimeCurrent());
   gi_1652 = GlobalVariableGet("start_p");
   MathSrand(TimeLocal());
   for (int li_8 = 1; li_8 < 10; li_8++) gi_1676 = 59 * MathRand() / 32768 + 1;
   GlobalVariableSet("RUN", 0);
   GlobalVariableSet("UPSW", 0);
   GlobalVariableSet("WSW", 0);
   GlobalVariableSet("RUNEA", 0);
   GlobalVariableSet("DNSW", 0);
   if (GlobalVariableCheck("MaxEquity") == FALSE) GlobalVariableSet("MaxEquity", 100.0 * (AccountProfit() / gd_1636));
   ObjectCreate("Newsinfo", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Newsinfo", OBJPROP_CORNER, 1);
   ObjectSet("Newsinfo", OBJPROP_COLOR, White);
   ObjectSet("Newsinfo", OBJPROP_XDISTANCE, 20);
   ObjectSet("Newsinfo", OBJPROP_YDISTANCE, g_y_1668 + 95);
   ObjectCreate("Newsinfo2", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Newsinfo2", OBJPROP_CORNER, 1);
   ObjectSet("Newsinfo2", OBJPROP_COLOR, White);
   ObjectSet("Newsinfo2", OBJPROP_XDISTANCE, 20);
   ObjectSet("Newsinfo2", OBJPROP_YDISTANCE, g_y_1668 + 115);
   gi_1680 = f0_3(gsa_1632);
   if (StrToTime(f0_33(gsa_1632[0][2], gsa_1632[0][3])) + 3600 * gi_92 <= TimeLocal()) {
      if (TimeLocal() >= StrToTime(f0_33(gsa_1632[gi_1680 - 1][2], gsa_1632[gi_1680 - 1][3])) + 3600 * gi_92) {      
         text_36 = "タ?钡Μ戈癟,币笆い.....";
         text_28 = "";
         ObjectSetText("Newsinfo", text_36, 10, "稬硁タ堵砰", Gold);
         ObjectSetText("Newsinfo2", text_28, 10, "稬硁タ堵砰", Gold);
         gi_1684 = TRUE;
      } else {
         text_36 = "";
         ObjectSetText("Newsinfo", text_36, 10, "稬硁タ堵砰", Gold);
         ObjectSetText("Newsinfo2", " ", 10, "稬硁タ堵砰", Gold);
      }
   }
   if (!NewsSW) {
      ObjectDelete("Newsinfo");
      ObjectDelete("Newsinfo2");
   }
   gd_720 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
   gd_968 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
   gd_1220 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
   ObjectCreate("Lable1", OBJ_LABEL, 0, 0, 1.0);
   ObjectSet("Lable1", OBJPROP_CORNER, 2);
   ObjectSet("Lable1", OBJPROP_XDISTANCE, 23);
   ObjectSet("Lable1", OBJPROP_YDISTANCE, 21);
   g_text_1592 = "";
   ObjectSetText("Lable1", g_text_1592, 12, "Arial", DeepSkyBlue);
   ObjectCreate("Lable", OBJ_LABEL, 0, 0, 1.0);
   ObjectSet("Lable", OBJPROP_CORNER, 2);
   ObjectSet("Lable", OBJPROP_XDISTANCE, 3);
   ObjectSet("Lable", OBJPROP_YDISTANCE, 1);
   g_text_1584 = "";
   ObjectSetText("Lable", g_text_1584, 10, "Arial", DeepSkyBlue);
   return (0);
}
// 52D46093050F38C27267BCE42543EF60
int deinit() {
   ObjectDelete("cja");
   ObjectDelete("Signalprice");
   ObjectDelete("SIG_BARS_TF1");
   ObjectDelete("SIG_BARS_TF2");
   ObjectDelete("SIG_BARS_TF3");
   ObjectDelete("SIG_BARS_TF4");
   ObjectDelete("SIG_BARS_TF5");
   ObjectDelete("SIG_BARS_TF6");
   ObjectDelete("SIG_BARS_TF7");
   ObjectDelete("SSignalMACD_TEXT");
   ObjectDelete("SSignalMACDM1");
   ObjectDelete("SSignalMACDM5");
   ObjectDelete("SSignalMACDM15");
   ObjectDelete("SSignalMACDM30");
   ObjectDelete("SSignalMACDH1");
   ObjectDelete("SSignalMACDH4");
   ObjectDelete("SSignalMACDD1");
   ObjectDelete("SSignalSTR_TEXT");
   ObjectDelete("SignalSTRM1");
   ObjectDelete("SignalSTRM5");
   ObjectDelete("SignalSTRM15");
   ObjectDelete("SignalSTRM30");
   ObjectDelete("SignalSTRH1");
   ObjectDelete("SignalSTRH4");
   ObjectDelete("SignalSTRD1");
   ObjectDelete("SignalEMA_TEXT");
   ObjectDelete("SignalEMAM1");
   ObjectDelete("SignalEMAM5");
   ObjectDelete("SignalEMAM15");
   ObjectDelete("SignalEMAM30");
   ObjectDelete("SignalEMAH1");
   ObjectDelete("SignalEMAH4");
   ObjectDelete("SignalEMAD1");
   ObjectDelete("SIG_DETAIL1");
   ObjectDelete("SIG_DETAIL2");
   ObjectDelete("SIG_DETAIL3");
   ObjectDelete("SIG_DETAIL4");
   ObjectDelete("SIG_DETAIL5");
   ObjectDelete("SIG_DETAIL6");
   ObjectDelete("SIG_DETAIL7");
   ObjectDelete("SIG_DETAIL8");
   ObjectDelete("Lable");
   ObjectDelete("Lable1");
   ObjectDelete("percent");
   ObjectDelete("start_p");
   ObjectDelete("takepercent_day");
   ObjectDelete("run");
   ObjectDelete("Newsinfo");
   ObjectDelete("Newsinfo2");
   ObjectDelete("ERR");
   ObjectDelete("ERR2");
   ObjectDelete("Expert");
   ObjectDelete("Light");
   ObjectDelete("Light2");
   ObjectDelete("lightstatus");
   ObjectDelete("Margin");
   ObjectDelete("Float");
   return (0);
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   string text_8;
   string text_16;
   string text_24;
   string text_32;
   int file_40;
   int str2time_52;
   int li_68;
   string text_72;
   string text_80;
   color color_88;
   int li_92;
   int li_96;
   int datetime_100;
   double ld_104;
   bool li_112;
   double ld_116;
   double ld_124;
   string ls_unused_188;
   string ls_unused_228;
   int li_unused_236;
   int li_unused_240;
   double ihigh_244;
   double ilow_252;
   double iclose_260;
   double iclose_268;
   double ld_276;
   double ld_284;
   double ld_292;
   int li_300;
   int count_304;
   double ld_308;
   double ld_316;
   int li_324;
   int count_328;
   ObjectDelete("ERR");
   
   if (IsTesting() == TRUE)
   {
      return (0);
   }
   
   GlobalVariableSet("Martingale" + Symbol() + "TF", Period());
   double ld_0 = Bid + gi_140 * gd_1644;
   if (GlobalVariableSetOnCondition("DNSW", 1, 0)) {
      file_40 = FileOpen("ffcal_week_this.XMl", FILE_CSV|FILE_READ);
      if (file_40 < 0 || gi_1684 == TRUE) {
         FileClose(file_40);
         f0_51("ffcal_week_this.xml");
         text_24 = "戈癟礚猭莉??叫祔??穝币笆";
         ObjectSetText("Newsinfo2", text_24, 10, "稬硁タ堵砰", Gold);
      } else FileClose(file_40);
      Sleep(10000);
   }
   if (GlobalVariableGet("RUNEA") == 1.0) {
      Alert("EA is not working");
      return;
   }
   if (100.0 * (AccountProfit() / gd_1636) < GlobalVariableGet("MaxEquity")) GlobalVariableSet("MaxEquity", 100.0 * (AccountProfit() / gd_1636));
   f0_42(gi_1652, gi_364, gd_1636);
   if (OrdersTotal() == 0) {
      GlobalVariableSet("start_balance", AccountBalance());
      GlobalVariableSet("start_p", TimeCurrent());
      GlobalVariableSet("next_sw", 0);
      Sleep(60000);
   }
   if (I_balance == 0.0) gd_1636 = GlobalVariableGet("start_balance");
   else gd_1636 = I_balance;
   gi_1652 = GlobalVariableGet("start_p");
   if (GlobalVariableGet("next_sw") == 1.0) {
      if (IsTradeContextBusy()) {
         Sleep(10000);
         return;
      }
      f0_47("100%", Symbol(), gi_1656, 0);
      Sleep(5000);
      if (f0_53(gi_1656) != 0) {
         Alert(Symbol() + " カ初ゼΘ?\瞒秨");
         Sleep(30000);
         return;
      }
      Sleep(1000.0 * (60.0 * NextTime));
      return (0);
   }
   if (f0_99(SLpercent, gd_1636)) {
      if (SleepLoss) {
         GlobalVariableSet("RUN", 1);
         GlobalVariableSet("runtime", StrToTime(TimeToStr(TimeLocal(), TIME_DATE)));
      }
      GlobalVariableSet("next_sw", 1);
   }
   if (takepercent > 0.0) {
      str2time_52 = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));
      if (gi_364 == FALSE) {
         if (f0_17(str2time_52, takepercent, gd_1636) == 0) {
            GlobalVariableSet("next_sw", 1);
            return (0);
         }
      }
      if (gi_364 == TRUE) {
         if (f0_17(gi_1652, takepercent, gd_1636) == 0) GlobalVariableSet("next_sw", 1);
         if (f0_17(str2time_52, takepercent_day, gd_1636) == 0) {
            GlobalVariableSet("next_sw", 1);
            return (0);
         }
      }
   }
   f0_41(MaxTime, MaxIn, MaxP, gi_1652);
   if (Hour() == gi_1672 && Minute() == gi_1676 && g_bars_1664 != Bars && GlobalVariableGet("UPSW") == 0.0) {
      GlobalVariableSet("UPSW", 1);
      f0_51("ffcal_week_this.xml");
      g_bars_1664 = Bars;
   }
   if (Hour() == gi_1672 + 1 && Minute() == 0 && GlobalVariableGet("UPSW") == 1.0) GlobalVariableSet("UPSW", 0);
   if (GlobalVariableGet("RUN") == 1.0 && TimeLocal() <= GlobalVariableGet("runtime") + 86400.0) return;
   if (GlobalVariableGet("RUN") == 1.0 && TimeLocal() > GlobalVariableGet("runtime") + 86400.0) GlobalVariableSet("RUN", 0);
   ObjectCreate("run", OBJ_LABEL, 0, 0, 0);
   ObjectSet("run", OBJPROP_CORNER, 1);
   ObjectSet("run", OBJPROP_COLOR, White);
   ObjectSet("run", OBJPROP_XDISTANCE, 20);
   ObjectSet("run", OBJPROP_YDISTANCE, g_y_1668);
   if (!f0_55(W1Start, W5Over, start_t, stop_t, weekday) && OrdersTotal() == 0) return (ObjectSetText("run", "ゼ?砞﹚?跋ず", 10, "稬硁タ堵砰"));
   ObjectSetText("run", "更?Θ? ", 10, "稬硁タ堵砰");
   if (NewsSW == TRUE) {
      gi_1680 = f0_3(gsa_1632);
      if (StrToTime(f0_33(gsa_1632[0][2], gsa_1632[0][3])) + 3600 * gi_92 <= TimeLocal()) {
         if (TimeLocal() >= StrToTime(f0_33(gsa_1632[gi_1680 - 1][2], gsa_1632[gi_1680 - 1][3])) + 3600 * gi_92) {
            text_24 = "タ?钡Μ薄戈,╰参砞﹚い.....";
            text_32 = "薄戈礚猭莉??叫祔??穝币笆";
            ObjectSetText("Newsinfo", text_24, 10, "稬硁タ堵砰", Gold);
            return (ObjectSetText("Newsinfo2", text_32, 10, "稬硁タ堵砰", Gold));
         }
         text_24 = "薄戈?钡ΜЧ?.....";
         ObjectSetText("Newsinfo", text_24, 10, "稬硁タ堵砰", Gold);
         ObjectSetText("Newsinfo2", " ", 10, "稬硁タ堵砰", Gold);
      }
      for (int index_64 = 0; index_64 < gi_1680; index_64++) {
         if (gsa_1632[index_64][4] == "High") {
            li_68 = StrToTime(f0_33(gsa_1632[index_64][2], gsa_1632[index_64][3])) + 28800;
            text_16 = "箇牡筽笷?盎代? " + gsa_1632[index_64][1] + " カ初? " + StringSubstr(TimeToStr(li_68), 11, 5) + " ??盢Τ穝籇?笆";
            text_8 = "Martingale? " + StringSubstr(TimeToStr(li_68 - 60 * Min_before), 11, 5) + " 既?氨ゎ┮Τ?虫笆? ";
            if (TimeLocal() >= li_68 - 60 * NewsOutTime && TimeLocal() <= li_68 && StringFind(Symbol(), gsa_1632[index_64][1], 0) != -1) {
               if (NewsOut == TRUE && f0_53(gi_1656) > 0) {
                  f0_47("100%", Symbol(), gi_1656, 0);
                  Sleep(5000);
               }
            }
            if (TimeLocal() >= li_68 - 60 * Min_before && TimeLocal() <= li_68 + 60 * Min_after && StringFind(Symbol(), gsa_1632[index_64][1], 0) != -1) {
               ObjectSetText("Newsinfo", text_16, 10, "稬硁タ堵砰", Gold);
               ObjectSetText("Newsinfo2", text_8, 10, "稬硁タ堵砰", Gold);
               return (0);
            }
            text_32 = " ";
            ObjectSetText("Newsinfo", text_24, 10, "稬硁タ堵砰", Gold);
            ObjectSetText("Newsinfo2", text_32, 10, "稬硁タ堵砰", Gold);
            if (TimeLocal() == li_68 - 300 || TimeLocal() == li_68 - 299) Alert(gsa_1632[index_64][1] + "カ初??盢Τ穝籇?笆");
         }
      }
   }
   if (!NewsSW) {
      ObjectDelete("Newsinfo");
      ObjectDelete("Newsinfo2");
   }
   if (BrakeSystem) {
      text_72 = "?秖焚ó╰参币笆い";
      text_80 = "?秖焚ó╰参?㏑い";
      color_88 = Gold;
      ObjectSet("Light", OBJPROP_TIME1, TimeCurrent() + 300);
      ObjectSet("Light", OBJPROP_PRICE1, ld_0);
      ObjectSet("Light2", OBJPROP_TIME1, TimeCurrent() + 300);
      ObjectSet("Light2", OBJPROP_PRICE1, ld_0);
      datetime_100 = TimeCurrent();
      ld_104 = Close[0];
      if (gd_1688 != -1.0) {
         li_92 = ld_104 / Point - gd_1688 / Point;
         li_96 = datetime_100 - g_datetime_1696;
         if (MathAbs(li_92) >= gi_1628 && li_96 <= gi_108) {
            if (ld_104 > gd_1688) {
               if (f0_21(gi_1656, OP_SELL) > f0_21(gi_1656, OP_BUY)) {
                  ObjectSet("Light", OBJPROP_COLOR, Red);
                  ObjectSet("Light2", OBJPROP_COLOR, Crimson);
                  ObjectSetText("lightstatus", text_72, 10, "稬硁タ堵砰", color_88);
                  gi_136 = TimeCurrent() + 60 * SleepTime;
               }
            }
            if (ld_104 < gd_1688) {
               if (f0_21(gi_1656, OP_SELL) < f0_21(gi_1656, OP_BUY)) {
                  ObjectSet("Light", OBJPROP_COLOR, Red);
                  ObjectSet("Light2", OBJPROP_COLOR, Crimson);
                  ObjectSetText("lightstatus", text_72, 10, "稬硁タ堵砰", color_88);
                  gi_136 = TimeCurrent() + 60 * SleepTime;
               }
            }
            gd_1688 = ld_104;
            g_datetime_1696 = datetime_100;
         } else {
            ObjectSet("Light", OBJPROP_COLOR, Lime);
            ObjectSet("Light2", OBJPROP_COLOR, LawnGreen);
            ObjectSetText("lightstatus", text_80, 10, "稬硁タ堵砰", color_88);
         }
         if (li_96 >= gi_108) {
            gd_1688 = ld_104;
            g_datetime_1696 = datetime_100;
            ObjectSet("Light", OBJPROP_COLOR, Lime);
            ObjectSet("Light2", OBJPROP_COLOR, LawnGreen);
            ObjectSetText("lightstatus", text_80, 10, "稬硁タ堵砰", color_88);
         }
      } else {
         gd_1688 = ld_104;
         g_datetime_1696 = datetime_100;
         ObjectSet("Light", OBJPROP_COLOR, Lime);
         ObjectSet("Light2", OBJPROP_COLOR, LawnGreen);
         ObjectSetText("lightstatus", text_80, 10, "稬硁タ堵砰", color_88);
      }
      if (TimeCurrent() <= gi_136) {
         ObjectSet("Light", OBJPROP_COLOR, Red);
         ObjectSet("Light2", OBJPROP_COLOR, Crimson);
         return (ObjectSetText("lightstatus", text_72 + ", " + DoubleToStr((gi_136 - TimeCurrent()) / 60, 0) + " だ牧?币笆", 10, "稬硁タ堵砰", color_88));
      }
   } else {
      ObjectDelete("Light");
      ObjectDelete("Light2");
      ObjectDelete("lightstatus");
   }
   if (MarginSleep) {
      li_112 = FALSE;
      if (AccountMargin() == 0.0) li_112 = TRUE;
      else {
         ld_116 = 100.0 * (AccountEquity() / AccountMargin());
         if (MarginLimit >= ld_116 && (!li_112)) {
            ObjectCreate("Margin", OBJ_LABEL, 0, 0, 0);
            ObjectSet("Margin", OBJPROP_CORNER, 1);
            ObjectSet("Margin", OBJPROP_COLOR, Gold);
            ObjectSet("Margin", OBJPROP_XDISTANCE, 20);
            ObjectSet("Margin", OBJPROP_YDISTANCE, g_y_1668 + 155);
            return (ObjectSetText("Margin", "玂靡?ゑㄒ?? " + DoubleToStr(MarginLimit, 2) + " 既氨", 10, "稬硁タ堵砰", Gold));
         }
         ObjectDelete("Margin");
      }
   } else ObjectDelete("Margin");
   if (FloatEq) {
      ld_124 = AccountProfit();
      if (ld_124 <= FloatAm) {
         ObjectCreate("Float", OBJ_LABEL, 0, 0, 0);
         ObjectSet("Float", OBJPROP_CORNER, 1);
         ObjectSet("Float", OBJPROP_COLOR, Gold);
         ObjectSet("Float", OBJPROP_XDISTANCE, 20);
         ObjectSet("Float", OBJPROP_YDISTANCE, g_y_1668 + 175);
         return (ObjectSetText("Float", "疊莲?? " + DoubleToStr(FloatAm, 2) + " 既氨", 10, "稬硁タ堵砰", Gold));
      }
      ObjectDelete("Float");
   } else ObjectDelete("Float");
   int li_332 = 0;
   int li_336 = 0;
   int li_340 = 0;
   int li_344 = 0;
   int li_348 = 0;
   int li_352 = 0;
   li_332 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point;
   for (li_352 = 1; li_352 <= 5; li_352++) li_336 = li_336 + (iHigh(NULL, PERIOD_D1, li_352) - iLow(NULL, PERIOD_D1, li_352)) / Point;
   for (li_352 = 1; li_352 <= 10; li_352++) li_340 = li_340 + (iHigh(NULL, PERIOD_D1, li_352) - iLow(NULL, PERIOD_D1, li_352)) / Point;
   for (li_352 = 1; li_352 <= 20; li_352++) li_344 = li_344 + (iHigh(NULL, PERIOD_D1, li_352) - iLow(NULL, PERIOD_D1, li_352)) / Point;
   li_336 /= 5;
   li_340 /= 10;
   li_344 /= 20;
   li_348 = (li_332 + li_336 + li_340 + li_344) / 4;
   string ls_unused_356 = "";
   string ls_unused_364 = "";
   string dbl2str_372 = "";
   string dbl2str_380 = "";
   string dbl2str_388 = "";
   string dbl2str_396 = "";
   string ls_unused_404 = "";
   string ls_unused_412 = "";
   string ls_420 = "";
   double iopen_428 = iOpen(NULL, PERIOD_D1, 0);
   double iclose_436 = iClose(NULL, PERIOD_D1, 0);
   double ld_444 = (Ask - Bid) / Point;
   double ihigh_452 = iHigh(NULL, PERIOD_D1, 0);
   double ilow_460 = iLow(NULL, PERIOD_D1, 0);
   dbl2str_380 = DoubleToStr((iclose_436 - iopen_428) / Point, 0);
   dbl2str_372 = DoubleToStr(ld_444, Digits - 4);
   dbl2str_388 = DoubleToStr(li_348, Digits - 4);
   ls_420 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point;
   dbl2str_396 = DoubleToStr((ihigh_452 - ilow_460) / Point, 0);
   if (iclose_436 >= iopen_428) {
      ls_unused_404 = "-";
      li_unused_236 = gi_1392;
   }
   if (iclose_436 < iopen_428) {
      ls_unused_404 = "-";
      li_unused_236 = gi_1396;
   }
   if (dbl2str_388 >= ls_420) {
      ls_unused_412 = "-";
      li_unused_240 = gi_1400;
   }
   if (dbl2str_388 < ls_420) {
      ls_unused_412 = "-";
      li_unused_240 = gi_1404;
   }
   double ld_468 = LotExponent;
   int li_476 = gi_500;
   double ld_480 = TakeProfit;
   bool li_488 = gi_532;
   double ld_492 = gd_536;
   if (gi_512 == TRUE) {
      if (MathCeil(AccountBalance()) < 2000.0) ld_276 = Lots;
      else ld_276 = 0.00001 * MathCeil(AccountBalance());
   } else ld_276 = Lots;
   if ((gi_552 == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(gi_556 + ":00")) || (gi_560 == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(gi_564 +
      ":00"))) return (0);
   if (gi_600) f0_52(gd_612, gd_620, g_price_680);
   if (gi_588) {
      if (TimeCurrent() >= gi_744) {
         f0_14();
         Print("Closed All due_Hilo to TimeOut");
      }
   }
   if (gi_740 == Time[0]) return (0);
   gi_740 = Time[0];
   double ld_500 = f0_50();
   if (li_488) {
      if (ld_500 < 0.0 && MathAbs(ld_500) > ld_492 / 100.0 * f0_34()) {
         f0_14();
         Print("Closed All due_Hilo to Stop Out");
         gi_792 = FALSE;
      }
   }
   gi_764 = f0_54();
   if (gi_764 == 0) gi_728 = FALSE;
   for (g_pos_760 = OrdersTotal() - 1; g_pos_760 >= 0; g_pos_760--) {
      OrderSelect(g_pos_760, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
         if (OrderType() == OP_BUY) {
            gi_780 = TRUE;
            gi_784 = FALSE;
            break;
         }
      }
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
         if (OrderType() == OP_SELL) {
            gi_780 = FALSE;
            gi_784 = TRUE;
            break;
         }
      }
   }
   if (gi_764 > 0 && gi_764 <= MaxTrades_A) {
      RefreshRates();
      gd_704 = f0_23();
      gd_712 = f0_10();
      if (gi_780 && gd_704 - Ask >= g_pips_628 * Point) gi_776 = TRUE;
      if (gi_784 && Bid - gd_712 >= g_pips_628 * Point) gi_776 = TRUE;
   }
   if (gi_764 < 1) {
      gi_784 = FALSE;
      gi_780 = FALSE;
      gi_776 = TRUE;
      gd_656 = AccountEquity();
   }
   if (gi_776) {
      gd_704 = f0_23();
      gd_712 = f0_10();
      if (gi_784) {
         gi_748 = gi_764;
         gd_752 = NormalizeDouble(ld_276 * MathPow(ld_468, gi_748), li_476);
         RefreshRates();
         gi_788 = f0_22(1, gd_752, Bid, g_slippage_636, Ask, 0, 0, gs_732 + "-" + gi_748, g_magic_644, 0, HotPink);
         if (gi_788 < 0) {
            Print("Error: ", GetLastError());
            return (0);
         }
         gd_712 = f0_10();
         gi_776 = FALSE;
         gi_792 = TRUE;
      } else {
         if (gi_780) {
            gi_748 = gi_764;
            gd_752 = NormalizeDouble(ld_276 * MathPow(ld_468, gi_748), li_476);
            gi_788 = f0_22(0, gd_752, Ask, g_slippage_636, Bid, 0, 0, gs_732 + "-" + gi_748, g_magic_644, 0, Lime);
            if (gi_788 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            gd_704 = f0_23();
            gi_776 = FALSE;
            gi_792 = TRUE;
         }
      }
   }
   if (gi_776 && gi_764 < 1) {
      ihigh_244 = iHigh(Symbol(), 0, 1);
      ilow_252 = iLow(Symbol(), 0, 2);
      g_bid_688 = Bid;
      g_ask_696 = Ask;
      if ((!gi_784) && !gi_780) {
         gi_748 = gi_764;
         gd_752 = NormalizeDouble(ld_276 * MathPow(ld_468, gi_748), li_476);
         if (ihigh_244 > ilow_252) {
            if (iRSI(NULL, PERIOD_H1, 14, PRICE_CLOSE, 1) > 30.0) {
               gi_788 = f0_22(1, gd_752, g_bid_688, g_slippage_636, g_bid_688, 0, 0, gs_732 + "-" + gi_748, g_magic_644, 0, HotPink);
               if (gi_788 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_704 = f0_23();
               gi_792 = TRUE;
            }
         } else {
            if (iRSI(NULL, PERIOD_H1, 14, PRICE_CLOSE, 1) < 70.0) {
               gi_788 = f0_22(0, gd_752, g_ask_696, g_slippage_636, g_ask_696, 0, 0, gs_732 + "-" + gi_748, g_magic_644, 0, Lime);
               if (gi_788 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_712 = f0_10();
               gi_792 = TRUE;
            }
         }
         if (gi_788 > 0) gi_744 = TimeCurrent() + 60.0 * (60.0 * gd_592);
         gi_776 = FALSE;
      }
   }
   gi_764 = f0_54();
   g_price_680 = 0;
   double ld_508 = 0;
   for (g_pos_760 = OrdersTotal() - 1; g_pos_760 >= 0; g_pos_760--) {
      OrderSelect(g_pos_760, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            g_price_680 += OrderOpenPrice() * OrderLots();
            ld_508 += OrderLots();
         }
      }
   }
   if (gi_764 > 0) g_price_680 = NormalizeDouble(g_price_680 / ld_508, Digits);
   if (gi_792) {
      for (g_pos_760 = OrdersTotal() - 1; g_pos_760 >= 0; g_pos_760--) {
         OrderSelect(g_pos_760, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
            if (OrderType() == OP_BUY) {
               g_price_648 = g_price_680 + ld_480 * Point;
               gd_unused_664 = g_price_648;
               gd_768 = g_price_680 - g_pips_604 * Point;
               gi_728 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
            if (OrderType() == OP_SELL) {
               g_price_648 = g_price_680 - ld_480 * Point;
               gd_unused_672 = g_price_648;
               gd_768 = g_price_680 + g_pips_604 * Point;
               gi_728 = TRUE;
            }
         }
      }
   }
   if (gi_792) {
      if (gi_728 == TRUE) {
         for (g_pos_760 = OrdersTotal() - 1; g_pos_760 >= 0; g_pos_760--) {
            OrderSelect(g_pos_760, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) OrderModify(OrderTicket(), g_price_680, OrderStopLoss(), g_price_648, 0, Yellow);
            gi_792 = FALSE;
         }
      }
   }
   double ld_516 = LotExponent;
   int li_524 = gi_500;
   double ld_528 = TakeProfit;
   bool li_536 = gi_532;
   double ld_540 = gd_536;
   if (gi_512 == TRUE) {
      if (MathCeil(AccountBalance()) < 2000.0) ld_284 = Lots;
      else ld_284 = 0.00001 * MathCeil(AccountBalance());
   } else ld_284 = Lots;
   if ((gi_552 == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(gi_556 + ":00")) || (gi_560 == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(gi_564 +
      ":00"))) return (0);
   if (gi_836) f0_45(gd_848, gd_856, g_price_928);
   if (gi_864) {
      if (TimeCurrent() >= gi_992) {
         f0_32();
         Print("Closed All due to TimeOut");
      }
   }
   if (gi_988 != Time[0]) {
      gi_988 = Time[0];
      ld_292 = f0_43();
      if (li_536) {
         if (ld_292 < 0.0 && MathAbs(ld_292) > ld_540 / 100.0 * f0_9()) {
            f0_32();
            Print("Closed All due to Stop Out");
            gi_1040 = FALSE;
         }
      }
      gi_1012 = f0_4();
      if (gi_1012 == 0) gi_976 = FALSE;
      for (g_pos_1008 = OrdersTotal() - 1; g_pos_1008 >= 0; g_pos_1008--) {
         OrderSelect(g_pos_1008, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
            if (OrderType() == OP_BUY) {
               gi_1028 = TRUE;
               gi_1032 = FALSE;
               break;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
            if (OrderType() == OP_SELL) {
               gi_1028 = FALSE;
               gi_1032 = TRUE;
               break;
            }
         }
      }
      if (gi_1012 > 0 && gi_1012 <= MaxTrades_B) {
         RefreshRates();
         gd_952 = f0_7();
         gd_960 = f0_19();
         if (gi_1028 && gd_952 - Ask >= g_pips_876 * Point) gi_1024 = TRUE;
         if (gi_1032 && Bid - gd_960 >= g_pips_876 * Point) gi_1024 = TRUE;
      }
      if (gi_1012 < 1) {
         gi_1032 = FALSE;
         gi_1028 = FALSE;
         gi_1024 = TRUE;
         gd_904 = AccountEquity();
      }
      if (gi_1024) {
         gd_952 = f0_7();
         gd_960 = f0_19();
         if (gi_1032) {
            gi_996 = gi_1012;
            gd_1000 = NormalizeDouble(ld_284 * MathPow(ld_516, gi_996), li_524);
            RefreshRates();
            gi_1036 = f0_8(1, gd_1000, Bid, g_slippage_884, Ask, 0, 0, gs_980 + "-" + gi_996, g_magic_892, 0, HotPink);
            if (gi_1036 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            gd_960 = f0_19();
            gi_1024 = FALSE;
            gi_1040 = TRUE;
         } else {
            if (gi_1028) {
               gi_996 = gi_1012;
               gd_1000 = NormalizeDouble(ld_284 * MathPow(ld_516, gi_996), li_524);
               gi_1036 = f0_8(0, gd_1000, Ask, g_slippage_884, Bid, 0, 0, gs_980 + "-" + gi_996, g_magic_892, 0, Lime);
               if (gi_1036 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_952 = f0_7();
               gi_1024 = FALSE;
               gi_1040 = TRUE;
            }
         }
      }
   }
   if (g_datetime_1060 != iTime(NULL, g_timeframe_832, 0)) {
      li_300 = OrdersTotal();
      count_304 = 0;
      for (int li_548 = li_300; li_548 >= 1; li_548--) {
         OrderSelect(li_548 - 1, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) count_304++;
      }
      if (li_300 == 0 || count_304 < 1) {
         iclose_260 = iClose(Symbol(), 0, 2);
         iclose_268 = iClose(Symbol(), 0, 1);
         g_bid_936 = Bid;
         g_ask_944 = Ask;
         gi_996 = gi_1012;
         gd_1000 = ld_284;
         if (iclose_260 > iclose_268) {
            gi_1036 = f0_8(1, gd_1000, g_bid_936, g_slippage_884, g_bid_936, 0, 0, gs_980 + "-" + gi_996, g_magic_892, 0, HotPink);
            if (gi_1036 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            gd_952 = f0_7();
            gi_1040 = TRUE;
         } else {
            gi_1036 = f0_8(0, gd_1000, g_ask_944, g_slippage_884, g_ask_944, 0, 0, gs_980 + "-" + gi_996, g_magic_892, 0, Lime);
            if (gi_1036 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            gd_960 = f0_19();
            gi_1040 = TRUE;
         }
         if (gi_1036 > 0) gi_992 = TimeCurrent() + 60.0 * (60.0 * gd_868);
         gi_1024 = FALSE;
      }
      g_datetime_1060 = iTime(NULL, g_timeframe_832, 0);
   }
   gi_1012 = f0_4();
   g_price_928 = 0;
   double ld_552 = 0;
   for (g_pos_1008 = OrdersTotal() - 1; g_pos_1008 >= 0; g_pos_1008--) {
      OrderSelect(g_pos_1008, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            g_price_928 += OrderOpenPrice() * OrderLots();
            ld_552 += OrderLots();
         }
      }
   }
   if (gi_1012 > 0) g_price_928 = NormalizeDouble(g_price_928 / ld_552, Digits);
   if (gi_1040) {
      for (g_pos_1008 = OrdersTotal() - 1; g_pos_1008 >= 0; g_pos_1008--) {
         OrderSelect(g_pos_1008, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
            if (OrderType() == OP_BUY) {
               g_price_896 = g_price_928 + ld_528 * Point;
               gd_unused_912 = g_price_896;
               gd_1016 = g_price_928 - g_pips_840 * Point;
               gi_976 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
            if (OrderType() == OP_SELL) {
               g_price_896 = g_price_928 - ld_528 * Point;
               gd_unused_920 = g_price_896;
               gd_1016 = g_price_928 + g_pips_840 * Point;
               gi_976 = TRUE;
            }
         }
      }
   }
   if (gi_1040) {
      if (gi_976 == TRUE) {
         for (g_pos_1008 = OrdersTotal() - 1; g_pos_1008 >= 0; g_pos_1008--) {
            OrderSelect(g_pos_1008, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) OrderModify(OrderTicket(), g_price_928, OrderStopLoss(), g_price_896, 0, Yellow);
            gi_1040 = FALSE;
         }
      }
   }
   double ld_560 = LotExponent;
   int li_568 = gi_500;
   double ld_572 = TakeProfit;
   bool li_580 = gi_532;
   double ld_584 = gd_536;
   if (gi_512 == TRUE) {
      if (MathCeil(AccountBalance()) < 2000.0) ld_308 = Lots;
      else ld_308 = 0.00001 * MathCeil(AccountBalance());
   } else ld_308 = Lots;
   if ((gi_552 == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(gi_556 + ":00")) || (gi_560 == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(gi_564 +
      ":00"))) return (0);
   if (gi_1088) f0_44(gd_1100, gd_1108, g_price_1180);
   if (gi_1116) {
      if (TimeCurrent() >= gi_1244) {
         f0_36();
         Print("Closed All due to TimeOut");
      }
   }
   if (gi_1240 != Time[0]) {
      gi_1240 = Time[0];
      ld_316 = f0_24();
      if (li_580) {
         if (ld_316 < 0.0 && MathAbs(ld_316) > ld_584 / 100.0 * f0_26()) {
            f0_36();
            Print("Closed All due to Stop Out");
            gi_1292 = FALSE;
         }
      }
      gi_1264 = f0_12();
      if (gi_1264 == 0) gi_1228 = FALSE;
      for (g_pos_1260 = OrdersTotal() - 1; g_pos_1260 >= 0; g_pos_1260--) {
         OrderSelect(g_pos_1260, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
            if (OrderType() == OP_BUY) {
               gi_1280 = TRUE;
               gi_1284 = FALSE;
               break;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
            if (OrderType() == OP_SELL) {
               gi_1280 = FALSE;
               gi_1284 = TRUE;
               break;
            }
         }
      }
      if (gi_1264 > 0 && gi_1264 <= MaxTrades_C) {
         RefreshRates();
         gd_1204 = f0_20();
         gd_1212 = f0_46();
         if (gi_1280 && gd_1204 - Ask >= g_pips_1128 * Point) gi_1276 = TRUE;
         if (gi_1284 && Bid - gd_1212 >= g_pips_1128 * Point) gi_1276 = TRUE;
      }
      if (gi_1264 < 1) {
         gi_1284 = FALSE;
         gi_1280 = FALSE;
         gd_1156 = AccountEquity();
      }
      if (gi_1276) {
         gd_1204 = f0_20();
         gd_1212 = f0_46();
         if (gi_1284) {
            gi_1248 = gi_1264;
            gd_1252 = NormalizeDouble(ld_308 * MathPow(ld_560, gi_1248), li_568);
            RefreshRates();
            gi_1288 = f0_16(1, gd_1252, Bid, g_slippage_1136, Ask, 0, 0, gs_1232 + "-" + gi_1248, g_magic_1144, 0, HotPink);
            if (gi_1288 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            gd_1212 = f0_46();
            gi_1276 = FALSE;
            gi_1292 = TRUE;
         } else {
            if (gi_1280) {
               gi_1248 = gi_1264;
               gd_1252 = NormalizeDouble(ld_308 * MathPow(ld_560, gi_1248), li_568);
               gi_1288 = f0_16(0, gd_1252, Ask, g_slippage_1136, Bid, 0, 0, gs_1232 + "-" + gi_1248, g_magic_1144, 0, Lime);
               if (gi_1288 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_1204 = f0_20();
               gi_1276 = FALSE;
               gi_1292 = TRUE;
            }
         }
      }
   }
   if (g_datetime_1312 != iTime(NULL, g_timeframe_1084, 0)) {
      li_324 = OrdersTotal();
      count_328 = 0;
      for (int li_592 = li_324; li_592 >= 1; li_592--) {
         OrderSelect(li_592 - 1, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) count_328++;
      }
      if (li_324 == 0 || count_328 < 1) {
         iclose_260 = iClose(Symbol(), 0, 2);
         iclose_268 = iClose(Symbol(), 0, 1);
         g_bid_1188 = Bid;
         g_ask_1196 = Ask;
         gi_1248 = gi_1264;
         gd_1252 = ld_308;
         if (iclose_260 > iclose_268) {
            if (iRSI(NULL, PERIOD_H1, 14, PRICE_CLOSE, 1) > 30.0) {
               gi_1288 = f0_16(1, gd_1252, g_bid_1188, g_slippage_1136, g_bid_1188, 0, 0, gs_1232 + "-" + gi_1248, g_magic_1144, 0, HotPink);
               if (gi_1288 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_1204 = f0_20();
               gi_1292 = TRUE;
            }
         } else {
            if (iRSI(NULL, PERIOD_H1, 14, PRICE_CLOSE, 1) < 70.0) {
               gi_1288 = f0_16(0, gd_1252, g_ask_1196, g_slippage_1136, g_ask_1196, 0, 0, gs_1232 + "-" + gi_1248, g_magic_1144, 0, Lime);
               if (gi_1288 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               gd_1212 = f0_46();
               gi_1292 = TRUE;
            }
         }
         if (gi_1288 > 0) gi_1244 = TimeCurrent() + 60.0 * (60.0 * gd_1120);
         gi_1276 = FALSE;
      }
      g_datetime_1312 = iTime(NULL, g_timeframe_1084, 0);
   }
   gi_1264 = f0_12();
   g_price_1180 = 0;
   double ld_596 = 0;
   for (g_pos_1260 = OrdersTotal() - 1; g_pos_1260 >= 0; g_pos_1260--) {
      OrderSelect(g_pos_1260, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            g_price_1180 += OrderOpenPrice() * OrderLots();
            ld_596 += OrderLots();
         }
      }
   }
   if (gi_1264 > 0) g_price_1180 = NormalizeDouble(g_price_1180 / ld_596, Digits);
   if (gi_1292) {
      for (g_pos_1260 = OrdersTotal() - 1; g_pos_1260 >= 0; g_pos_1260--) {
         OrderSelect(g_pos_1260, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
            if (OrderType() == OP_BUY) {
               g_price_1148 = g_price_1180 + ld_572 * Point;
               gd_unused_1164 = g_price_1148;
               gd_1268 = g_price_1180 - g_pips_1092 * Point;
               gi_1228 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
            if (OrderType() == OP_SELL) {
               g_price_1148 = g_price_1180 - ld_572 * Point;
               gd_unused_1172 = g_price_1148;
               gd_1268 = g_price_1180 + g_pips_1092 * Point;
               gi_1228 = TRUE;
            }
         }
      }
   }
   if (gi_1292) {
      if (gi_1228 == TRUE) {
         for (g_pos_1260 = OrdersTotal() - 1; g_pos_1260 >= 0; g_pos_1260--) {
            OrderSelect(g_pos_1260, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) OrderModify(OrderTicket(), g_price_1180, OrderStopLoss(), g_price_1148, 0, Yellow);
            gi_1292 = FALSE;
         }
      }
   }
   return (0);
}
// F828EDC20051679939B205229F41E729
int f0_54() {
   int count_0 = 0;
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644)
         if (OrderType() == OP_SELL || OrderType() == OP_BUY) count_0++;
   }
   return (count_0);
}
// 40075B76974761962804E2375C0BC86C
void f0_14() {
   for (int pos_0 = OrdersTotal() - 1; pos_0 >= 0; pos_0--) {
      OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644) {
            if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_636, Blue);
            if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_636, Red);
         }
         Sleep(1000);
      }
   }
}
// 6DFBF6D5A36D5A8CB1065823B2F377C5
int f0_22(int ai_0, double a_lots_4, double a_price_12, int a_slippage_20, double ad_24, int ai_32, int ai_36, string a_comment_40, int a_magic_48, int a_datetime_52, color a_color_56) {
   int ticket_60 = 0;
   int error_64 = 0;
   int count_68 = 0;
   int li_72 = 100;
   if (!f0_25(ai_0) && BSB) return;
   switch (ai_0) {
   case 2:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_49(ad_24, ai_32), f0_2(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(1000);
      }
      break;
   case 4:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_4, a_price_12, a_slippage_20, f0_49(ad_24, ai_32), f0_2(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 0:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         RefreshRates();
         ticket_60 = OrderSend(Symbol(), OP_BUY, a_lots_4, Ask, a_slippage_20, f0_49(Bid, ai_32), f0_2(Ask, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 3:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_6(ad_24, ai_32), f0_1(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 5:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, a_lots_4, a_price_12, a_slippage_20, f0_6(ad_24, ai_32), f0_1(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 1:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELL, a_lots_4, Bid, a_slippage_20, f0_6(Ask, ai_32), f0_1(Bid, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
   }
   return (ticket_60);
}
// D8981D1B0249D3D62BAA7861AF6E65AE
double f0_49(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// 1F5745A66A7E0CCF34AAF061352AA3C5
double f0_6(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 0A7A36B48AB3F4FE261A94BDA62F775C
double f0_2(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 06CA655E1CFF36FE062F783AA99F7C34
double f0_1(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// D8B5355CED3223834CD81538A6700951
double f0_50() {
   double ld_ret_0 = 0;
   for (g_pos_760 = OrdersTotal() - 1; g_pos_760 >= 0; g_pos_760--) {
      OrderSelect(g_pos_760, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}
// EF100D113A4714E489F14B9EE43241E3
void f0_52(int ai_0, int ai_4, double a_price_8) {
   int li_16;
   double order_stoploss_20;
   double price_28;
   if (ai_4 != 0) {
      for (int pos_36 = OrdersTotal() - 1; pos_36 >= 0; pos_36--) {
         if (OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
            if (OrderSymbol() == Symbol() || OrderMagicNumber() == g_magic_644) {
               if (OrderType() == OP_BUY) {
                  li_16 = NormalizeDouble((Bid - a_price_8) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Bid - ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 > order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Aqua);
               }
               if (OrderType() == OP_SELL) {
                  li_16 = NormalizeDouble((a_price_8 - Ask) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Ask + ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 < order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Red);
               }
            }
            Sleep(1000);
         }
      }
   }
}
// 6E215E881409F304D9BAE2E62343A645
double f0_23() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644 && OrderType() == OP_BUY) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// 8EC9622626267A95F6E13966304B3377
double f0_34() {
   if (f0_54() == 0) gd_796 = AccountEquity();
   if (gd_796 < gd_804) gd_796 = gd_804;
   else gd_796 = AccountEquity();
   gd_804 = AccountEquity();
   return (gd_796);
}
// 2D3680066427D29B0C2ED709DD6D362C
double f0_10() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_644) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644 && OrderType() == OP_SELL) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// 137EC9C555D8FF1FB37FB612F1E8391B
int f0_4() {
   int count_0 = 0;
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892)
         if (OrderType() == OP_SELL || OrderType() == OP_BUY) count_0++;
   }
   return (count_0);
}
// 8C97B6E9FB2894DA21FF4EF27AE1479D
void f0_32() {
   for (int pos_0 = OrdersTotal() - 1; pos_0 >= 0; pos_0--) {
      OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892) {
            if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_884, Blue);
            if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_884, Red);
         }
         Sleep(1000);
      }
   }
}
// 25CF634A77C7909B87B9D8A19B610BAE
int f0_8(int ai_0, double a_lots_4, double a_price_12, int a_slippage_20, double ad_24, int ai_32, int ai_36, string a_comment_40, int a_magic_48, int a_datetime_52, color a_color_56) {
   int ticket_60 = 0;
   int error_64 = 0;
   int count_68 = 0;
   int li_72 = 100;
   if (!f0_31(ai_0) && BSB) return;
   switch (ai_0) {
   case 2:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_48(ad_24, ai_32), f0_11(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(1000);
      }
      break;
   case 4:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_4, a_price_12, a_slippage_20, f0_48(ad_24, ai_32), f0_11(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 0:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         RefreshRates();
         ticket_60 = OrderSend(Symbol(), OP_BUY, a_lots_4, Ask, a_slippage_20, f0_48(Bid, ai_32), f0_11(Ask, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 3:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_15(ad_24, ai_32), f0_5(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 5:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, a_lots_4, a_price_12, a_slippage_20, f0_15(ad_24, ai_32), f0_5(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 1:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELL, a_lots_4, Bid, a_slippage_20, f0_15(Ask, ai_32), f0_5(Bid, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
   }
   return (ticket_60);
}
// D6890E66A509F0A81F3FA9390E2791D5
double f0_48(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// 41FA5E6533604AF8026F2F57A2CDA7C8
double f0_15(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 356EF21ACC6E0D9704435085A904242E
double f0_11(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 147347E8BCB2D8A7436788A48DB1FE1B
double f0_5(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// C758226E950E7DE82B5D047E7D273D7E
double f0_43() {
   double ld_ret_0 = 0;
   for (g_pos_1008 = OrdersTotal() - 1; g_pos_1008 >= 0; g_pos_1008--) {
      OrderSelect(g_pos_1008, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}
// D14347EEA6AFC2BC1802784E9406733D
void f0_45(int ai_0, int ai_4, double a_price_8) {
   int li_16;
   double order_stoploss_20;
   double price_28;
   if (ai_4 != 0) {
      for (int pos_36 = OrdersTotal() - 1; pos_36 >= 0; pos_36--) {
         if (OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
            if (OrderSymbol() == Symbol() || OrderMagicNumber() == g_magic_892) {
               if (OrderType() == OP_BUY) {
                  li_16 = NormalizeDouble((Bid - a_price_8) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Bid - ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 > order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Aqua);
               }
               if (OrderType() == OP_SELL) {
                  li_16 = NormalizeDouble((a_price_8 - Ask) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Ask + ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 < order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Red);
               }
            }
            Sleep(1000);
         }
      }
   }
}
// 2BFECE88732AF38006A248D2AEB4875D
double f0_9() {
   if (f0_4() == 0) gd_1044 = AccountEquity();
   if (gd_1044 < gd_1052) gd_1044 = gd_1052;
   else gd_1044 = AccountEquity();
   gd_1052 = AccountEquity();
   return (gd_1044);
}
// 1FED367EA852A559BDE1B720F215E809
double f0_7() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892 && OrderType() == OP_BUY) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// 59575BAA4976F1AA75CDD6E12F0D07FF
double f0_19() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_892) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_892 && OrderType() == OP_SELL) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// 3B56F5F33B528D803FC0B55A684F53BE
int f0_12() {
   int count_0 = 0;
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144)
         if (OrderType() == OP_SELL || OrderType() == OP_BUY) count_0++;
   }
   return (count_0);
}
// 945D754CB0DC06D04243FCBA25FC0802
void f0_36() {
   for (int pos_0 = OrdersTotal() - 1; pos_0 >= 0; pos_0--) {
      OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144) {
            if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_1136, Blue);
            if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_1136, Red);
         }
         Sleep(1000);
      }
   }
}
// 45280DE359EB485C9225BE4240A13BD1
int f0_16(int ai_0, double a_lots_4, double a_price_12, int a_slippage_20, double ad_24, int ai_32, int ai_36, string a_comment_40, int a_magic_48, int a_datetime_52, color a_color_56) {
   int ticket_60 = 0;
   int error_64 = 0;
   int count_68 = 0;
   int li_72 = 100;
   if (!f0_39(ai_0) && BSB) return;
   switch (ai_0) {
   case 2:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_40(ad_24, ai_32), f0_0(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(1000);
      }
      break;
   case 4:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_4, a_price_12, a_slippage_20, f0_40(ad_24, ai_32), f0_0(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 0:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         RefreshRates();
         ticket_60 = OrderSend(Symbol(), OP_BUY, a_lots_4, Ask, a_slippage_20, f0_40(Bid, ai_32), f0_0(Ask, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 3:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, a_lots_4, a_price_12, a_slippage_20, f0_29(ad_24, ai_32), f0_30(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 5:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, a_lots_4, a_price_12, a_slippage_20, f0_29(ad_24, ai_32), f0_30(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52,
            a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 1:
      for (count_68 = 0; count_68 < li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELL, a_lots_4, Bid, a_slippage_20, f0_29(Ask, ai_32), f0_30(Bid, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
   }
   return (ticket_60);
}
// B503A32C38A3016897AE02808FE6F99E
double f0_40(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// 87F2DB5991CF75B9FD34D67D0116CF5D
double f0_29(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 00D17BBDDDAA35E8FA15D75416BE5CD5
double f0_0(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 + ai_8 * Point);
}
// 88F91D89229BE3C280CF3AE0099ED14F
double f0_30(double ad_0, int ai_8) {
   if (ai_8 == 0) return (0);
   return (ad_0 - ai_8 * Point);
}
// 71D6BEDC2742299EE1D5C68DD063414F
double f0_24() {
   double ld_ret_0 = 0;
   for (g_pos_1260 = OrdersTotal() - 1; g_pos_1260 >= 0; g_pos_1260--) {
      OrderSelect(g_pos_1260, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}
// D1401D1EAEF83F876A3BF3C7BDD88939
void f0_44(int ai_0, int ai_4, double a_price_8) {
   int li_16;
   double order_stoploss_20;
   double price_28;
   if (ai_4 != 0) {
      for (int pos_36 = OrdersTotal() - 1; pos_36 >= 0; pos_36--) {
         if (OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
            if (OrderSymbol() == Symbol() || OrderMagicNumber() == g_magic_1144) {
               if (OrderType() == OP_BUY) {
                  li_16 = NormalizeDouble((Bid - a_price_8) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Bid - ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 > order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Aqua);
               }
               if (OrderType() == OP_SELL) {
                  li_16 = NormalizeDouble((a_price_8 - Ask) / Point, 0);
                  if (li_16 < ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Ask + ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 < order_stoploss_20)) OrderModify(OrderTicket(), a_price_8, price_28, OrderTakeProfit(), 0, Red);
               }
            }
            Sleep(1000);
         }
      }
   }
}
// 7D4170E7F9D48259081D60629083EEF8
double f0_26() {
   if (f0_12() == 0) gd_1296 = AccountEquity();
   if (gd_1296 < gd_1304) gd_1296 = gd_1304;
   else gd_1296 = AccountEquity();
   gd_1304 = AccountEquity();
   return (gd_1296);
}
// 599F55182F703D238FC0ED8443B2927C
double f0_20() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144 && OrderType() == OP_BUY) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// D3DDB5A1BC386764F4BB59DBF03295BB
double f0_46() {
   double order_open_price_0;
   int ticket_8;
   double ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_1144) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_1144 && OrderType() == OP_SELL) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}
// 0B91D1C01B621C7B06D35AE23007B2DC
int f0_3(string &asa_0[300][7]) {
   string lsa_4[];
   string text_12;
   string lsa_32[];
   int file_8 = FileOpen("ffcal_week_this.xml", FILE_CSV|FILE_READ);
   if (file_8 < 0) {
      text_12 = "戈癟礚猭莉??叫も笆磅︽竲セ";
      return (ObjectSetText("Newsinfo2", text_12, 10, "稬硁タ堵砰", Gold));
   }
   string ls_20 = FileReadString(file_8);
   for (int index_28 = 0; index_28 < 2000; index_28++) {
      ArrayResize(lsa_4, index_28 + 1);
      ls_20 = FileReadString(file_8);
      if (index_28 > 1) lsa_4[index_28 - 2] = ls_20;
      if (FileIsEnding(file_8)) {
         FileClose(file_8);
         break;
      }
   }
   ArrayResize(lsa_32, ArraySize(lsa_4) - 3);
   int li_ret_36 = (ArraySize(lsa_4) - 3) / 9;
   for (index_28 = 0; index_28 < li_ret_36; index_28++) ArrayCopy(lsa_32, lsa_4, 7 * index_28, 9 * index_28, 7);
   for (index_28 = 0; index_28 < li_ret_36; index_28++) for (int index_40 = 0; index_40 < 7; index_40++) asa_0[index_28][index_40] = lsa_32[7 * index_28 + index_40];
   string lsa_44[7] = {"<title>", "<country>", "<date><![CDATA[", "<time><![CDATA[", "<impact><![CDATA[", "<forecast><![CDATA[", "<previous><![CDATA["};
   string lsa_48[7] = {"</title>", "</country>", "]]></date>", "]]></time>", "]]></impact>", "]]></forecast>", "]]></previous>"};
   for (index_28 = 0; index_28 < li_ret_36; index_28++) {
      for (index_40 = 0; index_40 < 7; index_40++) {
         asa_0[index_28][index_40] = StringSubstr(asa_0[index_28][index_40], StringFind(asa_0[index_28][index_40], lsa_44[index_40], 0) + StringLen(lsa_44[index_40]), StringFind(asa_0[index_28][index_40],
            lsa_48[index_40], 0) - StringFind(asa_0[index_28][index_40], lsa_44[index_40], 0) - StringLen(lsa_44[index_40]));
      }
   }
   return (li_ret_36);
}
// 8E314AF1224715F50B4B50AFD86BF84B
string f0_33(string as_0, string as_8) {
   int li_16 = StringFind(as_0, "-");
   int li_20 = StringFind(as_0, "-", li_16 + 1);
   string ls_24 = StringSubstr(as_0, 0, 2);
   string ls_32 = StringSubstr(as_0, 3, 2);
   string ls_40 = StringSubstr(as_0, 6, 4);
   int li_48 = StringFind(as_8, ":");
   string ls_52 = StringSubstr(as_8, 0, li_48);
   string ls_60 = StringSubstr(as_8, li_48 + 1, 2);
   string ls_68 = StringSubstr(as_8, StringLen(as_8) - 2);
   int li_76 = StrToInteger(ls_52);
   if (ls_68 == "pm" || ls_68 == "PM" && li_76 != 12) li_76 += 12;
   if (ls_68 == "am" || ls_68 == "AM" && li_76 == 12) li_76 = 0;
   string ls_80 = "";
   if (li_76 < 10) ls_80 = "0";
   return (StringConcatenate(ls_40, ".", ls_24, ".", ls_32, " ", ls_80, li_76, ":", ls_60));
}
// 4864ACE23EC515B781F1C4EDFCBB6662
int f0_17(int ai_0, double ad_4, double ad_12) {
   int str2time_28 = StrToTime(TimeToStr(TimeCurrent() + 86400, TIME_DATE));
   double ld_20 = 100.0 * ((f0_38(ai_0) + AccountProfit()) / ad_12);
   if (ld_20 >= ad_4) return (0);
   return (1);
}
// C4D7AD5B26978883A5C094C2913FA519
void f0_42(int ai_0, int ai_4, double ad_8) {
   double ld_16;
   string dbl2str_24;
   ObjectCreate("percent", OBJ_LABEL, 0, 0, 0);
   ObjectSet("percent", OBJPROP_CORNER, 1);
   ObjectSet("percent", OBJPROP_COLOR, White);
   ObjectSet("percent", OBJPROP_XDISTANCE, 20);
   ObjectSet("percent", OBJPROP_YDISTANCE, g_y_1668 + 30);
   ObjectCreate("start_p", OBJ_LABEL, 0, 0, 0);
   ObjectSet("start_p", OBJPROP_CORNER, 1);
   ObjectSet("start_p", OBJPROP_COLOR, White);
   ObjectSet("start_p", OBJPROP_XDISTANCE, 20);
   ObjectSet("start_p", OBJPROP_YDISTANCE, g_y_1668 + 50);
   ObjectSetText("start_p", "?虫竒筁?丁?" + DoubleToStr((TimeCurrent() - ai_0) / 60, 1) + " だ牧" + " ? " + OrdersTotal() + " 虫计?初?", 10, "稬硁タ堵砰");
   if (ai_4 == 1) {
      ld_16 = 100.0 * ((f0_38(ai_0) + AccountProfit()) / ad_8);
      dbl2str_24 = DoubleToStr(ld_16, 2);
      GlobalVariableSet("display", ld_16);
      ObjectSetText("percent", "虫Ω莉??" + dbl2str_24 + "%" + " ? 癬﹍戈??" + DoubleToStr(ad_8, 2), 10, "稬硁タ堵砰");
      ld_16 = 100.0 * ((f0_38(StrToTime(TimeToStr(TimeCurrent(), TIME_DATE))) + AccountProfit()) / ad_8);
      dbl2str_24 = DoubleToStr(ld_16, 2);
      ObjectCreate("takepercent_day", OBJ_LABEL, 0, 0, 0);
      ObjectSet("takepercent_day", OBJPROP_CORNER, 1);
      ObjectSet("takepercent_day", OBJPROP_COLOR, White);
      ObjectSet("takepercent_day", OBJPROP_XDISTANCE, 20);
      ObjectSet("takepercent_day", OBJPROP_YDISTANCE, g_y_1668 + 70);
      ObjectSetText("takepercent_day", "さら莉?仓縩??" + dbl2str_24 + " ? 程?既?疊莲?" + DoubleToStr(GlobalVariableGet("MaxEquity"), 2) + " %", 10, "稬硁タ堵砰");
   }
   if (ai_4 == 0) {
      ld_16 = 100.0 * ((f0_38(StrToTime(TimeToStr(TimeCurrent(), TIME_DATE))) + AccountProfit()) / ad_8);
      dbl2str_24 = DoubleToStr(ld_16, 2);
      ObjectSetText("percent", "さら莉?仓縩??" + dbl2str_24 + "%" + " 程?既?疊莲?" + DoubleToStr(ad_8, 2), 10, "稬硁タ堵砰");
   }
}
// 97B33371DB9421BC085384C5CE31D77C
double f0_38(int ai_0) {
   double ld_ret_4 = 0;
   int hist_total_12 = OrdersHistoryTotal();
   for (int pos_16 = 0; pos_16 < hist_total_12; pos_16++) {
      if (OrderSelect(pos_16, SELECT_BY_POS, MODE_HISTORY)) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL)
            if (ai_0 < OrderCloseTime()) ld_ret_4 += OrderProfit() + OrderCommission() + OrderSwap();
      }
   }
   return (ld_ret_4);
}
// D47A0861910FEEF6BE2CEC004717B3C9
void f0_47(string as_0, string a_symbol_8, int ai_16, int ai_20) {
   int lia_28[];
   int li_32;
   double order_lots_36;
   if (f0_53(ai_16) != 0) {
      if (as_0 == "Del" && ai_20 == 0) {
         for (int order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE)
               if (OrderSymbol() == a_symbol_8 && OrderType() == OP_BUYSTOP && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) OrderDelete(OrderTicket());
         }
      }
      if (as_0 == "Del" && ai_20 == 1) {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE)
               if (OrderSymbol() == a_symbol_8 && OrderType() == OP_SELLSTOP && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) OrderDelete(OrderTicket());
         }
      }
      if (as_0 == "100%") {
         for (order_total_24 = 0; order_total_24 < OrdersTotal(); order_total_24++) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE) {
               if (OrderSymbol() == a_symbol_8 && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) {
                  ArrayResize(lia_28, li_32 + 1);
                  lia_28[li_32] = OrderTicket();
                  li_32++;
               }
            }
         }
         for (int li_52 = ArraySize(lia_28) - 1; li_52 >= 0; li_52--) {
            if (OrderSelect(lia_28[li_52], SELECT_BY_TICKET) == FALSE) Alert(Symbol() + " OrderSelect Error By Tickets");
            else {
               order_lots_36 = OrderLots();
               OrderClose(lia_28[li_52], order_lots_36, OrderClosePrice(), 2, Blue);
            }
         }
      }
      if (as_0 == "80%") {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE) {
               if (OrderSymbol() == a_symbol_8 && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) {
                  order_lots_36 = 0.8 * OrderLots();
                  OrderClose(OrderTicket(), order_lots_36, OrderClosePrice(), 2, Blue);
               }
            }
         }
      }
      if (as_0 == "50%") {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE) {
               if (OrderSymbol() == a_symbol_8 && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) {
                  order_lots_36 = OrderLots() / 2.0;
                  OrderClose(OrderTicket(), order_lots_36, OrderClosePrice(), 2, Blue);
               }
            }
         }
      }
      if (as_0 == "All") {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE)
               if (OrderMagicNumber() != 0) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 2, Blue);
         }
      }
      if (as_0 == "BUY" && ai_20 == 0) {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE)
               if (OrderType() == OP_BUY && OrderSymbol() == a_symbol_8 && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 2, Blue);
         }
      }
      if (as_0 == "SELL" && ai_20 == 1) {
         for (order_total_24 = OrdersTotal(); order_total_24 >= 0; order_total_24--) {
            if (OrderSelect(order_total_24, SELECT_BY_POS) != FALSE)
               if (OrderType() == OP_SELL && OrderSymbol() == a_symbol_8 && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 2, Blue);
         }
      }
   }
}
// EF641C74FE623419687DFCFECC92AB16
int f0_53(int ai_unused_0) {
   int count_4 = 0;
   for (int pos_8 = 0; pos_8 < OrdersTotal(); pos_8++) {
      OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144) count_4++;
   }
   return (count_4);
}
// 7F63A32E314A2B9A6A08BBE53A513CBE
bool f0_99(double ad_0, double ad_8) {
   if (AccountProfit() <= 0.0) {
      if (100.0 * (MathAbs(AccountProfit()) / ad_8) < ad_0) return (0);
      return (1);
   }
   return (0);
}
// 669B20CC54CEFA0FE6D45E9431CBCDDC
int f0_21(int ai_unused_0, int a_cmd_4) {
   int count_8 = 0;
   for (int pos_12 = 0; pos_12 < OrdersTotal(); pos_12++) {
      OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_644 || OrderMagicNumber() == g_magic_892 || OrderMagicNumber() == g_magic_1144 && OrderType() == a_cmd_4) count_8++;
   }
   return (count_8);
}
// 97685F9137FDBBEB255455D4B9A79D6E
bool f0_98(int ai_0, int ai_4) {
   bool li_ret_8 = FALSE;
   if (ai_4 == ai_0) li_ret_8 = TRUE;
   if (ai_4 < ai_0)
      if (TimeHour(TimeLocal()) >= ai_0 || TimeHour(TimeLocal()) < ai_4) li_ret_8 = TRUE;
   if (ai_4 > ai_0)
      if (TimeHour(TimeLocal()) >= ai_0 && TimeHour(TimeLocal()) < ai_4) li_ret_8 = TRUE;
   return (li_ret_8);
}
// FA85B2E8449171C4183D8293ECA41702
bool f0_55(int ai_0, int ai_4, int ai_8, int ai_12, string as_16) {
   bool li_ret_24 = FALSE;
   int day_of_week_28 = TimeDayOfWeek(TimeLocal());
   if ((day_of_week_28 == 1 && TimeHour(TimeLocal()) < ai_0) || (day_of_week_28 == StrToDouble(StringSubstr(as_16, StringLen(as_16) - 1, 1)) && TimeHour(TimeLocal()) >= ai_4) ||
      day_of_week_28 > StrToDouble(StringSubstr(as_16, StringLen(as_16) - 1, 1)) && Week15SW) li_ret_24 = FALSE;
   else {
      if (f0_98(ai_8, ai_12)) {
         if (StringFind(as_16, DoubleToStr(day_of_week_28, 0), 0) >= 0) li_ret_24 = TRUE;
         else li_ret_24 = FALSE;
      } else li_ret_24 = FALSE;
   }
   return (li_ret_24);
}
// EB956E00F6889849D619CAB8125837E9
void f0_51(string as_0) {
   int li_16;
   int li_8 = InternetAttemptConnect(0);
   if (li_8 != 0) {
      Print("礚呼隔硈钡");
      return;
   }
   int li_12 = InternetOpenA("", 0, "", "", 0);
   if (li_12 > 0) {
      li_16 = InternetConnectA(li_12, "219.85.201.155", 21, "mt4ftpro", "mt4R@F1", 1, 134217728, 0);
      if (FtpGetFileA(li_16, as_0, "./experts/files/" + as_0, "./experts/files/" + as_0, 0, -2147483647, 0) == 0) Print("Grab  " + as_0 + " Failed #");
      else Print("Grab  " + as_0 + " #OK");
      InternetCloseHandle(li_16);
      InternetCloseHandle(li_12);
   }
}
// C1D7A4ED8E13765E6728132B18F6AD38
void f0_41(int ai_0, int ai_4, double ad_8, int ai_16) {
   int file_20;
   int li_28 = (TimeCurrent() - ai_16) / 60;
   if (li_28 >= ai_0 && OrdersTotal() >= ai_4 && GlobalVariableGet("display") >= ad_8) {
      GlobalVariableSet("next_sw", 1);
      file_20 = FileOpen("IOLog.txt", FILE_CSV|FILE_WRITE|FILE_READ, ',');
      FileSeek(file_20, 0, SEEK_END);
      FileWrite(file_20, TimeToStr(TimeCurrent(), TIME_DATE|TIME_MINUTES), "Profit Close by CheckTimeIn");
      FileClose(file_20);
   }
}
// 74A54DEA1C1EB246E54F0BC96F461CD6
bool f0_25(int ai_0) {
   if (ai_0 == 2 || ai_0 == 4 || ai_0 == 0) {
      if (!(f0_13(g_magic_892, OP_BUY) > 0 && f0_13(g_magic_1144, OP_BUY) > 0)) return (TRUE);
      return (FALSE);
   }
   if (ai_0 == 3 || ai_0 == 5 || ai_0 == 1) {
      if (!(f0_13(g_magic_892, OP_SELL) > 0 && f0_13(g_magic_1144, OP_SELL) > 0)) return (TRUE);
      return (FALSE);
   }
   return (FALSE);
}
// 8A376DD6BEBBF2C679DF8BFE6EC20871
bool f0_31(int ai_0) {
   if (ai_0 == 2 || ai_0 == 4 || ai_0 == 0) {
      if (!(f0_13(g_magic_1144, OP_BUY) > 0 && f0_13(g_magic_644, OP_BUY) > 0)) return (TRUE);
      return (FALSE);
   }
   if (ai_0 == 3 || ai_0 == 5 || ai_0 == 1) {
      if (!(f0_13(g_magic_1144, OP_SELL) > 0 && f0_13(g_magic_644, OP_SELL) > 0)) return (TRUE);
      return (FALSE);
   }
   return (FALSE);
}
// 9CE8A3D8A54A135E2C44A6D4AC287E38
bool f0_39(int ai_0) {
   if (ai_0 == 2 || ai_0 == 4 || ai_0 == 0) {
      if (!(f0_13(g_magic_892, OP_BUY) > 0 && f0_13(g_magic_644, OP_BUY) > 0)) return (TRUE);
      return (FALSE);
   }
   if (ai_0 == 3 || ai_0 == 5 || ai_0 == 1) {
      if (!(f0_13(g_magic_892, OP_SELL) > 0 && f0_13(g_magic_644, OP_SELL) > 0)) return (TRUE);
      return (FALSE);
   }
   return (FALSE);
}
// 3D035513161D7F8D8007E37C81968456
int f0_13(int a_magic_0, int a_cmd_4) {
   int count_8 = 0;
   for (int pos_12 = 0; pos_12 < OrdersTotal(); pos_12++) {
      OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == a_magic_0 && OrderType() == a_cmd_4) count_8++;
   }
   return (count_8);
}
""
还没有人打赏,支持一下

评论|共 10 个

陈小熊

发表于 2015-9-6 09:45:00 | 显示全部楼层

你哪里不懂倒是说说啊。

财源_N4ooo

发表于 2017-3-20 00:22:50 | 显示全部楼层

这是什么ea?//

Ares

发表于 2017-3-20 21:48:13 | 显示全部楼层

....好覆雜.......

幸福猫猫

发表于 2020-6-9 12:36:48 | 显示全部楼层

沙发!沙发!

sqyjkqpp84

发表于 2020-6-26 15:30:48 | 显示全部楼层

前排支持下

汇晟

发表于 2020-7-8 19:48:19 | 显示全部楼层

谢谢楼主分享

一世牵挂

发表于 2020-8-14 16:14:07 | 显示全部楼层

帮你顶下哈!!

张哥yoq

发表于 2020-9-7 10:36:49 | 显示全部楼层

帮你顶下哈!!

qq26050713

发表于 2021-7-4 15:34:04 | 显示全部楼层

12下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则