#property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property show_inputs #include #include #include #include bool gba_unused_76[100]; int gia_unused_80[100]; double gda_unused_84[100]; string gsa_unused_88[100]; int gia_unused_92[100]; double gda_unused_96[25]; string gsa_100[] = {"None", "Limit", "Stop"}; int gi_unused_104 = 1; int gi_unused_108 = 2; int gi_unused_112 = 1; int gi_unused_116 = 0; int gi_unused_120 = 3; int gi_124 = -1; int gi_unused_128 = -1; int gi_unused_132 = 3; int gi_unused_136 = 2; int gi_unused_140 = 1; int gi_unused_144 = 3; int gi_unused_148 = 2; int gi_unused_152 = 1; int gi_unused_156 = 1; int gi_unused_160 = 2; int gi_unused_164 = 2; int gi_unused_168 = 1; int gi_172 = 2; int gi_176 = 1; int gi_unused_180 = 0; int gi_unused_184 = 1; int gi_unused_188 = 2; int gi_unused_192 = 3; int gi_unused_196 = 4; string gsa_200[] = {"Reset", "Waiting", "In trade", "Closing", "Done Today"}; bool gi_unused_204 = FALSE; bool gi_unused_208 = TRUE; int gi_unused_212 = 60; int gi_unused_216 = 900; int gi_unused_220 = 1800; int gi_unused_224 = 3600; int gi_unused_228 = 5400; int gi_unused_232 = 7200; int gi_unused_236 = 1; int gi_unused_240 = 2; int gi_unused_244 = 3; int gi_unused_248 = 4; int gi_252 = 1; int gi_unused_256 = 0; int gi_unused_260 = 1; int gi_264 = 0; int gi_unused_268 = 1; int gi_unused_272 = 0; int gi_unused_276 = 1; int gi_unused_280 = 0; int gi_284 = 1; int gi_unused_288 = 0; int gi_292 = 1; int gi_unused_296 = 0; int gi_unused_300 = 1; int gi_304 = 0; int gi_unused_308 = 0; int gi_unused_312 = 1; int gi_unused_316 = 0; int gi_unused_320 = 1; int gi_unused_324 = 0; int gi_unused_328 = 1; int gi_unused_332 = 2; int gi_unused_336 = 3; int gi_unused_340 = 1; string gsa_344[] = {"blank", "Waiting", "Preset", "Entry", "Manage"}; string gsa_348[] = {"blank", "SHORT", "LONG", "NEUTRAL"}; string gsa_352[] = {"blank", "Below", "Above"}; string gsa_356[] = {"blank", "Check", "Clear", "Set"}; string gsa_360[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}; string gsa_364[] = {"Manual", "Auto"}; string gsa_368[] = {"Micro", "Mini", "Standard"}; string gsa_372[] = {"blank", "Short", "Long"}; int gi_376; int gi_380; string gs_384; string gs_392; string gsa_400[] = {"Aussie Loonie ", "Aussie Kiwi ", "Aussie Yen ", "Aussie Dollar ", "Swissy Yen", "Euro Aussie", "Euro Loonie", "Euro Swissy", "Euro Pound ", "Euro Yen ", "Euro ", "Pound Swissy ", "Pound Yen ", "Pound ", "Loonie ", "Swissy ", "Dollar Yen ", "Gold ", "Silver ", "Kiwi Yen", "Kiwi Dollar"}; int gia_unused_404[10]; double gda_unused_408[1000]; double gda_unused_412[1000]; double gda_unused_416[1000]; double gda_unused_420[1000]; string gsa_424[] = {"Server", "GMT", "Local"}; string gsa_428[] = {"Unknown", "Interbank FX, LLC", "FXDirectDealer", "Demo Account", "North Finance Company Ltd", "FOREX", "Alpari (UK) Ltd.", "Rosenthal Collins Group, LLC"}; int gi_unused_432 = 8; int gi_unused_440 = 1; int gi_unused_444 = 2; int gia_448[] = {0, 0, 3, 3, 3, 0, 2, 5}; string gsa_452[] = {"DEMO", "Invalid", "Connect"}; bool gi_unused_456 = TRUE; string gs_000000_460 = "000000"; string gs_468 = "info@PowerTradeLive.com"; string gs_unused_476 = "Copyright © 2008"; bool gi_unused_484 = FALSE; bool gi_488 = FALSE; int gi_492 = 0; string gs_dummy_496; bool gba_unused_504[5]; int gia_unused_508[5]; string g_str_concat_512; extern bool Continue = TRUE; extern bool LoadLastData = FALSE; int gi_528 = 0; extern double Cash2Grab = 999.0; double gd_540 = 150.0; bool gi_548 = TRUE; extern bool UseEmail = FALSE; bool gi_unused_556 = TRUE; bool gi_560 = TRUE; bool gi_unused_564 = TRUE; bool gi_unused_568 = TRUE; int gi_unused_572 = 10; int gi_576 = 10; int gi_580 = 16711680; int gi_584 = 8388608; int gi_588 = 15453831; int gi_592 = 16777215; color g_color_596; int gi_600; int gi_604 = 0; int gi_608; double gd_612; double gd_620; double gd_628; double g_global_var_636; double gd_644; double gd_652; double g_global_var_660 = 0.0; double gd_668 = 999999.0; int g_magic_676; string gs_680; int gi_unused_688; bool gi_692 = TRUE; int start() { int li_12; int l_second_20; int li_28; string l_time2str_36; string l_time2str_44; int l_datetime_52; int l_datetime_60; bool li_0 = FALSE; int li_16 = 500; gs_392 = "3.3"; gs_384 = "Cash Grabber"; if (gi_528 > 0) g_magic_676 = gi_528; else g_magic_676 = 0; GlobalVariableSet("$BuildBasket", 1); gi_unused_688 = 1; gi_376 = GetPair(Symbol()); gi_380 = 1000000 * gi_376 + g_magic_676; TradeGate(gs_384, 4, gi_380, 0); gs_000000_460 = AccountNumber(); if (!IsDemo() && AccountNumber() == StrToInteger(gs_000000_460)) { gi_488 = TRUE; MyAlerts("Welcome to " + gs_384 + " " + gs_392 + ", Account Number " + gs_000000_460 + " >>> ", gi_252, gi_264, gi_304, gi_284, gi_292); } else { if (!IsDemo() && AccountNumber() != StrToInteger(gs_000000_460)) { gi_488 = FALSE; MyAlerts("Your EA does not support this account, please try on a Demo Account", gi_252, gi_264, gi_304, gi_284, gi_292); return (0); } gi_488 = FALSE; MyAlerts("Welcome to " + gs_384 + " " + gs_392 + " DEMO TRADING >>> ", gi_252, gi_264, gi_304, gi_284, gi_292); } if (gi_488) { g_str_concat_512 = StringConcatenate("p", gs_000000_460); if (QuickCheck("ftp.powertradeliveauth.com", g_str_concat_512, gs_000000_460, 1)) gi_492 = gi_172; else gi_492 = gi_176; if (gi_492 == gi_176) { MyAlerts("Sorry, this account is not currently active. Please contact " + gs_468, gi_252, gi_264, gi_304, gi_284, gi_292); return (0); } } if (gi_560) { g_color_596 = gi_588; gi_600 = gi_592; } else { g_color_596 = gi_580; gi_600 = gi_584; } if (LoadLastData) { if (GlobalVariableCheck("CGSnapShot" + gi_380)) g_global_var_636 = GlobalVariableGet("CGSnapShot" + gi_380); if (GlobalVariableCheck("CGCash2Grab" + gi_380)) Cash2Grab = GlobalVariableGet("CGCash2Grab" + gi_380); if (GlobalVariableCheck("CGDrawDown" + gi_380)) g_global_var_660 = GlobalVariableGet("CGDrawDown" + gi_380); if (GlobalVariableCheck("CGLowFree" + gi_380)) gd_668 = GlobalVariableGet("CGLowFree" + gi_380); } else g_global_var_636 = AccountEquity(); ObjectCreate("cashTime", OBJ_LABEL, 0, 0, 0); ObjectSet("cashTime", OBJPROP_CORNER, 0); ObjectSet("cashTime", OBJPROP_XDISTANCE, 5); ObjectSet("cashTime", OBJPROP_YDISTANCE, 20); gi_608 = TimeCheckBroker(); gs_680 = TimeToStr(TimeLocal(), TIME_DATE) + " - " + gs_384 + " - " + gsa_400[gi_376] + " Activity"; if (gi_548) { Log(gs_680, " ", 0); Log(gs_680, "<- Server time\t\t" + gs_384 + " " + gs_392 + " ready >> " + gsa_428[gi_608] + " TimeSource:" + gi_604 + " CpID:" + gi_380, 0); Log(gs_680, BrokerData(), 0); Log(gs_680, "Cash2Grab: " + DoubleToStr(Cash2Grab, 2) + " SnapShot: " + DoubleToStr(g_global_var_636, 2), 0); } while (!li_0) { li_28 = 3; l_datetime_52 = TimeLocal(); l_datetime_60 = TimeCurrent(); l_time2str_36 = TimeToStr(l_datetime_52, TIME_SECONDS); l_time2str_44 = TimeToStr(l_datetime_60, TIME_SECONDS); l_second_20 = TimeSeconds(l_datetime_52); ObjectSetText("cashTime", gs_384 + " - " + gs_392 + " >> " + l_time2str_36, 12, "Arial Bold", g_color_596); stats(); if (gd_628 < g_global_var_660) g_global_var_660 = gd_628; if (AccountFreeMargin() < gd_668) gd_668 = AccountFreeMargin(); MyComment(gi_692, 0, li_28, "Continue", Bool2Text(Continue), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Cash 2 Grab", DoubleToStr(Cash2Grab, 2), g_color_596, gi_600, gi_576); li_28++; li_28++; MyComment(gi_692, 0, li_28, "Snap Shot", DoubleToStr(g_global_var_636, 2), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Snap Profit", DoubleToStr(gd_628, 2), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Equity DD", DoubleToStr(g_global_var_660, 2), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Percent DD", DoubleToStr(gd_644, 2), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Lowest % DD", DoubleToStr(gd_652, 2), g_color_596, gi_600, gi_576); li_28++; li_28++; MyComment(gi_692, 0, li_28, "Free Margin", DoubleToStr(AccountFreeMargin(), 2), g_color_596, gi_600, gi_576); li_28++; MyComment(gi_692, 0, li_28, "Lowest Free", DoubleToStr(gd_668, 2), g_color_596, gi_600, gi_576); li_28++; GlobalVariableSet("$BuildBasket", 1); if (gd_628 > Cash2Grab || gd_644 < (-gd_540)) { if (TradeOn("ALL", gi_124, g_magic_676)) { if (!CloseBasket(gi_380)) { MyAlerts("Basket closed out at Equity Increase: $ " + DoubleToStr(gd_628, 2) + " Grab: " + DoubleToStr(Cash2Grab, 2) + " Snap: " + DoubleToStr(g_global_var_636, 2) + " New Equity: " + DoubleToStr(AccountEquity(), 2), gi_252, UseEmail, gi_304, gi_284, gi_292); if (gi_548) Log(gs_680, " Cash2Grab: " + DoubleToStr(Cash2Grab, 2) + " Profit: " + DoubleToStr(gd_628, 2) + " Snap: " + DoubleToStr(g_global_var_636, 2) + " New Equity: " + DoubleToStr(AccountEquity(), 2), 0); g_global_var_660 = 0; gd_652 = 0; gd_644 = 0; gd_668 = AccountFreeMargin(); if (!Continue) { li_12 = ObjectFind("cashTime"); GlobalVariableSet("$BuildBasket", 0); return (0); } } else MyAlerts("Basket closed out ERROR @ $" + DoubleToStr(gd_628, 2), gi_252, gi_264, gi_304, gi_284, gi_292); g_global_var_636 = AccountEquity(); } gi_692 = FALSE; } li_12 = ObjectFind("cashTime"); if (li_12 != 0) { for (int l_count_4 = 0; l_count_4 < 30; l_count_4++) MyComment(gi_692, 0, l_count_4, " ", " ", g_color_596, gi_600, gi_576); return (0); } ObjectsRedraw(); GlobalVariableSet("CGSnapShot" + gi_380, g_global_var_636); GlobalVariableSet("CGCash2Grab" + gi_380, Cash2Grab); GlobalVariableSet("CGDrawDown" + gi_380, g_global_var_660); GlobalVariableSet("CGLowFree" + gi_380, gd_628); Sleep(li_16); } return (0); } int stats() { int l_ord_total_4 = OrdersTotal(); gd_620 = 0; gd_612 = 0; gd_628 = AccountEquity() - g_global_var_636; for (int l_pos_0 = l_ord_total_4 - 1; l_pos_0 >= 0; l_pos_0--) { if (OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_676) { gd_620 += OrderProfit(); if (OrderType() == OP_BUY) gd_612 += (Bid - OrderOpenPrice()) / Point; else if (OrderType() == OP_SELL) gd_612 += (OrderOpenPrice() - Ask) / Point; } } } gd_644 = 100.0 * (g_global_var_660 / g_global_var_636); if (gd_644 < gd_652) gd_652 = gd_644; return (0); }