Price Data Components
Orders Execution
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
RDB_Cash_Generator_v2a
/*
Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Main Flame Inc. "
#property link "http://www.365ea.com"
bool gi_76 = FALSE;
bool gi_80;
int gi_84 = 0;
string gs_88 = "kawase tarou";
string gs_96 = "tarou kawese";
string gs_104 = "Kawase Tarou";
string gs_112 = "Tarou Kawese";
string gs_120 = "";
string gs_128 = "";
string gs_136 = "";
int gi_144 = 0;
string gs_148 = "Cash_Generator_v2a";
extern int GMT_Broker = 3;
extern string End_Of_Symbol = "";
extern int Start_Hour_UC = 20;
extern int Stop_Hour_UC = 22;
extern int Stop_Hour_2_UC = 23;
extern int Start_Hour_UJ = 20;
extern int Stop_Hour_UJ = 21;
extern int Stop_Hour_2_UJ = 23;
extern int Start_Hour_EU = 21;
extern int Stop_Hour_EU = 22;
extern int Stop_Hour_2_EU = 23;
extern int Start_Hour_GU = 21;
extern int Stop_Hour_GU = 22;
extern int Stop_Hour_2_GU = 23;
int gi_216 = 45;
bool gi_220 = FALSE;
extern int Start_Days = 0;
extern int Stop_Days = 5;
bool gi_232 = FALSE;
extern bool Buy_Order = TRUE;
extern bool Sell_Order = TRUE;
bool gi_244 = FALSE;
bool gi_248 = FALSE;
double gd_252 = 0.0;
double gd_260 = 0.0;
double gd_268 = 0.0;
double gd_276 = 0.0;
extern bool LotsOptimized = TRUE;
bool gi_288 = TRUE;
int gi_292 = 0;
extern double Lots = 0.1;
extern double MaxLots = 0.0;
extern int Risk = 10;
extern int MaxTrades = 1;
int gi_unused_320 = 1;
int gi_324 = 1;
int gi_328 = 3;
extern bool Hidden_TP = TRUE;
extern bool Hidden_SL = TRUE;
extern bool Hide_ALL = FALSE;
extern bool ECN_Broker_Modify_Order = FALSE;
extern double StopLoss_UC = 65.0;
extern double StopLoss_UJ = 100.0;
extern double StopLoss_EU = 70.0;
extern double StopLoss_GU = 60.0;
extern double StopLoss_FAKE_UC = 75.0;
extern double StopLoss_FAKE_UJ = 105.0;
extern double StopLoss_FAKE_EU = 75.0;
extern double StopLoss_FAKE_GU = 65.0;
extern double TakeProfit_UC = 8.0;
extern double TakeProfit_UJ = 12.0;
extern double TakeProfit_EU = 9.0;
extern double TakeProfit_GU = 9.0;
extern double TakeProfit_FAKE_UC = 9.0;
extern double TakeProfit_FAKE_UJ = 14.0;
extern double TakeProfit_FAKE_EU = 10.0;
extern double TakeProfit_FAKE_GU = 10.0;
extern double PriceFromMid_UC = 3.0;
extern double PriceFromMid_UJ = 7.0;
extern double PriceFromMid_EU = 3.0;
extern double PriceFromMid_GU = 7.0;
extern double PriceFromLastOP_UC = 0.0;
extern double PriceFromLastOP_UJ = 0.0;
extern double PriceFromLastOP_EU = 0.0;
extern double PriceFromLastOP_GU = 0.0;
extern bool Multiple_Lot = TRUE;
extern bool Use_TrailingStop = TRUE;
extern int TrailingStop_UC = 7;
extern int TrailingStop_UJ = 11;
extern int TrailingStop_EU = 8;
extern int TrailingStop_GU = 8;
int gi_564 = 3;
extern double Slippage = 3.0;
extern double MaxSpread_UC = 5.0;
extern double MaxSpread_UJ = 4.0;
extern double MaxSpread_EU = 4.0;
extern double MaxSpread_GU = 5.0;
double gd_608 = 3.0;
int g_period_616 = 30;
int g_period_620 = 60;
int g_period_624 = 9;
extern int BBands_Period_UC = 9;
extern int BBands_Period_UJ = 23;
extern int BBands_Period_EU = 21;
extern int BBands_Period_GU = 34;
int gi_644 = 2;
bool gi_unused_648 = TRUE;
bool gi_652 = FALSE;
int gi_656 = 5;
int gi_660 = 8;
int gi_664 = 20;
int gi_668 = 60;
double gd_672 = 1.25;
double gd_unused_680 = 1.4;
bool gi_688 = TRUE;
int g_period_692 = 8;
extern int Envelope_Period_UC = 13;
extern int Envelope_Period_UJ = 44;
extern int Envelope_Period_EU = 36;
extern int Envelope_Period_GU = 54;
extern double Envelope_Deviation_UC = 0.08;
extern double Envelope_Deviation_UJ = 0.15;
extern double Envelope_Deviation_EU = 0.16;
extern double Envelope_Deviation_GU = 0.12;
double g_deviation_744 = 0.05;
int g_period_752 = 8;
int gi_756 = 2;
extern int Range_M15_Bars_UC = 6;
extern int Range_M15_Bars_UJ = 17;
extern int Range_M15_Bars_EU = 17;
extern int Range_M15_Bars_GU = 15;
extern bool Time_Protection = TRUE;
extern int LimitTime_0_UC = 20;
extern int LimitTime_0_UJ = 20;
extern int LimitTime_0_EU = 11;
extern int LimitTime_0_GU = 10;
extern int LimitTime_1_UC = 30;
extern int LimitTime_1_UJ = 30;
extern int LimitTime_1_EU = 25;
extern int LimitTime_1_GU = 30;
extern int LimitTime_2_UC = 60;
extern int LimitTime_2_UJ = 60;
extern int LimitTime_2_EU = 55;
extern int LimitTime_2_GU = 60;
extern int LimitTime_3_UC = 90;
extern int LimitTime_3_UJ = 120;
extern int LimitTime_3_EU = 85;
extern int LimitTime_3_GU = 90;
extern int LimitTime_4_UC = 120;
extern int LimitTime_4_UJ = 240;
extern int LimitTime_4_EU = 115;
extern int LimitTime_4_GU = 120;
extern double pips_0_UC = 7.0;
extern double pips_0_UJ = 5.0;
extern double pips_0_EU = 9.0;
extern double pips_0_GU = 7.0;
extern double pips_1_UC = 7.0;
extern double pips_1_UJ = 9.0;
extern double pips_1_EU = 8.0;
extern double pips_1_GU = 7.0;
extern double pips_2_UC = 5.0;
extern double pips_2_UJ = 6.0;
extern double pips_2_EU = 6.0;
extern double pips_2_GU = 8.0;
extern double pips_3_UC = 3.0;
extern double pips_3_UJ = 2.0;
extern double pips_3_EU = 3.0;
extern double pips_3_GU = 3.0;
extern double pips_4_UC = 1.0;
extern double pips_4_UJ = 1.0;
extern double pips_4_EU = 1.0;
extern double pips_4_GU = 1.0;
extern bool Sound_Alert = FALSE;
extern string BuySound = "ok1.wav";
extern string SellSound = "ok1.wav";
extern string CloseProfitSound = "excellent_a.wav";
extern string CloseLostSound = "oh_man.wav";
string gs_1056 = "365_CashG_v2a";
extern int MagicNumber1_UC = 888888880;
extern int MagicNumber1_UJ = 888888881;
extern int MagicNumber1_EU = 888888882;
extern int MagicNumber1_GU = 888888883;
extern int MagicNumber2_UC = 333333330;
extern int MagicNumber2_UJ = 333333331;
extern int MagicNumber2_EU = 333333332;
extern int MagicNumber2_GU = 333333333;
double gd_1096;
int gi_unused_1104 = 0;
int gi_unused_1108 = 0;
int gi_unused_1112 = 0;
int gi_unused_1116 = 0;
int gi_unused_1120 = 0;
int gi_unused_1124 = 0;
int gi_unused_1128 = 0;
int gi_unused_1132 = 0;
int gi_unused_1136 = 0;
int gi_unused_1140 = 0;
int gi_unused_1144 = 0;
int gi_unused_1148 = 0;
int gi_unused_1152 = 0;
int gi_unused_1156 = 0;
int gi_unused_1160 = 0;
double gd_unused_1164 = 0.0;
double gd_unused_1172 = 0.0;
double gd_unused_1180 = 0.0;
double gd_unused_1188 = 0.0;
double gd_unused_1196 = 0.0;
double gd_unused_1204 = 0.0;
double gd_unused_1212 = 0.0;
double gd_unused_1220 = 0.0;
double gd_unused_1228 = 0.0;
double gd_unused_1236 = 0.0;
int gi_unused_1244 = 0;
double gd_unused_1248 = 0.0;
double gd_unused_1256 = 0.0;
double gd_unused_1264 = 0.0;
double gd_unused_1272 = 0.0;
double gd_unused_1280 = 0.0;
double gd_unused_1288 = 0.0;
int gi_unused_1296 = 0;
int gi_unused_1300 = 0;
double gd_unused_1368 = 0.0;
double gd_unused_1376 = 0.0;
double gd_unused_1384 = 0.0;
double gd_1392 = 0.0;
double gd_unused_1400 = 0.0;
double gd_unused_1408 = 0.0;
double gd_unused_1416 = 0.0;
double gd_unused_1424 = 0.0;
double gd_unused_1472 = 0.0;
double gd_unused_1480 = 0.0;
double gd_unused_1488 = 0.0;
double gd_unused_1496 = 0.0;
string gs_1504 = "CloseOrderProfit_Buy";
string gs_1512 = "CloseOrderProfit_Sell";
string gs_1520 = "CloseEquityTinggi";
string gs_1528 = "CloseEquityRendah";
string gs_1536 = "LastBalance";
string gs_unused_1544 = "VisualLastBalance";
string gs_unused_1552 = "LotEA";
string gs_unused_1560 = "VisualLotEA";
string gs_1568 = "close Buy need";
string gs_1576 = "close Sell need";
string gs_1584 = "buy order openprice";
string gs_1592 = "sell order openprice";
string gs_1600 = "Open Time Current Buy";
string gs_1608 = "Open Time Current Sell";
string gs_1616 = "Close Time Current Buy";
string gs_1624 = "Close Time Current Sell";
string gs_1632 = "Close Time Buy";
string gs_1640 = "Close Time Sell";
string gs_loss_buy_1648 = "Loss Buy";
string gs_1656 = "Loss Sell";
string gs_sl_true_1664 = "SL True";
string gs_1672 = "BuySymbolProfit";
string gs_1680 = "SellSymbolProfit";
string gs_1688 = "SignalBuy";
string gs_1696 = "SignalSell";
string gs_1704 = "NextBuy_1UC";
string gs_1712 = "NextSell_1UC";
string gs_1720 = "NextBuy_2UC";
string gs_1728 = "NextSell_2UC";
string gs_1736 = "NextBuy_1UJ";
string gs_1744 = "NextSell_1UJ";
string gs_1752 = "NextBuy_2UJ";
string gs_1760 = "NextSell_2UJ";
string gs_1768 = "NextBuy_1EU";
string gs_1776 = "NextSell_1EU";
string gs_1784 = "NextBuy_2EU";
string gs_1792 = "NextSell_2EU";
string gs_1800 = "NextBuy_1GU";
string gs_1808 = "NextSell_1GU";
string gs_1816 = "NextBuy_2GU";
string gs_1824 = "NextSell_2GU";
int g_global_var_1832 = 0;
int g_global_var_1836 = 0;
int g_global_var_1840 = 0;
int g_global_var_1844 = 0;
int gi_unused_1848 = 0;
int gi_unused_1852 = 0;
int gi_unused_1856 = 0;
int gi_unused_1860 = 0;
int g_global_var_1864 = 0;
int g_global_var_1868 = 0;
int g_global_var_1872 = 0;
int g_global_var_1876 = 0;
double g_global_var_1880 = 0.0;
double g_global_var_1888 = 0.0;
int gi_1896 = 0;
int gi_1900 = 0;
int gi_1904 = 0;
int gi_1908 = 0;
int g_global_var_1912 = 0;
int g_global_var_1916 = 0;
int g_global_var_1920 = 0;
int g_global_var_1924 = 0;
int g_global_var_1928 = 0;
int g_global_var_1932 = 0;
int g_global_var_1936 = 0;
double gd_1940 = 0.0;
double gd_unused_1948 = 0.0;
double gd_unused_1956 = 0.0;
int g_pos_1964 = 0;
string g_symbol_1968;
string gs_dummy_1976;
int gi_unused_1984 = 0;
int gi_unused_1988 = 0;
int gi_unused_1992 = 0;
int gi_unused_1996 = 0;
int gi_unused_2000 = 0;
int gi_unused_2004 = 0;
int gi_unused_2008 = 0;
int gi_unused_2012 = 0;
int gi_unused_2016 = 0;
int gi_unused_2020 = 0;
int gi_unused_2024 = 0;
int gi_unused_2028 = 0;
double gd_unused_2032 = 0.0;
double gd_unused_2040 = 0.0;
double gd_unused_2048 = 0.0;
double gd_unused_2056 = 0.0;
double gd_unused_2064 = 0.0;
double gd_unused_2072 = 0.0;
double gd_unused_2080 = 0.0;
double gd_unused_2088 = 0.0;
double gd_unused_2096 = 0.0;
double gd_unused_2104 = 0.0;
double gd_unused_2112 = 0.0;
double gd_unused_2120 = 0.0;
int gi_2128;
int gi_2132;
int gi_2136;
int gi_2140;
int gi_2144;
int gi_2148;
int gi_2152;
int gi_2156;
int gi_2160;
int gi_2164;
int gi_2168;
int gi_2172;
int gi_2176;
int gi_2180;
int gi_2184;
int gi_2188;
int gi_2192;
int gi_2196;
int gi_2200;
int g_period_2204;
int g_period_2208;
int gi_2212;
int gi_2216;
int gi_2220;
int gi_2224;
int gi_2228;
int gi_2232;
int g_magic_2236;
int g_magic_2240;
double gd_2244;
double gd_2252;
double gd_2260;
double gd_2268;
double gd_2276;
double gd_2284;
double gd_2292;
double g_deviation_2300;
double gd_2308;
double gd_2316;
double gd_2324;
double gd_2332;
double gd_2340;
int gi_2348;
int gi_2352;
int gi_2356;
int gi_2360;
int gi_2364;
int gi_2368;
int gi_2372;
int gi_2376;
int gi_2380;
int gi_2384;
int gi_2388;
int gi_2392;
int gi_2396;
int gi_2400;
int gi_2404;
int gi_2408;
extern string Created_By = "Rahman_Dg_Beta";
bool gi_2420 = FALSE;
int gi_2424 = 5;
int gi_2428 = 40;
int gi_2432 = 10;
int gi_2436 = 94;
int gi_2440 = 40;
int gi_2444 = 5;
int gi_2448 = 8421504;
int gi_2452 = 32768;
int gi_2456 = 2237106;
int gi_2460 = 3;
int gi_2464 = -20;
int gi_2468 = 0;
int g_window_2472 = 0;
bool gi_unused_2476 = TRUE;
bool gi_unused_2480 = FALSE;
int gi_unused_2484 = 1644825;
bool gi_unused_2488 = FALSE;
int gi_unused_2492 = 1;
int gi_unused_2496 = 0;
int gi_unused_2500 = 0;
int gi_unused_2504 = 0;
int gi_unused_2508 = 5;
int gi_unused_2512 = 0;
int gi_unused_2516 = 0;
int gi_unused_2520 = 0;
bool gi_2524 = TRUE;
bool gi_unused_2528 = FALSE;
int g_corner_2532 = 1;
bool gi_2536 = TRUE;
string gs_unused_2540 = "Colors for Price";
int gi_2548 = 16748574;
int gi_2552 = 2763429;
int gi_2556 = 55295;
int gi_2560 = 12632256;
int gi_2564 = 12632256;
int gi_2568 = 12632256;
string gs_unused_2572 = "Colors for Data";
int g_color_2580 = DodgerBlue;
int gi_unused_2584 = 2763429;
int gi_unused_2588 = 14474460;
int gi_2592 = 14474460;
int gi_2596 = 14474460;
int gi_unused_2600 = 6908265;
bool gi_2604 = TRUE;
int gi_unused_2608 = 1;
double gd_2684;
double gd_2700;
string gs_dummy_2804;
string gs_dummy_2812;
string g_dbl2str_2820;
string g_dbl2str_2828;
string gs_unused_2836 = "";
string gs_unused_2844 = "";
string gs_unused_2852 = "";
string gs_dummy_2860;
string gs_unused_2868;
string gs_unused_2876 = "";
string gs_unused_2884 = "";
int gi_2892;
string gs_unused_2896 = "";
string gs_2904 = "";
string gs_unused_2912 = "";
string gs_unused_2920 = "";
string gs_unused_2928 = "";
string gs_2936 = "";
string gs_unused_2944 = "";
string gs_unused_2952 = "";
double g_ima_2960;
double gd_2968;
double gd_3000;
double gd_3008;
double gd_3016;
int gi_3112;
int gi_3124;
int gi_3128;
int gi_3152;
int gi_3156;
int gi_3160;
int gi_3164;
int gi_3168;
int gi_3172;
string g_dbl2str_3176 = "";
string gs_unused_3184 = "";
string gs_unused_3192 = "";
int gi_unused_3200 = 0;
int g_time_3204 = 0;
int gi_3208 = 0;
int gi_3212 = 0;
int init() {
string ls_unused_0;
string ls_unused_8;
bool li_16 = FALSE;
if (IsTradeAllowed()) ls_unused_0 = "Enabled";
else ls_unused_0 = "Disabled";
if (IsDemo()) ls_unused_8 = "Demo account";
else ls_unused_8 = "Live account";
if (IsDemo()) gi_80 = TRUE;
else gi_80 = FALSE;
/*
if (gi_84 == 0) {
if (AccountName() == gs_88) li_16 = TRUE;
if (AccountName() == gs_96) li_16 = TRUE;
if (AccountName() == gs_104) li_16 = TRUE;
if (AccountName() == gs_112) li_16 = TRUE;
if (AccountName() == gs_120) li_16 = TRUE;
if (AccountName() == gs_128) li_16 = TRUE;
if (AccountName() == gs_136 && AccountNumber() == gi_144) li_16 = TRUE;
if (li_16 == TRUE) gi_76 = TRUE;
}
*/
li_16 = TRUE;
gi_76 = TRUE;
if (gi_84 == 0)
if (gi_76 == FALSE) Alert("AccountError ", "Error:Account is not correct");
if (gi_84 == 2)
if (IsDemo() != TRUE) Alert("AccountError ", "Error:Account is Live Account");
if (Symbol() == "USDCHF" + End_Of_Symbol || Symbol() == "USDCHFm" || Symbol() == "USDCHFcx" || Symbol() == "USDCHF." || Symbol() == "USDCHFFXF" || Symbol() == "USDCHF") {
g_symbol_1968 = "USDCHF";
if (Start_Hour_UC == 0) gi_2152 = 24;
else gi_2152 = Start_Hour_UC;
gi_2140 = gi_2152 + GMT_Broker;
if (gi_2140 >= 24) gi_2128 = gi_2140 - 24;
else gi_2128 = gi_2140;
if (Stop_Hour_UC == 0) gi_2156 = 24;
else gi_2156 = Stop_Hour_UC;
gi_2144 = gi_2156 + GMT_Broker;
if (gi_2144 >= 24) gi_2132 = gi_2144 - 24;
else gi_2132 = gi_2144;
if (Stop_Hour_2_UC == 0) gi_2160 = 24;
else gi_2160 = Stop_Hour_2_UC;
gi_2148 = gi_2160 + GMT_Broker;
if (gi_2148 >= 24) gi_2136 = gi_2148 - 24;
else gi_2136 = gi_2148;
gd_2244 = StopLoss_UC;
gd_2252 = StopLoss_FAKE_UC;
gd_2260 = TakeProfit_UC;
gd_2268 = TakeProfit_FAKE_UC;
gd_2276 = PriceFromMid_UC;
gd_2284 = PriceFromLastOP_UC;
gd_2292 = TrailingStop_UC;
gi_2200 = MaxSpread_UC;
g_period_2204 = BBands_Period_UC;
g_period_2208 = Envelope_Period_UC;
g_deviation_2300 = Envelope_Deviation_UC;
gi_2212 = Range_M15_Bars_UC;
gi_2216 = LimitTime_0_UC;
gi_2220 = LimitTime_1_UC;
gi_2224 = LimitTime_2_UC;
gi_2228 = LimitTime_3_UC;
gi_2232 = LimitTime_4_UC;
gd_2308 = pips_0_UC;
gd_2316 = pips_1_UC;
gd_2324 = pips_2_UC;
gd_2332 = pips_3_UC;
gd_2340 = pips_4_UC;
g_magic_2236 = MagicNumber1_UC;
g_magic_2240 = MagicNumber2_UC;
} else {
if (Symbol() == "USDJPY" + End_Of_Symbol || Symbol() == "USDJPYm" || Symbol() == "USDJPYcx" || Symbol() == "USDJPY." || Symbol() == "USDJPYFXF" || Symbol() == "USDJPY") {
g_symbol_1968 = "USDJPY";
if (Start_Hour_UJ == 0) gi_2164 = 24;
else gi_2164 = Start_Hour_UJ;
gi_2140 = gi_2164 + GMT_Broker;
if (gi_2140 >= 24) gi_2128 = gi_2140 - 24;
else gi_2128 = gi_2140;
if (Stop_Hour_UJ == 0) gi_2168 = 24;
else gi_2168 = Stop_Hour_UJ;
gi_2144 = gi_2168 + GMT_Broker;
if (gi_2144 >= 24) gi_2132 = gi_2144 - 24;
else gi_2132 = gi_2144;
if (Stop_Hour_2_UJ == 0) gi_2172 = 24;
else gi_2172 = Stop_Hour_2_UJ;
gi_2148 = gi_2172 + GMT_Broker;
if (gi_2148 >= 24) gi_2136 = gi_2148 - 24;
else gi_2136 = gi_2148;
gd_2244 = StopLoss_UJ;
gd_2252 = StopLoss_FAKE_UJ;
gd_2260 = TakeProfit_UJ;
gd_2268 = TakeProfit_FAKE_UJ;
gd_2276 = PriceFromMid_UJ;
gd_2284 = PriceFromLastOP_UJ;
gd_2292 = TrailingStop_UJ;
gi_2200 = MaxSpread_UJ;
g_period_2204 = BBands_Period_UJ;
g_period_2208 = Envelope_Period_UJ;
g_deviation_2300 = Envelope_Deviation_UJ;
gi_2212 = Range_M15_Bars_UJ;
gi_2216 = LimitTime_0_UJ;
gi_2220 = LimitTime_1_UJ;
gi_2224 = LimitTime_2_UJ;
gi_2228 = LimitTime_3_UJ;
gi_2232 = LimitTime_4_UJ;
gd_2308 = pips_0_UJ;
gd_2316 = pips_1_UJ;
gd_2324 = pips_2_UJ;
gd_2332 = pips_3_UJ;
gd_2340 = pips_4_UJ;
g_magic_2236 = MagicNumber1_UJ;
g_magic_2240 = MagicNumber2_UJ;
} else {
if (Symbol() == "EURUSD" + End_Of_Symbol || Symbol() == "EURUSDm" || Symbol() == "EURUSDcx" || Symbol() == "EURUSD." || Symbol() == "EURUSDFXF" || Symbol() == "EURUSD") {
g_symbol_1968 = "EURUSD";
if (Start_Hour_EU == 0) gi_2176 = 24;
else gi_2176 = Start_Hour_EU;
gi_2140 = gi_2176 + GMT_Broker;
if (gi_2140 >= 24) gi_2128 = gi_2140 - 24;
else gi_2128 = gi_2140;
if (Stop_Hour_EU == 0) gi_2180 = 24;
else gi_2180 = Stop_Hour_EU;
gi_2144 = gi_2180 + GMT_Broker;
if (gi_2144 >= 24) gi_2132 = gi_2144 - 24;
else gi_2132 = gi_2144;
if (Stop_Hour_2_EU == 0) gi_2184 = 24;
else gi_2184 = Stop_Hour_2_EU;
gi_2148 = gi_2184 + GMT_Broker;
if (gi_2148 >= 24) gi_2136 = gi_2148 - 24;
else gi_2136 = gi_2148;
gd_2244 = StopLoss_EU;
gd_2252 = StopLoss_FAKE_EU;
gd_2260 = TakeProfit_EU;
gd_2268 = TakeProfit_FAKE_EU;
gd_2276 = PriceFromMid_EU;
gd_2284 = PriceFromLastOP_EU;
gd_2292 = TrailingStop_EU;
gi_2200 = MaxSpread_EU;
g_period_2204 = BBands_Period_EU;
g_period_2208 = Envelope_Period_EU;
g_deviation_2300 = Envelope_Deviation_EU;
gi_2212 = Range_M15_Bars_EU;
gi_2216 = LimitTime_0_EU;
gi_2220 = LimitTime_1_EU;
gi_2224 = LimitTime_2_EU;
gi_2228 = LimitTime_3_EU;
gi_2232 = LimitTime_4_EU;
gd_2308 = pips_0_EU;
gd_2316 = pips_1_EU;
gd_2324 = pips_2_EU;
gd_2332 = pips_3_EU;
gd_2340 = pips_4_EU;
g_magic_2236 = MagicNumber1_EU;
g_magic_2240 = MagicNumber2_EU;
} else {
if (Symbol() == "GBPUSD" + End_Of_Symbol || Symbol() == "GBPUSDm" || Symbol() == "GBPUSDcx" || Symbol() == "GBPUSD." || Symbol() == "GBPUSDFXF" || Symbol() == "GBPUSD") {
g_symbol_1968 = "GBPUSD";
if (Start_Hour_GU == 0) gi_2188 = 24;
else gi_2188 = Start_Hour_GU;
gi_2140 = gi_2188 + GMT_Broker;
if (gi_2140 >= 24) gi_2128 = gi_2140 - 24;
else gi_2128 = gi_2140;
if (Stop_Hour_GU == 0) gi_2192 = 24;
else gi_2192 = Stop_Hour_GU;
gi_2144 = gi_2192 + GMT_Broker;
if (gi_2144 >= 24) gi_2132 = gi_2144 - 24;
else gi_2132 = gi_2144;
if (Stop_Hour_2_GU == 0) gi_2196 = 24;
else gi_2196 = Stop_Hour_2_GU;
gi_2148 = gi_2196 + GMT_Broker;
if (gi_2148 >= 24) gi_2136 = gi_2148 - 24;
else gi_2136 = gi_2148;
gd_2244 = StopLoss_GU;
gd_2252 = StopLoss_FAKE_GU;
gd_2260 = TakeProfit_GU;
gd_2268 = TakeProfit_FAKE_GU;
gd_2276 = PriceFromMid_GU;
gd_2284 = PriceFromLastOP_GU;
gd_2292 = TrailingStop_GU;
gi_2200 = MaxSpread_GU;
g_period_2204 = BBands_Period_GU;
g_period_2208 = Envelope_Period_GU;
g_deviation_2300 = Envelope_Deviation_GU;
gi_2212 = Range_M15_Bars_GU;
gi_2216 = LimitTime_0_GU;
gi_2220 = LimitTime_1_GU;
gi_2224 = LimitTime_2_GU;
gi_2228 = LimitTime_3_GU;
gi_2232 = LimitTime_4_GU;
gd_2308 = pips_0_GU;
gd_2316 = pips_1_GU;
gd_2324 = pips_2_GU;
gd_2332 = pips_3_GU;
gd_2340 = pips_4_GU;
g_magic_2236 = MagicNumber1_GU;
g_magic_2240 = MagicNumber2_GU;
}
}
}
}
DeleteObjects();
return (0);
}
int deinit() {
DeleteObjects();
return (0);
}
int start() {
int l_datetime_0 = TimeCurrent();
int l_year_4 = TimeYear(l_datetime_0);
int l_month_8 = TimeMonth(l_datetime_0);
bool li_12 = FALSE;
/*
if (gi_84 == 0) {
if (AccountName() == gs_88) li_12 = TRUE;
if (AccountName() == gs_96) li_12 = TRUE;
if (AccountName() == gs_104) li_12 = TRUE;
if (AccountName() == gs_112) li_12 = TRUE;
if (AccountName() == gs_120) li_12 = TRUE;
if (AccountName() == gs_128) li_12 = TRUE;
if (AccountName() == gs_136 && AccountNumber() == gi_144) li_12 = TRUE;
if (li_12 == TRUE) gi_76 = TRUE;
}
*/
li_12 = TRUE;
gi_76 = TRUE;
if (gi_84 == 0)
if (gi_76 == FALSE) return;
if (l_year_4 >= 2100)
if (l_month_8 > 1) return;
if (gi_84 == 2)
if (gi_80 == FALSE) return;
if (IsTradeTime2() || OpensOrder_MN() > 0) {
g_global_var_1840 = GlobalVariableGet(gs_1520 + gs_148 + AccountNumber() + test_status());
g_global_var_1844 = GlobalVariableGet(gs_1528 + gs_148 + AccountNumber() + test_status());
gi_1904 = GlobalVariableGet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1908 = GlobalVariableGet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1896 = GlobalVariableGet(gs_1600 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1900 = GlobalVariableGet(gs_1608 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1832 = GlobalVariableGet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1912 = GlobalVariableGet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1920 = GlobalVariableGet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1928 = GlobalVariableGet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1864 = GlobalVariableGet(gs_1568 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1872 = GlobalVariableGet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1932 = GlobalVariableGet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1836 = GlobalVariableGet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1916 = GlobalVariableGet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1924 = GlobalVariableGet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1928 = GlobalVariableGet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1868 = GlobalVariableGet(gs_1576 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1876 = GlobalVariableGet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1936 = GlobalVariableGet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1880 = GlobalVariableGet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status());
g_global_var_1888 = GlobalVariableGet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status());
gd_1096 = NormalizeDouble(MaxTrades / 2, 2);
if (Risk > 100) {
Comment("\n\n\n Your Risk is to big my friend... the maximal risk for this EA is : Risk/MaxTrades must less than" + " : " + DoubleToStr(100, 0),
"\n\\ please change the Risk first to Lowest");
Print("Your Risk Setting is to big, Please Change to Lowest");
}
}
CheckVar();
myBalance();
if (OpensOrder_All() > 0) {
if (gd_268 > 0.0) {
if (TargetEquityTertinggi() > 0.0)
if (GetmyBalance() > 0.0 && TargetEquityTertinggi() >= GetmyBalance() && AccountEquity() > TargetEquityTertinggi()) GlobalVariableSet(gs_1520 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (OpensOrder_All() > 0) {
if (gd_276 > 0.0) {
if (TargetEquityTerendah() > 0.0)
if (GetmyBalance() > 0.0 && TargetEquityTerendah() <= GetmyBalance() && AccountEquity() < TargetEquityTerendah()) GlobalVariableSet(gs_1528 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (IsTradeTime2() && !IsTesting() || !IsOptimization()) Periksa_Bar();
HideTestIndicators(TRUE);
if (gi_232 == TRUE) {
Print("CloseAll_NOW Aktif, Order is CLOSED ");
PerintahCloseOrder(0);
PerintahCloseOrder(1);
}
if (Max_EquityStop() == 0 || Min_EquityStop() == 0) {
Print("Account Equity More Than TargetEquity ", gd_252);
PerintahCloseOrder(0);
PerintahCloseOrder(1);
}
if (Show_Comment() == 1 && !IsOptimization() && IsTradeTime2() || OpensOrder_All() > 0) my_Comment();
if (Show_Comment() == 1 && !IsTesting() && !IsOptimization()) {
my_Comment();
Indi_Hi_Lo();
Indi_PROFIT();
}
if (OpensOrder_All() == 0) {
GlobalVariableSet(gs_1520 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1528 + gs_148 + AccountNumber() + test_status(), 0);
}
if (TimeCurrent() < gi_1904) gi_1904 = GlobalVariableSet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
if (TimeCurrent() < gi_1908) gi_1908 = GlobalVariableSet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
if (TimeCurrent() < gi_1896) gi_1896 = GlobalVariableSet(gs_1600 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
if (TimeCurrent() < gi_1900) gi_1900 = GlobalVariableSet(gs_1608 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
if (OpensOrder_MN() == 0) {
GlobalVariableSet(gs_1568 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1576 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
}
if (Buy_OpensOrder_MN() == 0) {
GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), 99999);
GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
}
if (Sell_OpensOrder_MN() == 0) {
GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
}
if (Buy_OpensOrder_MN() > 0)
if (gi_248 == FALSE) Close_Lost(0);
if (Sell_OpensOrder_MN() > 0)
if (gi_248 == FALSE) Close_Lost(1);
if (Buy_OpensOrder_MN() > 0 && Buy_OpensOrder_MN() < 2) {
CloseOrderProfit(0);
CloseTimeProtect(0);
}
if (Sell_OpensOrder_MN() > 0 && Sell_OpensOrder_MN() < 2) {
CloseOrderProfit(1);
CloseTimeProtect(1);
}
if (Buy_OpensOrder_MN() > 1) CloseSymbolProfit(0);
if (Sell_OpensOrder_MN() > 1) CloseSymbolProfit(1);
if (OpensOrder_MN() > 0) {
if (Use_TrailingStop == TRUE) {
Sell_Modify_TS();
Buy_Modify_TS();
}
}
if (OpensOrder_MN() > 0) {
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == TRUE) {
Sell_Modify_SL();
Sell_Modify_TP();
Buy_Modify_SL();
Buy_Modify_TP();
}
}
if (g_global_var_1840 == 1) {
PerintahCloseOrder(0);
PerintahCloseOrder(1);
Print("CloseAll_Equity => P R O F I T :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
if (g_global_var_1844 == 1) {
PerintahCloseOrder(0);
PerintahCloseOrder(1);
Print("CloseAll_Equity => L O S T :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
if (OpensOrder_MN() > 0) {
if (g_global_var_1928 != 0 || g_global_var_1864 != 0 || g_global_var_1876 != 0 || g_global_var_1932 != 0) PerintahCloseOrderTicket(0);
if (g_global_var_1928 != 0 || g_global_var_1868 != 0 || g_global_var_1872 != 0 || g_global_var_1936 != 0) PerintahCloseOrderTicket(1);
if (g_global_var_1832 != 0 || g_global_var_1912 != 0 || g_global_var_1920 != 0) PerintahCloseOrderTicket_1(0);
if (g_global_var_1836 != 0 || g_global_var_1916 != 0 || g_global_var_1924 != 0) PerintahCloseOrderTicket_1(1);
}
if (Max_EquityStop() == 1 || Min_EquityStop() == 1 && g_global_var_1840 == 0 && g_global_var_1844 == 0) {
if (OpensOrder_MN() < MaxTrades && SpreadOK()) {
if (Risk <= 100 && MaxGap() == 1) {
if (g_symbol_1968 == "USDCHF") {
gi_2348 = GlobalVariableGet(gs_1704 + gs_148 + AccountNumber() + test_status());
gi_2352 = GlobalVariableGet(gs_1712 + gs_148 + AccountNumber() + test_status());
gi_2356 = GlobalVariableGet(gs_1720 + gs_148 + AccountNumber() + test_status());
gi_2360 = GlobalVariableGet(gs_1728 + gs_148 + AccountNumber() + test_status());
if (g_global_var_1876 == 0 && g_global_var_1872 == 0 && IsTradeTime() && NextOrderTime() && g_global_var_1876 == 0 && gi_2348 == 1 && gi_244 == FALSE && Buy_Order == TRUE &&
Buy_OpensOrder_MN() == 0) {
if (Range_BB8M15_OK() && MAinEnvelope() == 1 && BB_Envelope_SigBuy() == 1 && mySideway5() <= (-1.0 * gd_608)) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1704 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1712 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (g_global_var_1872 == 0 && g_global_var_1876 == 0 && IsTradeTime() && NextOrderTime() && g_global_var_1872 == 0 && gi_2352 == 1 && gi_244 == FALSE && Sell_Order == TRUE &&
Sell_OpensOrder_MN() == 0) {
if (Range_BB8M15_OK() && MAinEnvelope() == 1 && BB_Envelope_SigSell() == 1 && mySideway5() >= gd_608) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1704 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1712 + gs_148 + AccountNumber() + test_status(), 0);
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1704 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1712 + gs_148 + AccountNumber() + test_status(), 1);
}
if (IsTradeTime2() && NextOrderTime() && gi_2356 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() > 0 && Buy_OpensOrder_MN() < gd_1096) {
if (Range_BB8M15_OK() && PrFrLastOPSig(0) == 1 && mySideway5() <= (-1.0 * gd_608)) {
OpenOrderT2(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1720 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1728 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (IsTradeTime2() && NextOrderTime() && gi_2360 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() > 0 && Sell_OpensOrder_MN() < gd_1096) {
if (Range_BB8M15_OK() && PrFrLastOPSig(1) == 1 && mySideway5() >= gd_608) {
OpenOrderT2(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1720 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1728 + gs_148 + AccountNumber() + test_status(), 0);
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1720 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1728 + gs_148 + AccountNumber() + test_status(), 1);
}
} else {
if (g_symbol_1968 == "USDJPY") {
gi_2364 = GlobalVariableGet(gs_1736 + gs_148 + AccountNumber() + test_status());
gi_2368 = GlobalVariableGet(gs_1744 + gs_148 + AccountNumber() + test_status());
gi_2372 = GlobalVariableGet(gs_1752 + gs_148 + AccountNumber() + test_status());
gi_2376 = GlobalVariableGet(gs_1760 + gs_148 + AccountNumber() + test_status());
if (IsTradeTime() && g_global_var_1876 == 0 && gi_2364 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() == 0 && Bid < BB_MdM15() - PrFrMid() && idem_M5() <= 0.4) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(0) == 1 && mySideway5() <= (-1.0 * gd_608)) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1736 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1744 + gs_148 + AccountNumber() + test_status(), 1);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(1) == 1 && mySideway5() <= (-1.0 * gd_608) && Bid <= BB_Dn()) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1736 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1744 + gs_148 + AccountNumber() + test_status(), 1);
}
}
}
if (IsTradeTime() && g_global_var_1872 == 0 && gi_2368 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() == 0 && Bid > BB_MdM15() + PrFrMid() &&
idem_M5() >= 0.6) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(1) == 1 && mySideway5() >= gd_608) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1736 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1744 + gs_148 + AccountNumber() + test_status(), 0);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(0) == 1 && mySideway5() >= gd_608 && Bid >= BB_Up()) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1736 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1744 + gs_148 + AccountNumber() + test_status(), 0);
}
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1736 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1744 + gs_148 + AccountNumber() + test_status(), 1);
}
if (IsTradeTime2() && gi_2372 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() > 0 && Buy_OpensOrder_MN() < gd_1096 && Bid <= BB_Dn()) {
if (BB_Out_Envelope() == 1 && Bid < GetPriceEnvelope_Dn2() && Damiani_Filter() == 1 && PrFrLastOPSig(0) == 1 && mySideway5() <= (-1.0 * gd_608) && idem_M5() <= 0.4) {
OpenOrderT2(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1752 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1760 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (IsTradeTime2() && gi_2376 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() > 0 && Sell_OpensOrder_MN() < gd_1096 && Bid >= BB_Up()) {
if (BB_Out_Envelope() == 1 && Bid > GetPriceEnvelope_Up2() && Damiani_Filter() == 1 && PrFrLastOPSig(1) == 1 && mySideway5() >= gd_608 && idem_M5() >= 0.6) {
OpenOrderT2(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1752 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1760 + gs_148 + AccountNumber() + test_status(), 0);
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1752 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1760 + gs_148 + AccountNumber() + test_status(), 1);
}
} else {
if (g_symbol_1968 == "EURUSD") {
gi_2380 = GlobalVariableGet(gs_1768 + gs_148 + AccountNumber() + test_status());
gi_2384 = GlobalVariableGet(gs_1776 + gs_148 + AccountNumber() + test_status());
gi_2388 = GlobalVariableGet(gs_1784 + gs_148 + AccountNumber() + test_status());
gi_2392 = GlobalVariableGet(gs_1792 + gs_148 + AccountNumber() + test_status());
if (IsTradeTime() && g_global_var_1876 == 0 && gi_2380 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() == 0) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(0) == 1 && mySideway5() <= (-1.0 * gd_608) && Bid <= BB_Md() - PrFrMid() && idem() <= 0.2 && Bid <= BB_MdM15() - PrFrMid()) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1768 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1776 + gs_148 + AccountNumber() + test_status(), 1);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(1) == 1 && mySideway5() <= (-1.0 * gd_608) && Bid <= BB_Dn() && idem() <= 0.4 && Bid <= BB_MdM15()) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1768 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1776 + gs_148 + AccountNumber() + test_status(), 1);
}
}
}
if (IsTradeTime() && g_global_var_1872 == 0 && gi_2384 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() == 0) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(1) == 1 && mySideway5() >= gd_608 && Bid >= BB_Md() + PrFrMid() && idem() >= 0.8 && Bid >= BB_MdM15() + PrFrMid()) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1768 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1776 + gs_148 + AccountNumber() + test_status(), 0);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(0) == 1 && mySideway5() >= gd_608 && Bid >= BB_Up() && idem() >= 0.6 && Bid >= BB_MdM15()) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1768 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1776 + gs_148 + AccountNumber() + test_status(), 0);
}
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1768 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1776 + gs_148 + AccountNumber() + test_status(), 1);
}
if (IsTradeTime2() && gi_2388 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() > 0 && Buy_OpensOrder_MN() < gd_1096) {
if (BB_Out_Envelope() == 1 && Bid < GetPriceEnvelope_Dn2() && Damiani_Filter() == 1 && PrFrLastOPSig(0) == 1 && mySideway5() <= (-1.0 * gd_608)) {
OpenOrderT2(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1784 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1792 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (IsTradeTime2() && gi_2392 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() > 0 && Sell_OpensOrder_MN() < gd_1096) {
if (BB_Out_Envelope() == 1 && Bid > GetPriceEnvelope_Up2() && Damiani_Filter() == 1 && PrFrLastOPSig(1) == 1 && mySideway5() >= gd_608) {
OpenOrderT2(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1784 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1792 + gs_148 + AccountNumber() + test_status(), 0);
}
}
if (IsTradeTime2() && (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0)))) {
GlobalVariableSet(gs_1784 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1792 + gs_148 + AccountNumber() + test_status(), 1);
}
} else {
if (g_symbol_1968 == "GBPUSD") {
gi_2396 = GlobalVariableGet(gs_1800 + gs_148 + AccountNumber() + test_status());
gi_2400 = GlobalVariableGet(gs_1808 + gs_148 + AccountNumber() + test_status());
gi_2404 = GlobalVariableGet(gs_1816 + gs_148 + AccountNumber() + test_status());
gi_2408 = GlobalVariableGet(gs_1824 + gs_148 + AccountNumber() + test_status());
if (IsTradeTime() && g_global_var_1876 == 0 && gi_2396 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() == 0 && Range_BB() < Range_Envelope2() &&
Bid < BB_MdM15() - PrFrMid()) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(0) == 1 && mySideway5() <= (-1.0 * gd_608) && Bid <= BB_Md() - PrFrMid()) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1800 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1808 + gs_148 + AccountNumber() + test_status(), 1);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(1) == 1 && mySideway5() <= (-1.0 * gd_608) && Bid <= BB_Dn()) {
if (Sell_OpensOrder_MN() > 0) GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1800 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1808 + gs_148 + AccountNumber() + test_status(), 1);
}
}
}
if (IsTradeTime() && g_global_var_1872 == 0 && gi_2400 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() == 0 && Range_BB() < Range_Envelope2() &&
Bid > BB_MdM15() + PrFrMid()) {
if (Range_Hi_Lo() <= Range_Envelope2() && GetEnvelopeSig(1) == 1 && mySideway5() >= gd_608 && Bid >= BB_Md() + PrFrMid()) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1800 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1808 + gs_148 + AccountNumber() + test_status(), 0);
} else {
if (Range_Hi_Lo() <= Range_Envelope() && GetMidEnvelopeExit(0) == 1 && mySideway5() >= gd_608 && Bid >= BB_Up()) {
if (Buy_OpensOrder_MN() > 0) GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
OpenOrderT1(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1800 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1808 + gs_148 + AccountNumber() + test_status(), 0);
}
}
}
if (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0))) {
GlobalVariableSet(gs_1800 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1808 + gs_148 + AccountNumber() + test_status(), 1);
}
if (IsTradeTime2() && gi_2404 == 1 && gi_244 == FALSE && Buy_Order == TRUE && Buy_OpensOrder_MN() > 0 && Buy_OpensOrder_MN() < gd_1096) {
if (BB_Out_Envelope() == 1 && Bid < GetPriceEnvelope_Dn2() && Damiani_Filter() == 1 && PrFrLastOPSig(0) == 1 && mySideway5() <= (-1.0 * gd_608) && GetEnvelopeSig(0) == 1 &&
Bid <= BB_Dn()) {
OpenOrderT2(0);
NormalizeDouble(GlobalVariableSet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits)), Digits);
PlaySound(BuySound);
GlobalVariableSet(gs_1816 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1824 + gs_148 + AccountNumber() + test_status(), 1);
}
}
if (IsTradeTime2() && gi_2408 == 1 && gi_244 == FALSE && Sell_Order == TRUE && Sell_OpensOrder_MN() > 0 && Sell_OpensOrder_MN() < gd_1096) {
if (BB_Out_Envelope() == 1 && Bid > GetPriceEnvelope_Up2() && Damiani_Filter() == 1 && PrFrLastOPSig(1) == 1 && mySideway5() >= gd_608 && GetEnvelopeSig(1) == 1 &&
Bid >= BB_Up()) {
OpenOrderT2(1);
NormalizeDouble(GlobalVariableSet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits)), Digits);
PlaySound(SellSound);
GlobalVariableSet(gs_1816 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1824 + gs_148 + AccountNumber() + test_status(), 0);
}
}
if (mySideway5() < gd_608 / 2.0 && mySideway5() > (-1.0 * (gd_608 / 2.0))) {
GlobalVariableSet(gs_1816 + gs_148 + AccountNumber() + test_status(), 1);
GlobalVariableSet(gs_1824 + gs_148 + AccountNumber() + test_status(), 1);
}
}
}
}
}
}
}
}
return (0);
}
bool IsTradeTime() {
int li_0;
if (gi_2132 == 0 && TimeHour(TimeCurrent()) == 0) li_0 = 24;
else li_0 = gi_2132;
if (gi_220 == FALSE && DayOfWeek() < Start_Days) return (FALSE);
if (gi_220 == FALSE && gi_2128 < gi_2132 && DayOfWeek() == Start_Days && TimeHour(TimeCurrent()) < gi_2132) return (FALSE);
if (gi_220 == FALSE && gi_2128 > gi_2132 && DayOfWeek() == Start_Days && TimeHour(TimeCurrent()) < gi_2128) return (FALSE);
if (gi_220 == FALSE && gi_2128 < gi_2132 && DayOfWeek() >= Stop_Days && TimeHour(TimeCurrent()) > gi_2128 - 1) return (FALSE);
if (gi_220 == FALSE && gi_2128 > li_0 && DayOfWeek() >= Stop_Days && TimeHour(TimeCurrent()) > li_0 - 1) return (FALSE);
if (gi_220 == FALSE && gi_2128 < gi_2132 && TimeHour(TimeCurrent()) < gi_2128 || TimeHour(TimeCurrent()) > gi_2132) return (FALSE);
if (gi_220 == FALSE && gi_2128 > gi_2132 && gi_2132 != 0 && TimeHour(TimeCurrent()) < gi_2128 && TimeHour(TimeCurrent()) > gi_2132) return (FALSE);
if (gi_220 == FALSE && gi_2128 < gi_2132 && gi_2132 == 0 && TimeHour(TimeCurrent()) < gi_2128 && TimeHour(TimeCurrent()) > li_0) return (FALSE);
if (gi_220 == FALSE && gi_2128 > gi_2132 && gi_2132 == 0 && TimeHour(TimeCurrent()) < gi_2128 && TimeHour(TimeCurrent()) > li_0) return (FALSE);
if (gi_220 == FALSE && TimeHour(TimeCurrent()) == gi_2132 && TimeMinute(TimeCurrent()) >= gi_216) return (FALSE);
return (TRUE);
}
int IsTradeTime2() {
int li_0;
if (gi_2136 == 0 && TimeHour(TimeCurrent()) == 0) li_0 = 24;
else li_0 = gi_2136;
if (gi_220 == FALSE && DayOfWeek() < Start_Days) return (0);
if (gi_220 == FALSE && gi_2128 < gi_2136 && DayOfWeek() == Start_Days && TimeHour(TimeCurrent()) < gi_2136) return (0);
if (gi_220 == FALSE && gi_2128 > gi_2136 && DayOfWeek() == Start_Days && TimeHour(TimeCurrent()) < gi_2128) return (0);
if (gi_220 == FALSE && gi_2128 < gi_2136 && DayOfWeek() >= Stop_Days && TimeHour(TimeCurrent()) > gi_2128 - 1) return (0);
if (gi_220 == FALSE && gi_2128 > li_0 && DayOfWeek() >= Stop_Days && TimeHour(TimeCurrent()) > li_0 - 1) return (0);
if (gi_220 == FALSE && gi_2128 < gi_2136 && TimeHour(TimeCurrent()) < gi_2128 || TimeHour(TimeCurrent()) > gi_2136) return (0);
if (gi_220 == FALSE && gi_2128 > gi_2136 && gi_2136 != 0 && TimeHour(TimeCurrent()) < gi_2128 && TimeHour(TimeCurrent()) > gi_2136) return (0);
if (gi_220 == FALSE && gi_2128 > gi_2136 && gi_2136 == 0 && TimeHour(TimeCurrent()) < gi_2128 && TimeHour(TimeCurrent()) > li_0) return (0);
if (gi_220 == FALSE && TimeHour(TimeCurrent()) == gi_2136 && TimeMinute(TimeCurrent()) >= gi_216) return (0);
return (1);
}
int NextOrderTime() {
gi_1904 = GlobalVariableGet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1908 = GlobalVariableGet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1896 = GlobalVariableGet(gs_1600 + gs_148 + Symbol() + AccountNumber() + test_status());
gi_1900 = GlobalVariableGet(gs_1608 + gs_148 + Symbol() + AccountNumber() + test_status());
if (TimeCurrent() < gi_1904 + 60 * gi_324) return (0);
if (TimeCurrent() < gi_1908 + 60 * gi_324) return (0);
if (TimeCurrent() < gi_1896 + 60 * gi_324) return (0);
if (TimeCurrent() < gi_1900 + 60 * gi_324) return (0);
return (1);
}
int OpensOrder_MN() {
int l_count_0 = 0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240)
if (OrderType() == OP_BUY || OrderType() == OP_SELL) l_count_0++;
}
}
return (l_count_0);
}
int Buy_OpensOrder_MN() {
int l_count_0 = 0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240)
if (OrderType() == OP_BUY) l_count_0++;
}
}
return (l_count_0);
}
int Sell_OpensOrder_MN() {
int l_count_0 = 0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240)
if (OrderType() == OP_SELL) l_count_0++;
}
}
return (l_count_0);
}
int OpensOrder_All() {
int l_count_0 = 0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES))
if (OrderType() == OP_BUY || OrderType() == OP_SELL) l_count_0++;
}
return (l_count_0);
}
int SpreadOK() {
bool li_ret_0 = TRUE;
if (NormalizeDouble(MarketInfo(Symbol(), MODE_SPREAD), 2) > msprd_X()) li_ret_0 = FALSE;
return (li_ret_0);
}
double SetPoint() {
double ld_ret_0;
if (Digits == 5) ld_ret_0 = 0.00001;
else {
if (Digits == 3) ld_ret_0 = 0.001;
else {
if (Digits == 2) ld_ret_0 = 0.01;
else ld_ret_0 = 0.0001;
}
}
return (ld_ret_0);
}
int SetBroker() {
double ld_ret_0;
if (Digits == 5 || Digits == 3) ld_ret_0 = 10;
else ld_ret_0 = 1;
return (ld_ret_0);
}
int Show_Comment() {
if (IsOptimization()) return (0);
return (1);
}
string commenttrade() {
string ls_ret_0;
if (IsTradeTime()) ls_ret_0 = "T R A D E S E S S I O N";
else ls_ret_0 = "O u t O f S E S S I O N";
return (ls_ret_0);
}
void my_Comment() {
Comment("\n " + gs_148 + " ==>> " + g_symbol_1968,
"\n\n ", commenttrade(),
"\n *========================*",
"\n Broker Time = ", Hour() + " : " + Minute() + " : " + Seconds(),
"\n Time Star Trading = ", gi_2128,
"\n Time Stop Trading = ", gi_2132,
"\n *========================*",
"\n TPx = " + DoubleToStr(TP_X(), Digits),
"\n SLx = " + DoubleToStr(SL_X(), Digits),
"\n *========================*");
}
double Hi_M5_Range() {
double l_ihigh_0 = iHigh(Symbol(), PERIOD_M5, iHighest(Symbol(), PERIOD_M5, MODE_HIGH, gi_2212, 0));
return (l_ihigh_0);
}
double Lo_M5_Range() {
double l_ilow_0 = iLow(Symbol(), PERIOD_M5, iLowest(Symbol(), PERIOD_M5, MODE_LOW, gi_2212, 0));
return (l_ilow_0);
}
double Range_Hi_Lo() {
RefreshRates();
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
ld_8 = Hi_M5_Range();
ld_16 = Lo_M5_Range();
ld_ret_0 = ld_8 - ld_16;
return (ld_ret_0);
}
double MyLots() {
double ld_8;
double ld_ret_16;
double ld_48;
double l_lotsize_56 = MarketInfo(Symbol(), MODE_LOTSIZE);
double l_minlot_32 = MarketInfo(Symbol(), MODE_MINLOT);
double l_maxlot_40 = MarketInfo(Symbol(), MODE_MAXLOT);
double l_marginrequired_64 = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
double l_lotstep_72 = MarketInfo(Symbol(), MODE_LOTSTEP);
if (LotsOptimized == TRUE) ld_8 = NormalizeDouble(AccountFreeMargin() / l_marginrequired_64 * Risk / 100.0 / MaxTrades, GetLotDecimal());
else ld_8 = Lots;
if (ld_8 < l_minlot_32) ld_8 = l_minlot_32;
if (MaxLots > 0.0 && MaxLots < l_maxlot_40) ld_48 = MaxLots;
else ld_48 = l_maxlot_40;
if (ld_8 > ld_48) ld_8 = ld_48;
if (GetLotDecimal() == 1 && l_lotstep_72 != 0.1) ld_ret_16 = NormalizeDouble(ld_8, 0);
else ld_ret_16 = NormalizeDouble(ld_8, 1);
if (GetLotDecimal() == 2 && l_lotstep_72 != 0.01) ld_ret_16 = NormalizeDouble(ld_8, 1);
else ld_ret_16 = NormalizeDouble(ld_8, 2);
return (ld_ret_16);
}
int GetLotDecimal() {
int li_ret_0;
double ld_8 = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP), 2);
if (gi_288 == TRUE) {
if (ld_8 == 0.01 || ld_8 == 0.02 || ld_8 == 0.03 || ld_8 == 0.04 || ld_8 == 0.05 || ld_8 == 0.06 || ld_8 == 0.07 || ld_8 == 0.08 || ld_8 == 0.09) li_ret_0 = 2;
else {
if (ld_8 == 0.1 || ld_8 == 0.2 || ld_8 == 0.3 || ld_8 == 0.4 || ld_8 == 0.5 || ld_8 == 0.6 || ld_8 == 0.7 || ld_8 == 0.8 || ld_8 == 0.9) li_ret_0 = 1;
else {
if (ld_8 == 1.0 || ld_8 == 2.0 || ld_8 == 3.0 || ld_8 == 4.0 || ld_8 == 5.0 || ld_8 == 6.0 || ld_8 == 7.0 || ld_8 == 8.0 || ld_8 == 9.0) li_ret_0 = 0;
else li_ret_0 = 3;
}
}
} else li_ret_0 = gi_292;
return (li_ret_0);
}
double TickValue() {
double l_tickvalue_0 = MarketInfo(Symbol(), MODE_TICKVALUE);
return (l_tickvalue_0);
}
int Max_EquityStop() {
bool li_ret_0 = TRUE;
RefreshRates();
if (gd_252 != 0.0 && AccountEquity() >= gd_252) li_ret_0 = FALSE;
return (li_ret_0);
}
int Min_EquityStop() {
bool li_ret_0 = TRUE;
RefreshRates();
if (gd_260 != 0.0 && AccountEquity() <= gd_260) li_ret_0 = FALSE;
return (li_ret_0);
}
double GetTP_Buy() {
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (TP_Fake_X() <= ld_32) ld_8 = ld_32;
else ld_8 = TP_Fake_X();
if (TP_X() <= ld_32) ld_16 = ld_32;
else ld_16 = TP_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == FALSE) {
if (Hidden_TP == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_8;
else
if (Hidden_TP == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
double GetSL_Buy() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (SL_X() <= ld_32) ld_16 = ld_32;
else ld_16 = SL_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == FALSE) {
if (Hidden_SL == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) - SL_X_FAKE();
else
if (Hidden_SL == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) - ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
double GetTP_Sell() {
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (TP_Fake_X() <= ld_32) ld_8 = ld_32;
else ld_8 = TP_Fake_X();
if (TP_X() <= ld_32) ld_16 = ld_32;
else ld_16 = TP_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == FALSE) {
if (Hidden_TP == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_8;
else
if (Hidden_TP == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
double GetSL_Sell() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (SL_X() <= ld_32) ld_16 = ld_32;
else ld_16 = SL_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == FALSE) {
if (Hidden_SL == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) + SL_X_FAKE();
else
if (Hidden_SL == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) + ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
double GetTP_Buy_Mdf() {
double l_ord_open_price_24;
double ld_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
double ld_ret_32 = 0;
double ld_40 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_48 = (ld_40 + 3 * SetBroker()) * SetPoint();
if (TP_Fake_X() <= ld_48) ld_8 = ld_48;
else ld_8 = TP_Fake_X();
if (TP_X() <= ld_48) ld_16 = ld_48;
else ld_16 = TP_X();
for (int l_pos_56 = 0; l_pos_56 < OrdersTotal(); l_pos_56++) {
if (OrderSelect(l_pos_56, SELECT_BY_POS, MODE_TRADES))
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderTakeProfit() == 0.0) l_ord_open_price_24 = OrderOpenPrice();
}
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == TRUE) {
if (Hidden_TP == TRUE) ld_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_8;
else
if (Hidden_TP == FALSE) ld_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_16;
} else ld_0 = 0;
if (ld_0 != 0.0 && ld_0 <= l_ord_open_price_24) ld_ret_32 = l_ord_open_price_24 + ld_16;
else ld_ret_32 = ld_0;
return (ld_ret_32);
}
double GetSL_Buy_Mdf() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (SL_X() <= ld_32) ld_16 = ld_32;
else ld_16 = SL_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == TRUE) {
if (Hidden_SL == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) - SL_X_FAKE();
else
if (Hidden_SL == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) - ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
double GetTP_Sell_Mdf() {
double l_ord_open_price_24;
double ld_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
double ld_ret_32 = 0;
double ld_40 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_48 = (ld_40 + 3 * SetBroker()) * SetPoint();
if (TP_Fake_X() <= ld_48) ld_8 = ld_48;
else ld_8 = TP_Fake_X();
if (TP_X() <= ld_48) ld_16 = ld_48;
else ld_16 = TP_X();
for (int l_pos_56 = 0; l_pos_56 < OrdersTotal(); l_pos_56++) {
if (OrderSelect(l_pos_56, SELECT_BY_POS, MODE_TRADES))
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderTakeProfit() == 0.0) l_ord_open_price_24 = OrderOpenPrice();
}
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == TRUE) {
if (Hidden_TP == TRUE) ld_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_8;
else
if (Hidden_TP == FALSE) ld_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_16;
} else ld_0 = 0;
if (ld_0 != 0.0 && ld_0 >= l_ord_open_price_24) ld_ret_32 = l_ord_open_price_24 - ld_16;
else ld_ret_32 = ld_0;
return (ld_ret_32);
}
double GetSL_Sell_Mdf() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
double ld_16 = 0;
double ld_24 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_32 = (ld_24 + 3 * SetBroker()) * SetPoint();
if (SL_X() <= ld_32) ld_16 = ld_32;
else ld_16 = SL_X();
if (Hide_ALL == FALSE && ECN_Broker_Modify_Order == TRUE) {
if (Hidden_SL == TRUE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) + SL_X_FAKE();
else
if (Hidden_SL == FALSE) ld_ret_0 = NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) + ld_16;
} else ld_ret_0 = 0;
return (ld_ret_0);
}
void Sell_Modify_SL() {
double l_price_0 = 0;
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderStopLoss() == 0.0) {
RefreshRates();
if (GetSL_Sell_Mdf() <= OrderOpenPrice()) l_price_0 = OrderOpenPrice() + SL_X();
else l_price_0 = GetSL_Sell_Mdf();
OrderModify(OrderTicket(), OrderOpenPrice(), l_price_0, OrderTakeProfit(), 0, Orange);
Print("Sell_Modify_SL :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
void Sell_Modify_TP() {
double l_price_0 = 0;
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderTakeProfit() == 0.0) {
RefreshRates();
if (GetTP_Sell_Mdf() >= OrderOpenPrice()) l_price_0 = OrderOpenPrice() - TP_X();
else l_price_0 = GetTP_Sell_Mdf();
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), l_price_0, 0, Orange);
Print("Sell_Modify_TP :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
void Buy_Modify_SL() {
double l_price_0 = 0;
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderStopLoss() == 0.0) {
RefreshRates();
if (GetSL_Buy_Mdf() >= OrderOpenPrice()) l_price_0 = OrderOpenPrice() - SL_X();
else l_price_0 = GetSL_Buy_Mdf();
OrderModify(OrderTicket(), OrderOpenPrice(), l_price_0, OrderTakeProfit(), 0, Lime);
Print("Buy_Modify_SL :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
void Buy_Modify_TP() {
double l_price_0 = 0;
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderTakeProfit() == 0.0) {
RefreshRates();
if (GetTP_Buy_Mdf() <= OrderOpenPrice()) l_price_0 = OrderOpenPrice() + TP_X();
else l_price_0 = GetTP_Buy_Mdf();
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), l_price_0, 0, Lime);
Print("Buy_Modify_TP :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
double SL_X() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
ld_ret_0 = gd_2244 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double SL_X_FAKE() {
double ld_ret_0 = 0;
ld_ret_0 = gd_2252 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double TP_X() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
ld_ret_0 = gd_2260 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double TP_Fake_X() {
double ld_ret_0;
double ld_8 = NormalizeDouble(MarketInfo(Symbol(), MODE_STOPLEVEL), 0);
double ld_16 = (ld_8 + 3.0) * SetPoint();
if (gd_2268 * SetBroker() <= ld_16) ld_ret_0 = ld_16 * SetPoint();
else ld_ret_0 = gd_2268 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double Gap_X() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
ld_ret_0 = gi_564 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double slp_X() {
double ld_ret_0 = Slippage * SetBroker();
return (ld_ret_0);
}
double msprd_X() {
double ld_ret_0 = gi_2200 * SetBroker();
return (ld_ret_0);
}
double PrFrMid() {
double ld_ret_0 = gd_2276 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double PrFrLastOP() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
ld_ret_0 = gd_2284 * SetBroker() * SetPoint();
return (ld_ret_0);
}
double PrFrTrailing() {
double ld_ret_0 = 0;
double ld_unused_8 = 0;
ld_ret_0 = gd_2292 * SetBroker() * SetPoint();
return (ld_ret_0);
}
int PrFrLastOPSig(int ai_0) {
bool li_ret_4 = FALSE;
g_global_var_1880 = NormalizeDouble(GlobalVariableGet(gs_1584 + gs_148 + Symbol() + AccountNumber() + test_status()), Digits);
g_global_var_1888 = NormalizeDouble(GlobalVariableGet(gs_1592 + gs_148 + Symbol() + AccountNumber() + test_status()), Digits);
if (ai_0 == 0)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) <= g_global_var_1880 - PrFrLastOP()) li_ret_4 = TRUE;
if (ai_0 == 1)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) >= g_global_var_1888 + PrFrLastOP()) li_ret_4 = TRUE;
return (li_ret_4);
}
double BB_Up8M15() {
double l_ibands_0 = iBands(Symbol(), PERIOD_M15, g_period_752, gi_756, 0, PRICE_CLOSE, MODE_UPPER, 1);
return (l_ibands_0);
}
double BB_Dn8M15() {
double l_ibands_0 = iBands(Symbol(), PERIOD_M15, g_period_752, gi_756, 0, PRICE_CLOSE, MODE_LOWER, 1);
return (l_ibands_0);
}
double BB_Md8M15() {
double l_ima_0 = iMA(Symbol(), PERIOD_M15, g_period_752, 0, MODE_SMA, PRICE_CLOSE, 1);
return (l_ima_0);
}
double BB_MdM15() {
double l_ima_0;
l_ima_0 = iMA(Symbol(), PERIOD_M15, g_period_2204, 0, MODE_SMA, PRICE_CLOSE, 1);
return (l_ima_0);
}
double BB_Up() {
double l_ibands_0;
l_ibands_0 = iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_UPPER, 1);
return (l_ibands_0);
}
double BB_Dn() {
double l_ibands_0;
l_ibands_0 = iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_LOWER, 1);
return (l_ibands_0);
}
double BB_Md() {
double l_ima_0;
l_ima_0 = iMA(Symbol(), PERIOD_M5, g_period_2204, 0, MODE_SMA, PRICE_CLOSE, 1);
return (l_ima_0);
}
int BB_Out_Envelope() {
RefreshRates();
bool li_ret_0 = FALSE;
double ld_4 = 0;
double ld_12 = 0;
double ld_20 = 0;
double ld_28 = 0;
ld_4 = BB_Up();
ld_12 = BB_Dn();
ld_20 = GetPriceEnvelope_Up2();
ld_28 = GetPriceEnvelope_Dn2();
if (ld_4 > ld_20 && ld_12 < ld_28) li_ret_0 = TRUE;
return (li_ret_0);
}
double Range_BB() {
RefreshRates();
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
ld_8 = BB_Up();
ld_16 = BB_Dn();
ld_ret_0 = ld_8 - ld_16;
return (ld_ret_0);
}
double MA_0() {
double l_ima_0 = iMA(Symbol(), PERIOD_M15, 2, 0, MODE_SMA, PRICE_CLOSE, 0);
return (l_ima_0);
}
double MA_1() {
double l_ima_0 = iMA(Symbol(), PERIOD_M15, 2, 0, MODE_SMA, PRICE_CLOSE, 1);
return (l_ima_0);
}
double MA_2() {
double l_ima_0 = iMA(Symbol(), PERIOD_M15, 2, 0, MODE_SMA, PRICE_CLOSE, 2);
return (l_ima_0);
}
int Damiani_Filter() {
double l_icustom_0 = 0;
double l_icustom_8 = 0;
l_icustom_0 = iCustom(Symbol(), PERIOD_M30, "Damiani_Volt", gi_656, gi_660, gi_664, gi_668, gd_672, gi_688, 0.5, 0, 0);
l_icustom_8 = iCustom(Symbol(), PERIOD_M30, "Damiani_Volt", gi_656, gi_660, gi_664, gi_668, gd_672, gi_688, 0.5, 2, 0);
if (gi_652 == TRUE && l_icustom_0 < l_icustom_8) return (0);
return (1);
}
double GetPriceEnvelope_Up8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_UPPER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Dn8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_LOWER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Md8M15() {
RefreshRates();
double ld_ret_0 = GetPriceEnvelope_Up8M15() - (GetPriceEnvelope_Up8M15() - GetPriceEnvelope_Dn8M15()) / 2.0;
return (ld_ret_0);
}
double GetPriceEnvelope_Up8M15_2() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_744, MODE_UPPER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Dn8M15_2() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_744, MODE_LOWER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope0_Up8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_UPPER, 0);
return (l_ienvelopes_0);
}
double GetPriceEnvelope0_Dn8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_LOWER, 0);
return (l_ienvelopes_0);
}
double GetPriceEnvelope2_Up8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_UPPER, 2);
return (l_ienvelopes_0);
}
double GetPriceEnvelope2_Dn8M15() {
RefreshRates();
double l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_SMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_LOWER, 2);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Up() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M5, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_UPPER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Dn() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M5, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, g_deviation_2300, MODE_LOWER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Md() {
RefreshRates();
double ld_0 = 0;
double ld_8 = 0;
ld_0 = GetPriceEnvelope_Up();
ld_8 = Range_Envelope();
gd_1392 = 0;
gd_1392 = ld_0 - ld_8 / 2.0;
return (gd_1392);
}
double GetPriceEnvelope_Up2() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M5, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, 2.0 * g_deviation_2300, MODE_UPPER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_Dn2() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M5, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, 2.0 * g_deviation_2300, MODE_LOWER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_UpM15() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, 4.0 * g_deviation_2300, MODE_UPPER, 1);
return (l_ienvelopes_0);
}
double GetPriceEnvelope_DnM15() {
RefreshRates();
double l_ienvelopes_0 = 0;
l_ienvelopes_0 = iEnvelopes(Symbol(), PERIOD_M15, g_period_2208, MODE_LWMA, 0, PRICE_CLOSE, 4.0 * g_deviation_2300, MODE_LOWER, 1);
return (l_ienvelopes_0);
}
double Range_Envelope() {
RefreshRates();
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
ld_8 = GetPriceEnvelope_Up();
ld_16 = GetPriceEnvelope_Dn();
ld_ret_0 = ld_8 - ld_16;
return (ld_ret_0);
}
double Range_Envelope2() {
RefreshRates();
double ld_ret_0 = 0;
double ld_8 = 0;
double ld_16 = 0;
ld_8 = GetPriceEnvelope_Up2();
ld_16 = GetPriceEnvelope_Dn2();
ld_ret_0 = ld_8 - ld_16;
return (ld_ret_0);
}
int MAinEnvelope() {
RefreshRates();
if (MA_0() >= GetPriceEnvelope0_Up8M15()) return (0);
if (MA_0() <= GetPriceEnvelope0_Dn8M15()) return (0);
if (MA_1() >= GetPriceEnvelope_Up8M15()) return (0);
if (MA_1() <= GetPriceEnvelope_Dn8M15()) return (0);
if (MA_2() >= GetPriceEnvelope2_Up8M15()) return (0);
if (MA_2() <= GetPriceEnvelope2_Dn8M15()) return (0);
return (1);
}
int BB_Envelope_SigBuy() {
int l_spread_0 = MarketInfo(Symbol(), MODE_SPREAD);
if (Range_BB8M15() < 1.2 * Range_Envelope8M15())
if (Bid < GetPriceEnvelope_Dn8M15() && Bid < BB_Dn8M15() - PrFrMid() && BB_Up8M15() > GetPriceEnvelope_Md8M15()) return (1);
if (Range_BB8M15() > 1.2 * Range_Envelope8M15()) {
if ((BB_Dn8M15() < GetPriceEnvelope_Dn8M15() && Bid < GetPriceEnvelope_Dn8M15() && Bid < BB_Dn8M15() - PrFrMid() && BB_Up8M15() > GetPriceEnvelope_Md8M15()) || (BB_Dn8M15() < GetPriceEnvelope_Dn8M15() &&
Bid < GetPriceEnvelope_Dn8M15() && Bid < BB_Md8M15() - TP_X()) && BB_Up8M15() > GetPriceEnvelope_Md8M15()) return (1);
}
if (Range_BB8M15() < Range_Envelope8M15() && Range_BB8M15() >= 3 * l_spread_0 * Point)
if (BB_Dn8M15() > GetPriceEnvelope_Dn8M15() && Bid < GetPriceEnvelope_Dn8M15_2() && Bid < BB_Dn8M15() - PrFrMid() && BB_Up8M15() > GetPriceEnvelope_Md8M15()) return (1);
return (0);
}
int BB_Envelope_SigSell() {
int l_spread_0 = MarketInfo(Symbol(), MODE_SPREAD);
if (Range_BB8M15() < 1.2 * Range_Envelope8M15())
if (Bid > GetPriceEnvelope_Up8M15() && Bid > BB_Up8M15() + PrFrMid() && BB_Dn8M15() < GetPriceEnvelope_Md8M15()) return (1);
if (Range_BB8M15() > 1.2 * Range_Envelope8M15()) {
if ((BB_Up8M15() > GetPriceEnvelope_Up8M15() && Bid > GetPriceEnvelope_Up8M15() && Bid > BB_Up8M15() + PrFrMid() && BB_Dn8M15() < GetPriceEnvelope_Md8M15()) || (BB_Up8M15() > GetPriceEnvelope_Up8M15() &&
Bid > GetPriceEnvelope_Up8M15() && Bid > BB_Md8M15() + TP_X()) && BB_Dn8M15() < GetPriceEnvelope_Md8M15()) return (1);
}
if (Range_BB8M15() < Range_Envelope8M15() && Range_BB8M15() >= 3 * l_spread_0 * Point)
if (BB_Up8M15() < GetPriceEnvelope_Up8M15() && Bid > GetPriceEnvelope_Up8M15_2() && Bid > BB_Up8M15() + PrFrMid() && BB_Dn8M15() < GetPriceEnvelope_Md8M15()) return (1);
return (0);
}
double Range_BB8M15() {
RefreshRates();
double ld_ret_0 = 0;
ld_ret_0 = BB_Up8M15() - BB_Dn8M15();
return (ld_ret_0);
}
int Range_BB8M15_OK() {
RefreshRates();
if (Range_BB8M15() < Range_Envelope8M15_2()) return (0);
return (1);
}
double Range_Envelope8M15() {
RefreshRates();
double ld_ret_0 = 0;
ld_ret_0 = GetPriceEnvelope_Up8M15() - GetPriceEnvelope_Dn8M15();
return (ld_ret_0);
}
double Range_Envelope8M15_2() {
RefreshRates();
double ld_ret_0 = 0;
ld_ret_0 = GetPriceEnvelope_Up8M15_2() - GetPriceEnvelope_Dn8M15_2();
return (ld_ret_0);
}
int GetEnvelopeSig(int ai_0) {
RefreshRates();
bool li_ret_4 = FALSE;
double ld_8 = 0;
double ld_16 = 0;
ld_8 = GetPriceEnvelope_Up();
ld_16 = GetPriceEnvelope_Dn();
if (ai_0 == 0)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) < ld_16 && BB_Md() < ld_8 && BB_Md() > ld_16) li_ret_4 = TRUE;
if (ai_0 == 1)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) > ld_8 && BB_Md() < ld_8 && BB_Md() > ld_16) li_ret_4 = TRUE;
return (li_ret_4);
}
int GetMidEnvelopeExit(int ai_0) {
RefreshRates();
bool li_ret_4 = FALSE;
if (ai_0 == 0)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) >= GetPriceEnvelope_Md() + PrFrMid()) li_ret_4 = TRUE;
if (ai_0 == 1)
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) <= GetPriceEnvelope_Md()) li_ret_4 = TRUE;
return (li_ret_4);
}
int Bid_in_Envelope() {
RefreshRates();
bool li_ret_0 = FALSE;
double ld_unused_4 = 0;
double ld_unused_12 = 0;
double ld_20 = 0;
double ld_28 = 0;
ld_20 = GetPriceEnvelope_UpM15();
ld_28 = GetPriceEnvelope_DnM15();
if (Bid < ld_20 && Bid > ld_28) li_ret_0 = TRUE;
return (li_ret_0);
}
double idem() {
double l_idemarker_0;
l_idemarker_0 = iDeMarker(Symbol(), PERIOD_M15, g_period_692, 1);
return (l_idemarker_0);
}
double idem_M5() {
double l_idemarker_0;
l_idemarker_0 = iDeMarker(Symbol(), PERIOD_M5, g_period_692, 1);
return (l_idemarker_0);
}
int MaxGap() {
RefreshRates();
bool li_ret_0 = FALSE;
if (MathAbs(iClose(NULL, PERIOD_H4, 1) - iOpen(NULL, PERIOD_H4, 0)) <= Gap_X()) li_ret_0 = TRUE;
return (li_ret_0);
}
double mySideway1() {
double ld_0 = (iMACD(Symbol(), PERIOD_M1, g_period_616, g_period_620, g_period_624, PRICE_CLOSE, MODE_MAIN, 0) - iMACD(Symbol(), PERIOD_M1, g_period_616, g_period_620, g_period_624, PRICE_CLOSE, MODE_MAIN, 1)) / Point;
double ld_8 = (iBands(Symbol(), PERIOD_M1, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_UPPER, 0) - iBands(Symbol(), PERIOD_M1, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_LOWER, 0)) / Point;
double ld_ret_16 = ld_0 * ld_8;
return (ld_ret_16);
}
double mySideway1a() {
double ld_0 = (iMACD(Symbol(), PERIOD_M1, g_period_616, g_period_620, g_period_624, PRICE_CLOSE, MODE_MAIN, 2) - iMACD(Symbol(), PERIOD_M1, g_period_616, g_period_620, g_period_624, PRICE_CLOSE, MODE_MAIN, 3)) / Point;
double ld_8 = (iBands(Symbol(), PERIOD_M1, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_UPPER, 2) - iBands(Symbol(), PERIOD_M1, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_LOWER, 2)) / Point;
double ld_ret_16 = ld_0 * ld_8;
return (ld_ret_16);
}
double mySideway5() {
double ld_0 = (iMACD(Symbol(), PERIOD_M5, 15, 30, g_period_624, PRICE_CLOSE, MODE_MAIN, 0) - iMACD(Symbol(), PERIOD_M5, 15, 30, g_period_624, PRICE_CLOSE, MODE_MAIN, 1)) / Point;
double ld_8 = (iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_UPPER, 0) - iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_LOWER, 0)) / Point;
double ld_ret_16 = ld_0 * ld_8;
return (ld_ret_16);
}
double mySideway5a() {
double ld_0 = (iMACD(Symbol(), PERIOD_M5, 15, 30, g_period_624, PRICE_CLOSE, MODE_MAIN, 1) - iMACD(Symbol(), PERIOD_M5, 15, 30, g_period_624, PRICE_CLOSE, MODE_MAIN, 2)) / Point;
double ld_8 = (iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_UPPER, 1) - iBands(Symbol(), PERIOD_M5, g_period_2204, gi_644, 0, PRICE_CLOSE, MODE_LOWER, 1)) / Point;
double ld_ret_16 = ld_0 * ld_8;
return (ld_ret_16);
}
void Buy_Modify_TS() {
double ld_0 = 0;
double ld_8 = 0;
double l_stoplevel_16 = 0;
for (int l_pos_24 = 0; l_pos_24 < OrdersTotal(); l_pos_24++) {
if (OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES)) {
l_stoplevel_16 = MarketInfo(Symbol(), MODE_STOPLEVEL);
ld_8 = (l_stoplevel_16 + slp_X()) * SetPoint();
if (PrFrTrailing() < ld_8) ld_0 = ld_8;
else ld_0 = PrFrTrailing();
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2240) {
if (NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - OrderOpenPrice() >= ld_0) {
if (OrderStopLoss() < NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_0 || OrderStopLoss() == 0.0) {
RefreshRates();
OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits) - ld_0, OrderTakeProfit(), 0, Lime);
Print("Trailing_Buy_Modify :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
return;
}
}
}
}
}
}
void Sell_Modify_TS() {
double ld_0 = 0;
double ld_8 = 0;
double l_stoplevel_16 = 0;
for (int l_pos_24 = 0; l_pos_24 < OrdersTotal(); l_pos_24++) {
if (OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES)) {
l_stoplevel_16 = MarketInfo(Symbol(), MODE_STOPLEVEL);
ld_8 = (l_stoplevel_16 + slp_X()) * SetPoint();
if (PrFrTrailing() < ld_8) ld_0 = ld_8;
else ld_0 = PrFrTrailing();
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2240) {
if (OrderOpenPrice() - NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) > ld_0) {
if (OrderStopLoss() > NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_0 || OrderStopLoss() == 0.0) {
RefreshRates();
OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits) + ld_0, OrderTakeProfit(), 0, Orange);
Print("Trailing_Sell_Modify :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
int CloseTimeProtect(int ai_0) {
if (OpensOrder_All() > 0 && Time_Protection == TRUE) {
for (g_pos_1964 = 0; g_pos_1964 < OrdersTotal(); g_pos_1964++) {
if (OrderSelect(g_pos_1964, SELECT_BY_POS, MODE_TRADES)) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_2236) {
if (OrderStopLoss() <= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() < 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2308 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() <= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2220 && TimeCurrent() - OrderOpenTime() < 60 * gi_2224 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2316 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() <= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2224 && TimeCurrent() - OrderOpenTime() < 60 * gi_2228 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() <= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2228 && TimeCurrent() - OrderOpenTime() < 60 * gi_2232 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2332 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() <= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2232 && OrderProfit() >= TickValue() * OrderLots() * ((-gd_2340) * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_2236) {
if (OrderStopLoss() >= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() < 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2308 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() >= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2220 && TimeCurrent() - OrderOpenTime() < 60 * gi_2224 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2316 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() >= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2224 && TimeCurrent() - OrderOpenTime() < 60 * gi_2228 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() >= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2228 && TimeCurrent() - OrderOpenTime() < 60 * gi_2232 &&
OrderProfit() >= TickValue() * OrderLots() * (gd_2332 * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
if (OrderStopLoss() >= OrderOpenPrice() || OrderStopLoss() == 0.0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2232 && OrderProfit() >= TickValue() * OrderLots() * ((-gd_2340) * SetBroker())) {
RefreshRates();
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
Print("Close_TIME_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
return (0);
}
int CloseSymbolProfit(int ai_0) {
double ld_4 = 0;
double ld_12 = 0;
double ld_20 = 0;
double ld_28 = 0;
int l_spread_36 = MarketInfo(Symbol(), MODE_SPREAD);
for (int l_pos_40 = 0; l_pos_40 < OrdersTotal(); l_pos_40++) {
if (OrderSelect(l_pos_40, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() != Symbol()) break;
if (OrderSymbol() == Symbol()) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
ld_12 += OrderProfit();
ld_4 += OrderLots();
if (ld_12 >= TickValue() * ld_4 * (TP_X() / SetPoint()) && Bid >= BB_Md8M15()) {
RefreshRates();
GlobalVariableSet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
if (Sound_Alert == TRUE && g_time_3204 != Time[0]) {
g_time_3204 = Time[0];
PlaySound(CloseProfitSound);
}
Print("CloseSymbolProfit_Buy :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
} else {
if (OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * l_spread_36 && Bid >= BB_Md8M15()) {
GlobalVariableSet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && g_time_3204 != Time[0]) {
g_time_3204 = Time[0];
PlaySound(CloseProfitSound);
}
Print("CloseSymbolProfit_Buy :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
ld_28 += OrderProfit();
ld_20 += OrderLots();
if (ld_28 >= TickValue() * ld_20 * (TP_X() / SetPoint()) && Bid <= BB_Md8M15()) {
RefreshRates();
GlobalVariableSet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status(), 1);
if (Sound_Alert == TRUE && g_time_3204 != Time[0]) {
g_time_3204 = Time[0];
PlaySound(CloseProfitSound);
}
Print("CloseSymbolProfit_Sell :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
} else {
if (OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * l_spread_36 && Bid <= BB_Md8M15()) {
GlobalVariableSet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && g_time_3204 != Time[0]) {
g_time_3204 = Time[0];
PlaySound(CloseProfitSound);
}
Print("CloseSymbolProfit_Sell :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
return (0);
}
int CloseOrderProfit(int ai_0) {
int l_spread_4 = MarketInfo(Symbol(), MODE_SPREAD);
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() != Symbol()) break;
if (g_symbol_1968 == "USDCHF" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope8M15() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope8M15() / SetPoint()) && Bid >= BB_Up8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid >= GetPriceEnvelope_Md8M15() && Bid > BB_Up8M15() - l_spread_4 * Point ||
Bid >= BB_Md8M15() + l_spread_4 * Point) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && TimeCurrent() - OrderOpenTime() > 5400 && Bid >= GetPriceEnvelope_Up8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid > BB_Md8M15() + PrFrMid() && Bid >= GetPriceEnvelope_Up8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid > BB_Md8M15() && idem() > 0.9) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 && TimeCurrent() - OrderOpenTime() > 4500 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 &&
Bid > BB_Md8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= 0.0 && Bid > BB_Md8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid >= GetPriceEnvelope_Md8M15() &&
Bid > BB_Md8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_10 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() > TickValue() * OrderLots() * l_spread_4 && Bid >= GetPriceEnvelope_Md8M15() &&
Bid >= BB_Up8M15()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_11 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderType() == OP_SELL && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope8M15() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope8M15() / SetPoint()) && Bid <= BB_Dn8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid <= GetPriceEnvelope_Md8M15() && Bid < BB_Dn8M15() +
l_spread_4 * Point || Bid <= BB_Md8M15() - l_spread_4 * Point) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && TimeCurrent() - OrderOpenTime() > 5400 && Bid <= GetPriceEnvelope_Dn8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid < BB_Md8M15() - PrFrMid() && Bid <= GetPriceEnvelope_Dn8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid < BB_Md8M15() && idem() < 0.1) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 && TimeCurrent() - OrderOpenTime() > 4500 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 &&
Bid < BB_Md8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= 0.0 && Bid < BB_Md8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid <= GetPriceEnvelope_Md8M15() &&
Bid < BB_Md8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_10 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() > TickValue() * OrderLots() * l_spread_4 && Bid <= GetPriceEnvelope_Md8M15() &&
Bid <= BB_Dn8M15()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_11 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "USDJPY" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 3.0 / SetPoint()) && Bid >= BB_Up() && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() > 0.0 && Bid >= BB_Md() + PrFrMid() && GetMidEnvelopeExit(0) == 1 && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Up()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid >= BB_Md() && idem_M5() > 0.85) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 3.0 / SetPoint()) && Bid <= BB_Dn() && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() > 0.0 && Bid <= BB_Md() - PrFrMid() && GetMidEnvelopeExit(1) == 1 && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Dn()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid <= BB_Md() && idem_M5() < 0.15) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 && Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "EURUSD" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 4.0 / SetPoint()) && Bid >= BB_Up() && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() > 0.0 && Bid >= BB_Md() + PrFrMid() && GetMidEnvelopeExit(0) == 1 && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Up()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid >= BB_Md() && idem() > 0.85) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (DayOfWeek() == Stop_Days - 1 || IsTradeTime() == 0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 &&
Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 4.0 / SetPoint()) && Bid <= BB_Dn() && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() > 0.0 && Bid <= BB_Md() - PrFrMid() && GetMidEnvelopeExit(1) == 1 && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Dn()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() >= 0.0 && Bid <= BB_Md() && idem() < 0.15) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (DayOfWeek() == Stop_Days - 1 || IsTradeTime() == 0 && TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * l_spread_4 &&
Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "GBPUSD" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 3.0 / SetPoint()) &&
Bid >= BB_Up() && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() > 0.0 && Bid >= BB_Md() + PrFrMid() && GetMidEnvelopeExit(0) == 1 && Bid >= BB_MdM15() + PrFrMid()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= 0.0 && Bid >= BB_Md() && idem() > 0.85) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) &&
Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * (l_spread_4 * SetBroker()) && Bid >= BB_Md()) {
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Buy_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && TimeCurrent() - OrderOpenTime() > 60 * gi_324) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (TP_X() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / SetPoint())) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= TickValue() * OrderLots() * (Range_Envelope() / 3.0 / SetPoint()) &&
Bid <= BB_Dn() && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() > 0.0 && Bid <= BB_Md() - PrFrMid() && GetMidEnvelopeExit(1) == 1 && Bid <= BB_MdM15() - PrFrMid()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() >= 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && OrderProfit() >= 0.0 && Bid <= BB_Md() && idem() < 0.15) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && TimeCurrent() - OrderOpenTime() > 60 * gi_2216 && OrderProfit() >= TickValue() * OrderLots() * (gd_2324 * SetBroker()) &&
Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * (l_spread_4 * SetBroker()) && Bid <= BB_Md()) {
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3208 != Time[0]) {
gi_3208 = Time[0];
PlaySound(CloseProfitSound);
}
Print("Close_Profit_Sell_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return (0);
}
int Close_Lost(int ai_0) {
int l_spread_4 = MarketInfo(Symbol(), MODE_SPREAD);
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
if (OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() != Symbol()) break;
if (g_symbol_1968 == "USDCHF" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid >= BB_Up8M15())) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) &&
Bid >= BB_Up8M15())) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && TimeCurrent() - OrderOpenTime() > 4500 &&
OrderProfit() >= TickValue() * OrderLots() * ((-l_spread_4) * 2) && Bid > BB_Md8M15())) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Buy_OpensOrder_MN() < 2 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid >= GetPriceEnvelope_Up8M15())) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && IsTradeTime() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / SetPoint())) &&
Bid > BB_Md8M15() + PrFrMid()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Bid >= BB_Md8M15() && idem() > 0.9)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() <= 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-l_spread_4) &&
Bid >= GetPriceEnvelope_Md8M15() + PrFrMid() && Bid > BB_Md8M15() + PrFrMid()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() <= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid > GetPriceEnvelope_Md8M15() && Bid >= BB_Up8M15()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid <= BB_Dn8M15())) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / Point)) &&
Bid <= BB_Dn8M15())) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && TimeCurrent() - OrderOpenTime() > 4500 &&
OrderProfit() >= TickValue() * OrderLots() * ((-l_spread_4) * 2) && Bid < BB_Md8M15())) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Sell_OpensOrder_MN() < 2 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid <= GetPriceEnvelope_Dn8M15())) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (Range_BB8M15_OK() && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && IsTradeTime() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid < BB_Md8M15() - PrFrMid()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Bid <= BB_Md8M15() && idem() < 0.1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() <= 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-l_spread_4) &&
Bid <= GetPriceEnvelope_Md8M15() - PrFrMid() && Bid < BB_Md8M15() - PrFrMid()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_8 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && Range_BB8M15() <= Range_Envelope8M15() && OrderProfit() <= TickValue() * OrderLots() * (-(Range_Envelope8M15() / Point)) &&
Bid < GetPriceEnvelope_Md8M15() && Bid <= BB_Dn8M15()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_9 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "USDJPY" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
if (OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid >= BB_Md() && GetMidEnvelopeExit(0) == 1) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && Bid >= BB_Up() && Bid_in_Envelope() == 1) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid >= GetPriceEnvelope_Up()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() < 0.0 && OrderProfit() >= (TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && OrderProfit() < 0.0 &&
Bid >= BB_Md() + PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime2() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md() && idem_M5() > 0.9) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
if (OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid <= BB_Md() && GetMidEnvelopeExit(1) == 1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && Bid <= BB_Dn() && Bid_in_Envelope() == 1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid <= GetPriceEnvelope_Dn()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() < 0.0 && OrderProfit() >= (TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && OrderProfit() < 0.0 &&
Bid <= BB_Md() - PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime2() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md() && idem_M5() < 0.1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "EURUSD" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
if (OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid >= BB_Md() && GetMidEnvelopeExit(0) == 1) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && Bid >= BB_Up() && Bid_in_Envelope() == 1) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid >= GetPriceEnvelope_Up()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() >= (TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && OrderProfit() < 0.0 &&
Bid >= BB_Md() + PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime2() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md() && idem() > 0.9) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
if (OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid <= BB_Md() && GetMidEnvelopeExit(1) == 1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && Bid <= BB_Dn() && Bid_in_Envelope() == 1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid <= GetPriceEnvelope_Dn()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() >= (TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) && OrderProfit() < 0.0 &&
Bid <= BB_Md() - PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (IsTradeTime2() == 0 && OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderProfit() < 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md() && idem() < 0.1) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
} else {
if (g_symbol_1968 == "GBPUSD" && OrderSymbol() == g_symbol_1968) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid >= BB_Md() && GetMidEnvelopeExit(0) == 1)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) &&
Bid >= BB_Up() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Bid >= GetPriceEnvelope_Up())) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) &&
OrderProfit() < 0.0 && Bid >= BB_Md() + PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid >= BB_Md() &&
Bid >= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (OrderProfit() < 0.0 && Bid >= BB_Md() && Bid >= GetPriceEnvelope_Md() && idem() > 0.9)) {
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Buy_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL) {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / SetPoint()))) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_1 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (OrderProfit() < 0.0 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 3.0 / SetPoint())) && Bid <= BB_Md() && GetMidEnvelopeExit(1) == 1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_2 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && OrderProfit() <= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) &&
Bid <= BB_Dn() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_3 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240 && (OrderProfit() < 0.0 && Bid <= GetPriceEnvelope_Dn())) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_4 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (TimeCurrent() - OrderOpenTime() > 5400 && OrderProfit() >= TickValue() * OrderLots() * (-(SL_X() / 2.0 / SetPoint())) &&
OrderProfit() < 0.0 && Bid <= BB_Md() - PrFrMid() && Bid_in_Envelope() == 1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_5 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && IsTradeTime() == 0 && OrderProfit() >= TickValue() * OrderLots() * (-(Range_Envelope() / SetPoint())) && Bid <= BB_Md() &&
Bid <= GetPriceEnvelope_Md()) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_6 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
} else {
if (OrderMagicNumber() == g_magic_2236 && (OrderProfit() < 0.0 && Bid <= BB_Md() && Bid <= GetPriceEnvelope_Md() && idem() < 0.1)) {
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), OrderTicket());
if (Sound_Alert == TRUE && gi_3212 != Time[0]) {
gi_3212 = Time[0];
PlaySound(CloseLostSound);
}
Print("Close_Lost_Sell_7 :" + DoubleToStr(OrderClosePrice(), 4) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) + " Order Ticket : " +
DoubleToStr(OrderTicket(), 0));
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return (0);
}
void CheckVar() {
bool li_0 = FALSE;
gd_1940 = AccountBalance();
if (OpensOrder_All() > 0 && !GlobalVariableCheck(gs_1536 + gs_148 + AccountNumber() + test_status())) li_0 = TRUE;
if (li_0 == TRUE) GlobalVariableSet(gs_1536 + gs_148 + AccountNumber() + test_status(), gd_1940);
}
double myBalance() {
double l_datetime_4;
bool li_0 = FALSE;
gd_1940 = AccountBalance();
if (OpensOrder_All() == 0) li_0 = TRUE;
else li_0 = FALSE;
if (li_0 == TRUE) l_datetime_4 = GlobalVariableSet(gs_1536 + gs_148 + AccountNumber() + test_status(), gd_1940);
return (l_datetime_4);
}
double GetmyBalance() {
double l_global_var_0;
l_global_var_0 = GlobalVariableGet(gs_1536 + gs_148 + AccountNumber() + test_status());
return (l_global_var_0);
}
double TargetEquityTertinggi() {
double ld_ret_0 = 0;
if (GetmyBalance() > 0.0 && gd_268 > 0.0) ld_ret_0 = GetmyBalance() + GetmyBalance() * gd_268 / 100.0;
return (ld_ret_0);
}
double TargetEquityTerendah() {
double ld_ret_0 = 0;
if (GetmyBalance() > 0.0 && gd_276 > 0.0) ld_ret_0 = GetmyBalance() - GetmyBalance() * gd_276 / 100.0;
return (ld_ret_0);
}
string test_status() {
string ls_ret_0;
if (IsTesting()) ls_ret_0 = "IsTesting";
else {
if (IsOptimization()) ls_ret_0 = "IsOptimization";
else {
if (IsVisualMode()) ls_ret_0 = "IsVisualMode";
else {
if (IsDemo()) ls_ret_0 = "IsDemo";
else ls_ret_0 = "Live";
}
}
}
return (ls_ret_0);
}
int PerintahCloseOrder(int ai_0) {
bool l_ord_close_4 = FALSE;
int l_ticket_8 = 0;
double ld_unused_12 = 0;
int l_error_20 = 0;
int l_count_24 = 0;
for (int l_pos_28 = OrdersTotal() - 1; l_pos_28 >= 0; l_pos_28--) {
if (OrderSelect(l_pos_28, SELECT_BY_POS, MODE_TRADES)) {
if (ai_0 == 0) {
if (OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_24 = 0; l_count_24 < 10 * gi_328; l_count_24++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits), slp_X(), Green);
Print("PerintahCloseAllEquity_Buy :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_1520 + gs_148 + AccountNumber() + test_status())) g_global_var_1840 = GlobalVariableGet(gs_1520 + gs_148 + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1528 + gs_148 + AccountNumber() + test_status())) g_global_var_1844 = GlobalVariableGet(gs_1528 + gs_148 + AccountNumber() + test_status());
l_error_20 = GetLastError();
if (l_error_20 == 0/* NO_ERROR */ && OpensOrder_All() == 0) {
GlobalVariableSet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_1520 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1528 + gs_148 + AccountNumber() + test_status(), 0);
break;
}
Print("Errors Closing Order Sell by Equity :" + OrderSymbol() + DoubleToStr(OrderTicket(), 0));
if (l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 137/* BROKER_BUSY */ || l_error_20 == 146/* TRADE_CONTEXT_BUSY */ || l_error_20 == 136/* OFF_QUOTES */ || l_error_20 == 138/* REQUOTE */ ||
l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_20 == 4107/* INVALID_PRICE_PARAM */ || l_error_20 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
if (ai_0 == 1) {
if (OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_24 = 0; l_count_24 < 10 * gi_328; l_count_24++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits), slp_X(), Yellow);
Print("PerintahCloseAllEquity_Sell :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_1520 + gs_148 + AccountNumber() + test_status())) g_global_var_1840 = GlobalVariableGet(gs_1520 + gs_148 + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1528 + gs_148 + AccountNumber() + test_status())) g_global_var_1844 = GlobalVariableGet(gs_1528 + gs_148 + AccountNumber() + test_status());
l_error_20 = GetLastError();
if (l_error_20 == 0/* NO_ERROR */ && OpensOrder_All() == 0) {
GlobalVariableSet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_1520 + gs_148 + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1528 + gs_148 + AccountNumber() + test_status(), 0);
break;
}
Print("Errors Closing Order Sell by Equity :" + OrderSymbol() + DoubleToStr(OrderTicket(), 0));
if (l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 137/* BROKER_BUSY */ || l_error_20 == 146/* TRADE_CONTEXT_BUSY */ || l_error_20 == 136/* OFF_QUOTES */ || l_error_20 == 138/* REQUOTE */ ||
l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_20 == 4107/* INVALID_PRICE_PARAM */ || l_error_20 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
}
}
return (l_ord_close_4);
}
int PerintahCloseOrderTicket(int ai_0) {
bool l_ord_close_4 = FALSE;
int l_ticket_8 = 0;
double ld_unused_12 = 0;
int l_error_20 = 0;
int l_count_24 = 0;
for (int l_pos_28 = OrdersTotal() - 1; l_pos_28 >= 0; l_pos_28--) {
if (OrderSelect(l_pos_28, SELECT_BY_POS, MODE_TRADES)) {
if (ai_0 == 0) {
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_24 = 0; l_count_24 < 10 * gi_328; l_count_24++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits), slp_X(), Green);
Print("PerintahClose_T_Buy :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1928 = GlobalVariableGet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1568 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1864 = GlobalVariableGet(gs_1568 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1872 = GlobalVariableGet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1932 = GlobalVariableGet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status());
l_error_20 = GetLastError();
if (l_error_20 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1568 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1672 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
PlaySound("CONGRATS.WAV");
} else {
Print("Errors Closing BUY order :" + DoubleToStr(OrderTicket(), 0));
if (l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 137/* BROKER_BUSY */ || l_error_20 == 146/* TRADE_CONTEXT_BUSY */ || l_error_20 == 136/* OFF_QUOTES */ || l_error_20 == 138/* REQUOTE */ ||
l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_20 == 4107/* INVALID_PRICE_PARAM */ || l_error_20 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
}
if (ai_0 == 1) {
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_24 = 0; l_count_24 < 10 * gi_328; l_count_24++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits), slp_X(), Yellow);
Print("PerintahClose_T_Sell :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1928 = GlobalVariableGet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1576 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1868 = GlobalVariableGet(gs_1576 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1876 = GlobalVariableGet(gs_1696 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1936 = GlobalVariableGet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status());
l_error_20 = GetLastError();
if (l_error_20 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_sl_true_1664 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1576 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1688 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1680 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
PlaySound("CONGRATS.WAV");
break;
}
Print("Errors Closing SELL order :" + DoubleToStr(OrderTicket(), 0));
if (l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 137/* BROKER_BUSY */ || l_error_20 == 146/* TRADE_CONTEXT_BUSY */ || l_error_20 == 136/* OFF_QUOTES */ || l_error_20 == 138/* REQUOTE */ ||
l_error_20 == 4/* SERVER_BUSY */ || l_error_20 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_20 == 4107/* INVALID_PRICE_PARAM */ || l_error_20 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
}
}
return (l_ord_close_4);
}
int PerintahCloseOrderTicket_1(int ai_0) {
bool l_ord_close_4 = FALSE;
int l_ticket_8 = 0;
int l_error_12 = 0;
int l_count_16 = 0;
for (int l_pos_20 = OrdersTotal() - 1; l_pos_20 >= 0; l_pos_20--) {
if (OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES)) {
if (ai_0 == 0) {
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_16 = 0; l_count_16 < 10 * gi_328; l_count_16++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits), slp_X(), Green);
Print("PerintahClose_Ticket_1_Buy :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1832 = GlobalVariableGet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1912 = GlobalVariableGet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1920 = GlobalVariableGet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status());
l_error_12 = GetLastError();
if (l_error_12 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1616 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_1504 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1632 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_loss_buy_1648 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
PlaySound("CONGRATS.WAV");
break;
}
Print("Errors Closing BUY order :" + DoubleToStr(OrderTicket(), 0));
if (l_error_12 == 4/* SERVER_BUSY */ || l_error_12 == 137/* BROKER_BUSY */ || l_error_12 == 146/* TRADE_CONTEXT_BUSY */ || l_error_12 == 136/* OFF_QUOTES */ || l_error_12 == 138/* REQUOTE */ ||
l_error_12 == 4/* SERVER_BUSY */ || l_error_12 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_12 == 4107/* INVALID_PRICE_PARAM */ || l_error_12 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
if (ai_0 == 1) {
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ticket_8 = OrderTicket();
for (l_count_16 = 0; l_count_16 < 10 * gi_328; l_count_16++) {
RefreshRates();
if (OrderSelect(l_ticket_8, SELECT_BY_TICKET) && OrderMagicNumber() == g_magic_2236 || OrderMagicNumber() == g_magic_2240) {
l_ord_close_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits), slp_X(), Yellow);
Print("PerintahClose_Ticket_1_Sell :" + OrderSymbol() + DoubleToStr(OrderClosePrice(), Digits) + " Lots : " + DoubleToStr(OrderLots(), 2) + " Profit : $ " + DoubleToStr(OrderProfit(), 2) +
" Order Ticket : " + DoubleToStr(OrderTicket(), 0));
if (GlobalVariableCheck(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1836 = GlobalVariableGet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1916 = GlobalVariableGet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status());
if (GlobalVariableCheck(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status())) g_global_var_1924 = GlobalVariableGet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status());
l_error_12 = GetLastError();
if (l_error_12 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1624 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
GlobalVariableSet(gs_1512 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1640 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
GlobalVariableSet(gs_1656 + gs_148 + Symbol() + AccountNumber() + test_status(), 0);
PlaySound("CONGRATS.WAV");
break;
}
Print("Errors Closing SELL order :" + DoubleToStr(OrderTicket(), 0));
if (l_error_12 == 4/* SERVER_BUSY */ || l_error_12 == 137/* BROKER_BUSY */ || l_error_12 == 146/* TRADE_CONTEXT_BUSY */ || l_error_12 == 136/* OFF_QUOTES */ || l_error_12 == 138/* REQUOTE */ ||
l_error_12 == 4/* SERVER_BUSY */ || l_error_12 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_12 == 4107/* INVALID_PRICE_PARAM */ || l_error_12 == 4108/* INVALID_TICKET */) Sleep(2000);
}
}
}
}
}
}
return (l_ord_close_4);
}
int OpenOrderT1(int ai_0) {
int l_ticket_4 = 0;
int l_error_8 = 0;
int l_count_12 = 0;
if (ai_0 == 0) {
for (l_count_12 = 0; l_count_12 < 10 * gi_328; l_count_12++) {
RefreshRates();
l_ticket_4 = OrderSend(Symbol(), OP_BUY, MyLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits), slp_X(), GetSL_Buy(), GetTP_Buy(), gs_1056 + "_1 " + Symbol(), g_magic_2236, 0, Green);
if (AccountFreeMarginCheck(Symbol(), OP_BUY, MyLots()) <= 0.0 || GetLastError() == 134/* NOT_ENOUGH_MONEY */) Print("We have no money for Order OP_SELL, Reduce your Lots! Free Margin = ", AccountFreeMargin());
l_error_8 = GetLastError();
if (l_error_8 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1600 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
break;
}
if (!(l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 137/* BROKER_BUSY */ || l_error_8 == 146/* TRADE_CONTEXT_BUSY */ || l_error_8 == 136/* OFF_QUOTES */ || l_error_8 == 138/* REQUOTE */ ||
l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_8 == 4107/* INVALID_PRICE_PARAM */)) break;
}
}
if (ai_0 == 1) {
for (l_count_12 = 0; l_count_12 < 10 * gi_328; l_count_12++) {
RefreshRates();
l_ticket_4 = OrderSend(Symbol(), OP_SELL, MyLots(), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits), slp_X(), GetSL_Sell(), GetTP_Sell(), gs_1056 + "_1 " +
Symbol(), g_magic_2236, 0, Red);
if (AccountFreeMarginCheck(Symbol(), OP_BUY, MyLots()) <= 0.0 || GetLastError() == 134/* NOT_ENOUGH_MONEY */) Print("We have no money for Order OP_SELL, Reduce your Lots! Free Margin = ", AccountFreeMargin());
l_error_8 = GetLastError();
if (l_error_8 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1608 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
break;
}
if (!(l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 137/* BROKER_BUSY */ || l_error_8 == 146/* TRADE_CONTEXT_BUSY */ || l_error_8 == 136/* OFF_QUOTES */ || l_error_8 == 138/* REQUOTE */ ||
l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_8 == 4107/* INVALID_PRICE_PARAM */)) break;
}
}
return (l_ticket_4);
}
int OpenOrderT2(int ai_0) {
int l_ticket_4 = 0;
int l_error_8 = 0;
int l_count_12 = 0;
double ld_16 = 0;
double ld_24 = 0;
double l_maxlot_32 = MarketInfo(Symbol(), MODE_MAXLOT);
double l_minlot_40 = MarketInfo(Symbol(), MODE_MINLOT);
if (Multiple_Lot == TRUE) ld_16 = 2.0 * MyLots();
else ld_16 = MyLots();
if (ld_16 <= l_minlot_40) ld_24 = l_minlot_40;
else ld_24 = ld_16;
if (ld_16 >= l_maxlot_32) ld_24 = l_maxlot_32;
else ld_24 = ld_16;
if (ai_0 == 0) {
for (l_count_12 = 0; l_count_12 < gi_328; l_count_12++) {
RefreshRates();
l_ticket_4 = OrderSend(Symbol(), OP_BUY, NormalizeDouble(ld_24, GetLotDecimal()), NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), Digits), slp_X(), GetSL_Buy(), GetTP_Buy(), gs_1056 +
"_2 " + Symbol(), g_magic_2240, 0, Green);
if (AccountFreeMarginCheck(Symbol(), OP_BUY, ld_24) <= 0.0 || GetLastError() == 134/* NOT_ENOUGH_MONEY */) Print("We have no money for Order OP_SELL, Reduce your Lots! Free Margin = ", AccountFreeMargin());
l_error_8 = GetLastError();
if (l_error_8 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1600 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
break;
}
if (!(l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 137/* BROKER_BUSY */ || l_error_8 == 146/* TRADE_CONTEXT_BUSY */ || l_error_8 == 136/* OFF_QUOTES */ || l_error_8 == 138/* REQUOTE */ ||
l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_8 == 4107/* INVALID_PRICE_PARAM */)) break;
}
}
if (ai_0 == 1) {
for (l_count_12 = 0; l_count_12 < gi_328; l_count_12++) {
RefreshRates();
l_ticket_4 = OrderSend(Symbol(), OP_SELL, NormalizeDouble(ld_24, GetLotDecimal()), NormalizeDouble(MarketInfo(Symbol(), MODE_BID), Digits), slp_X(), GetSL_Sell(), GetTP_Sell(), gs_1056 +
"_2 " + Symbol(), g_magic_2240, 0, Red);
if (AccountFreeMarginCheck(Symbol(), OP_BUY, ld_24) <= 0.0 || GetLastError() == 134/* NOT_ENOUGH_MONEY */) Print("We have no money for Order OP_SELL, Reduce your Lots! Free Margin = ", AccountFreeMargin());
l_error_8 = GetLastError();
if (l_error_8 == 0/* NO_ERROR */) {
GlobalVariableSet(gs_1608 + gs_148 + Symbol() + AccountNumber() + test_status(), TimeCurrent());
break;
}
if (!(l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 137/* BROKER_BUSY */ || l_error_8 == 146/* TRADE_CONTEXT_BUSY */ || l_error_8 == 136/* OFF_QUOTES */ || l_error_8 == 138/* REQUOTE */ ||
l_error_8 == 4/* SERVER_BUSY */ || l_error_8 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_8 == 4107/* INVALID_PRICE_PARAM */)) break;
}
}
return (l_ticket_4);
}
void Indi_PROFIT() {
int li_unused_0;
int li_24;
int l_str2time_28;
int li_32;
int l_str2time_36;
double ld_40;
double ld_48;
double ld_56;
double ld_64;
double ld_72;
double ld_80;
double ld_88;
double ld_96;
double ld_104;
double ld_112;
double ld_120;
string ls_unused_128;
double ld_140;
double ld_148;
double ld_156;
double ld_164;
double ld_172;
double ld_180;
double ld_188;
double ld_196;
double ld_204;
double ld_212;
if (gi_2420 == TRUE) {
li_unused_0 = 7;
for (int li_4 = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE)); TimeDayOfWeek(li_4) < 1 || TimeDayOfWeek(li_4) > 5; li_4 -= 86400) {
}
for (int li_8 = li_4 - 86400; TimeDayOfWeek(li_8) < 1 || TimeDayOfWeek(li_8) > 5; li_8 -= 86400) {
}
for (int li_12 = li_8 - 86400; TimeDayOfWeek(li_12) < 1 || TimeDayOfWeek(li_12) > 5; li_12 -= 86400) {
}
for (int li_16 = li_12 - 86400; TimeDayOfWeek(li_16) < 1 || TimeDayOfWeek(li_16) > 5; li_16 -= 86400) {
}
for (int li_20 = li_16 - 86400; TimeDayOfWeek(li_20) < 1 || TimeDayOfWeek(li_20) > 5; li_20 -= 86400) {
}
li_24 = DateOfMonday();
l_str2time_28 = StrToTime(Year() + "." + Month() + ".01");
li_32 = DateBeginQuarter();
l_str2time_36 = StrToTime(Year() + ".01.01");
ld_40 = AccountBalance();
ld_48 = AccountProfit();
ld_56 = GetProfitFromDateInCurrency("", -1, -1, li_4);
ld_64 = GetProfitFromDateInCurrency("", -1, -1, li_8) - ld_56;
ld_72 = GetProfitFromDateInCurrency("", -1, -1, li_12) - ld_64 - ld_56;
ld_80 = GetProfitFromDateInCurrency("", -1, -1, li_16) - ld_72 - ld_64 - ld_56;
ld_88 = GetProfitFromDateInCurrency("", -1, -1, li_20) - ld_80 - ld_72 - ld_64 - ld_56;
ld_96 = GetProfitFromDateInCurrency("", -1, -1, li_24);
ld_104 = GetProfitFromDateInCurrency("", -1, -1, l_str2time_28);
ld_112 = GetProfitFromDateInCurrency("", -1, -1, li_32);
ld_120 = GetProfitFromDateInCurrency("", -1, -1, l_str2time_36);
switch (gi_2424) {
case 0:
ls_unused_128 = "current";
break;
case 1:
ld_40 -= ld_56;
ls_unused_128 = "on the beginning of the day";
break;
case 2:
ld_40 -= ld_96;
ls_unused_128 = "on the beginning of the week";
break;
case 3:
ld_40 -= ld_104;
ls_unused_128 = "ún the beginning of month";
break;
case 4:
ld_40 -= ld_112;
ls_unused_128 = "on the beginning of quarter";
break;
default:
ld_40 -= ld_120;
ls_unused_128 = "on the beginning of the year";
}
ld_140 = 100.0 * ld_48 / ld_40;
ld_148 = 100.0 * ld_56 / ld_40;
ld_156 = 100.0 * ld_64 / ld_40;
ld_164 = 100.0 * ld_72 / ld_40;
ld_172 = 100.0 * ld_80 / ld_40;
ld_180 = 100.0 * ld_88 / ld_40;
ld_188 = 100.0 * ld_96 / ld_40;
ld_196 = 100.0 * ld_104 / ld_40;
ld_204 = 100.0 * ld_112 / ld_40;
ld_212 = 100.0 * ld_120 / ld_40;
SetLabel("iProfit11", "Current Profit", gi_2448, gi_2436, gi_2428 + 9 * gi_2432, gi_2460);
SetLabel("iProfit21", "Profit for today", gi_2448, gi_2436, gi_2428 + gi_2432 << 3, gi_2460);
SetLabel("iProfit31", "Profit for " + TimeToStr(li_8, TIME_DATE), gi_2448, gi_2436, gi_2428 + 7 * gi_2432, gi_2460);
SetLabel("iProfit41", "Profit for " + TimeToStr(li_12, TIME_DATE), gi_2448, gi_2436, gi_2428 + 6 * gi_2432, gi_2460);
SetLabel("iProfit51", "Profit for " + TimeToStr(li_16, TIME_DATE), gi_2448, gi_2436, gi_2428 + 5 * gi_2432, gi_2460);
SetLabel("iProfit61", "Profit for " + TimeToStr(li_20, TIME_DATE), gi_2448, gi_2436, gi_2428 + gi_2432 << 2, gi_2460);
SetLabel("iProfit71", "Profit for a week", gi_2448, gi_2436, gi_2428 + 3 * gi_2432, gi_2460);
SetLabel("iProfit81", "Profit for month", gi_2448, gi_2436, gi_2428 + gi_2432 * 2, gi_2460);
SetLabel("iProfit91", "Profit for quarter", gi_2448, gi_2436, gi_2428 + gi_2432, gi_2460);
SetLabel("iProfit01", "Profit for the year", gi_2448, gi_2436, gi_2428, gi_2460);
SetLabel("iProfit12", DoubleToStr(ld_48, 1) + " =", ColorOnSign(ld_48), gi_2440, gi_2428 + 9 * gi_2432, gi_2460);
SetLabel("iProfit22", DoubleToStr(ld_56, 1) + " =", ColorOnSign(ld_56), gi_2440, gi_2428 + gi_2432 << 3, gi_2460);
SetLabel("iProfit32", DoubleToStr(ld_64, 1) + " =", ColorOnSign(ld_64), gi_2440, gi_2428 + 7 * gi_2432, gi_2460);
SetLabel("iProfit42", DoubleToStr(ld_72, 1) + " =", ColorOnSign(ld_72), gi_2440, gi_2428 + 6 * gi_2432, gi_2460);
SetLabel("iProfit52", DoubleToStr(ld_80, 1) + " =", ColorOnSign(ld_80), gi_2440, gi_2428 + 5 * gi_2432, gi_2460);
SetLabel("iProfit62", DoubleToStr(ld_88, 1) + " =", ColorOnSign(ld_88), gi_2440, gi_2428 + gi_2432 << 2, gi_2460);
SetLabel("iProfit72", DoubleToStr(ld_96, 1) + " =", ColorOnSign(ld_96), gi_2440, gi_2428 + 3 * gi_2432, gi_2460);
SetLabel("iProfit82", DoubleToStr(ld_104, 1) + " =", ColorOnSign(ld_104), gi_2440, gi_2428 + gi_2432 * 2, gi_2460);
SetLabel("iProfit92", DoubleToStr(ld_112, 1) + " =", ColorOnSign(ld_112), gi_2440, gi_2428 + gi_2432, gi_2460);
SetLabel("iProfit02", DoubleToStr(ld_120, 1) + " =", ColorOnSign(ld_120), gi_2440, gi_2428, gi_2460);
SetLabel("iProfit13", DoubleToStr(ld_140, 1) + " %", ColorOnSign(ld_140), gi_2444, gi_2428 + 9 * gi_2432, gi_2460);
SetLabel("iProfit23", DoubleToStr(ld_148, 1) + " %", ColorOnSign(ld_148), gi_2444, gi_2428 + gi_2432 << 3, gi_2460);
SetLabel("iProfit33", DoubleToStr(ld_156, 1) + " %", ColorOnSign(ld_156), gi_2444, gi_2428 + 7 * gi_2432, gi_2460);
SetLabel("iProfit43", DoubleToStr(ld_164, 1) + " %", ColorOnSign(ld_164), gi_2444, gi_2428 + 6 * gi_2432, gi_2460);
SetLabel("iProfit53", DoubleToStr(ld_172, 1) + " %", ColorOnSign(ld_172), gi_2444, gi_2428 + 5 * gi_2432, gi_2460);
SetLabel("iProfit63", DoubleToStr(ld_180, 1) + " %", ColorOnSign(ld_180), gi_2444, gi_2428 + gi_2432 << 2, gi_2460);
SetLabel("iProfit73", DoubleToStr(ld_188, 1) + " %", ColorOnSign(ld_188), gi_2444, gi_2428 + 3 * gi_2432, gi_2460);
SetLabel("iProfit83", DoubleToStr(ld_196, 1) + " %", ColorOnSign(ld_196), gi_2444, gi_2428 + gi_2432 * 2, gi_2460);
SetLabel("iProfit93", DoubleToStr(ld_204, 1) + " %", ColorOnSign(ld_204), gi_2444, gi_2428 + gi_2432, gi_2460);
SetLabel("iProfit03", DoubleToStr(ld_212, 1) + " %", ColorOnSign(ld_212), gi_2444, gi_2428, gi_2460);
}
}
int ColorOnSign(double ad_0) {
int li_ret_8 = gi_2448;
if (ad_0 > 0.0) li_ret_8 = gi_2452;
if (ad_0 < 0.0) li_ret_8 = gi_2456;
return (li_ret_8);
}
int DateBeginQuarter(int ai_0 = 0) {
int li_4 = Year() - MathFloor(ai_0 / 4);
ai_0 = MathMod(ai_0, 4);
int li_8 = Month() - MathMod(Month() + 2, 3) + 3 * ai_0;
if (li_8 < 1) {
li_8 += 12;
li_4--;
}
if (li_8 > 12) {
li_8 -= 12;
li_4++;
}
return (StrToTime(li_4 + "." + li_8 + ".01"));
}
int DateOfMonday(int ai_0 = 0) {
for (int li_ret_4 = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE)); TimeDayOfWeek(li_ret_4) != 1; li_ret_4 -= 86400) {
}
li_ret_4 += 60 * (60 * (24 * (7 * ai_0)));
return (li_ret_4);
}
void DeleteObjects() {
string l_name_20;
string ls_0 = "iProfit";
for (int li_8 = 0; li_8 < 10; li_8++) for (int li_12 = 1; li_12 < 4; li_12++) ObjectDelete(ls_0 + li_8 + li_12);
ObjectsDeleteAll(0, OBJ_LABEL);
for (int li_16 = ObjectsTotal() - 1; li_16 >= 0; li_16--) {
l_name_20 = ObjectName(li_8);
if (StringSubstr(l_name_20, 0, 4) == "MP14") ObjectDelete(l_name_20);
}
}
double GetProfitFromDateInCurrency(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
double ld_ret_20 = 0;
int l_hist_total_32 = OrdersHistoryTotal();
if (as_0 == "0") as_0 = Symbol();
for (int l_pos_28 = 0; l_pos_28 < l_hist_total_32; l_pos_28++) {
if (OrderSelect(l_pos_28, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || OrderType() == a_cmd_8) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12)
if (ai_16 < OrderCloseTime()) ld_ret_20 += OrderProfit() + OrderCommission() + OrderSwap();
}
}
}
}
return (ld_ret_20);
}
void SetLabel(string a_name_0, string a_text_8, color a_color_16, int a_x_20, int a_y_24, int a_corner_28 = 3, int a_fontsize_32 = 8) {
if (ObjectFind(a_name_0) < 0) ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
ObjectSetText(a_name_0, a_text_8, a_fontsize_32);
ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_20);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_24);
ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_28);
ObjectSet(a_name_0, OBJPROP_FONTSIZE, a_fontsize_32);
}
void Indi_Hi_Lo() {
double l_digits_8;
double ld_16;
double ld_24;
string ls_32;
double ld_40;
string l_time2str_0 = TimeToStr(TimeCurrent(), Digits);
SERVER2("SM2", 15, 14, 3);
ObjectSetText("SM2", " " + l_time2str_0 + "", 12, "Arial Bold", g_color_2580);
gd_3016 = Period();
if (gd_3016 == 1.0) gs_unused_2868 = "M1";
else {
if (gd_3016 == 5.0) gs_unused_2868 = "M5";
else {
if (gd_3016 == 15.0) gs_unused_2868 = "M15";
else {
if (gd_3016 == 30.0) gs_unused_2868 = "M30";
else {
if (gd_3016 == 60.0) gs_unused_2868 = "H1";
else {
if (gd_3016 == 240.0) gs_unused_2868 = "H4";
else {
if (gd_3016 == 1440.0) gs_unused_2868 = "D1";
else {
if (gd_3016 == 43200.0) gs_unused_2868 = "MN1";
else gs_unused_2868 = "-";
}
}
}
}
}
}
}
if (gi_2524 == TRUE) {
gd_2684 = 10;
gd_2700 = 50;
gd_2968 = 10;
if (Digits == 5 || Digits == 3) l_digits_8 = Digits - 1;
else l_digits_8 = Digits;
if (Point == 0.001 || Point == 0.00001) {
ld_16 = 10.0 * Point;
ld_24 = 0.1;
} else {
ld_16 = Point;
ld_24 = 1;
}
g_ima_2960 = iMA(Symbol(), 0, 1, 0, MODE_EMA, PRICE_CLOSE, 0);
gs_2936 = DoubleToStr(g_ima_2960, l_digits_8);
gs_2904 = "Footlight MT Light";
gi_3124 = 19;
gi_3128 = 7;
if (mySideway5() > mySideway5a()) gi_3112 = gi_2548;
else {
if (mySideway5() < mySideway5a()) gi_3112 = gi_2552;
else gi_3112 = gi_2592;
}
Write("MP01", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 0.0 * gd_2968 - 18.0, gs_2936, gi_3124, gs_2904, gi_3112);
if (mySideway1() > mySideway1a()) gi_3112 = gi_2548;
else {
if (mySideway1() < mySideway1a()) gi_3112 = gi_2552;
else gi_3112 = gi_2592;
}
Write("MP0111", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 0.0 * gd_2968, "_______________", gi_3128, gs_2904, gi_3112);
gs_2904 = "Tahoma Bold";
gi_3124 = 10;
gd_3000 = iHigh(Symbol(), PERIOD_D1, 0);
gs_2936 = DoubleToStr(gd_3000, l_digits_8);
Write("MP02", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 1.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2564);
Write("MP0211", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 1.0 * gd_2968, "High : ", gi_3128, gs_2904, gi_2564);
gd_3008 = iLow(Symbol(), PERIOD_D1, 0);
gs_2936 = DoubleToStr(gd_3008, l_digits_8);
Write("MP03", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 2.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2568);
Write("MP0311", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 2.0 * gd_2968, "Low : ", gi_3128, gs_2904, gi_2568);
gs_2936 = DoubleToStr((gd_3000 - gd_3008) / ld_16, 0);
Write("MP06", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 3.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2548);
Write("MP0611", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 3.0 * gd_2968, "D1 : ", gi_3128, gs_2904, gi_2548);
gi_3152 = 0;
gi_3156 = 0;
gi_3160 = 0;
gi_3164 = 0;
gi_3168 = 0;
gi_3172 = 0;
gi_3152 = (iHigh(Symbol(), PERIOD_D1, 1) - iLow(Symbol(), PERIOD_D1, 1)) / ld_16;
for (gi_3172 = 1; gi_3172 <= 5; gi_3172++) gi_3156 = gi_3156 + (iHigh(Symbol(), PERIOD_D1, gi_3172) - iLow(Symbol(), PERIOD_D1, gi_3172)) / ld_16;
for (gi_3172 = 1; gi_3172 <= 10; gi_3172++) gi_3160 = gi_3160 + (iHigh(Symbol(), PERIOD_D1, gi_3172) - iLow(Symbol(), PERIOD_D1, gi_3172)) / ld_16;
for (gi_3172 = 1; gi_3172 <= 20; gi_3172++) gi_3164 = gi_3164 + (iHigh(Symbol(), PERIOD_D1, gi_3172) - iLow(Symbol(), PERIOD_D1, gi_3172)) / ld_16;
gi_3156 /= 5;
gi_3160 /= 10;
gi_3164 /= 20;
gi_3168 = (gi_3152 + gi_3156 + gi_3160 + gi_3164) / 4;
g_dbl2str_3176 = DoubleToStr(gi_3168, l_digits_8 - 4.0);
gs_unused_3184 = (iHigh(Symbol(), PERIOD_D1, 1) - iLow(Symbol(), PERIOD_D1, 1)) / ld_16;
Write("MP07", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 4.0 * gd_2968, g_dbl2str_3176, gi_3128, gs_2904, gi_2592);
Write("MP0711", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 4.0 * gd_2968, "Av : ", gi_3128, gs_2904, gi_2592);
gd_3008 = Time[4] - Time[5] - MathMod(TimeCurrent(), Time[4] - Time[5]);
gd_3000 = gd_3008 / 60.0;
gd_3008 = 60.0 * (gd_3000 - MathFloor(gd_3000));
gd_3000 = MathFloor(gd_3000);
g_dbl2str_2820 = DoubleToStr(gd_3000, 0);
g_dbl2str_2828 = DoubleToStr(gd_3008, 0);
gs_2936 = g_dbl2str_2820 + ":" + g_dbl2str_2828;
Write("MP08", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 7.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2564);
Write("MP0811", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 7.0 * gd_2968, "Time : ", gi_3128, gs_2904, gi_2564);
gd_3000 = (Ask - Bid) / ld_16;
gs_2936 = DoubleToStr(gd_3000, l_digits_8 - 3.0);
if ((Ask - Bid) / ld_16 < gi_2200) gi_2892 = gi_2548;
else {
if ((Ask - Bid) / ld_16 > gi_2200) gi_2892 = gi_2556;
else gi_2892 = gi_2560;
}
Write("MP09", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 5.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2892);
Write("MP0911", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 5.0 * gd_2968, "Sprd : ", gi_3128, gs_2904, gi_2892);
gd_3000 = MarketInfo(Symbol(), MODE_STOPLEVEL) * ld_24;
gs_2936 = DoubleToStr(gd_3000, 0);
Write("MP09a", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 6.0 * gd_2968, gs_2936, gi_3128, gs_2904, gi_2592);
Write("MP0911a", gi_2536, gi_2468 + gd_2684 + 40.0, gi_2464 + gd_2700 + 6.0 * gd_2968, "S.Lvl : ", gi_3128, gs_2904, gi_2592);
if (gi_2604 == TRUE) {
if (mySideway1() > mySideway1a()) gi_3112 = gi_2548;
else {
if (mySideway1() < mySideway1a()) gi_3112 = gi_2552;
else gi_3112 = gi_2592;
}
Write("MP0912", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 7.5 * gd_2968, "____________", gi_3128, gs_2904, gi_3112);
Write("MP09121", gi_2536, gi_2468 + gd_2684, gi_2464 + gd_2700 + 9.0 * gd_2968, "____________", gi_3128, gs_2904, gi_3112);
Write("MP0913", gi_2536, gi_2468 + gd_2684 + 8.0, gi_2464 + gd_2700 + 8.45 * gd_2968, g_symbol_1968, 11, gs_2904, gi_2596);
ld_40 = Period();
if (ld_40 == 1.0) ls_32 = "M1";
else {
if (ld_40 == 5.0) ls_32 = "M5";
else {
if (ld_40 == 15.0) ls_32 = "M15";
else {
if (ld_40 == 30.0) ls_32 = "M30";
else {
if (ld_40 == 60.0) ls_32 = "H1";
else {
if (ld_40 == 240.0) ls_32 = "H4";
else {
if (ld_40 == 1440.0) ls_32 = "D1";
else {
if (ld_40 == 43200.0) ls_32 = "MN1";
else ls_32 = "-";
}
}
}
}
}
}
}
Write("MP0914", gi_2536, gi_2468 + gd_2684 + 8.0, gi_2464 + gd_2700 + 10.0 * gd_2968, ls_32, 9, gs_2904, gi_2568);
}
}
}
void Write(string a_name_0, double ad_unused_8, int a_x_16, int a_y_20, string a_text_24, int a_fontsize_32, string a_fontname_36, color a_color_44 = -1, int ai_unused_48 = 0) {
ObjectCreate(a_name_0, OBJ_LABEL, g_window_2472, 0, 0);
ObjectSetText(a_name_0, a_text_24, a_fontsize_32, a_fontname_36, a_color_44);
ObjectSet(a_name_0, OBJPROP_CORNER, g_corner_2532);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
ObjectSetText("signal", CharToStr(164), 60, "Wingdings", Gold);
if (a_name_0 == "MP5221") {
ObjectCreate(a_name_0, OBJ_LABEL, g_window_2472, 0, 0);
ObjectSetText(a_name_0, a_text_24, a_fontsize_32, a_fontname_36, a_color_44);
ObjectSet(a_name_0, OBJPROP_CORNER, g_corner_2532);
ObjectSet(a_name_0, OBJPROP_ANGLE, 0);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
ObjectSetText("signal", CharToStr(164), 60, "Wingdings", Gold);
}
if (a_name_0 == "MP091444") {
ObjectCreate(a_name_0, OBJ_LABEL, g_window_2472, 0, 0);
ObjectSetText(a_name_0, a_text_24, a_fontsize_32, a_fontname_36, a_color_44);
ObjectSet(a_name_0, OBJPROP_CORNER, 3);
ObjectSet(a_name_0, OBJPROP_ANGLE, 0);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
}
}
int SERVER2(string a_name_0, int ai_unused_8, int ai_unused_12, int a_corner_16) {
ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_16);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, 5);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, 10);
ObjectSet(a_name_0, OBJPROP_BACK, TRUE);
return (0);
}
void Periksa_Bar() {
int li_0 = iBars(Symbol(), PERIOD_M1);
if (li_0 < 100) {
Comment("\n Waiting to load M1 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_4 = iBars(Symbol(), PERIOD_M5);
if (li_4 < 100) {
Comment("\n Waiting to load M5 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_8 = iBars(Symbol(), PERIOD_M15);
if (li_8 < 100) {
Comment("\n Waiting to load M15 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_12 = iBars(Symbol(), PERIOD_M30);
if (li_12 < 100) {
Comment("\n Waiting to load M30 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_16 = iBars(Symbol(), PERIOD_H1);
if (li_16 < 100) {
Comment("\n Waiting to load H1 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_20 = iBars(Symbol(), PERIOD_H4);
if (li_20 < 100) {
Comment("\n Waiting to load H4 Data, We need at least 100 bars of data to run the Expert Advisor");
return;
}
int li_24 = iBars(Symbol(), PERIOD_D1);
if (li_24 < 100) Comment("\n Waiting to load D1 Data, We need at least 100 bars of data to run the Expert Advisor");
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---