#property copyright "Copyright 2008, Martin Alexander" #property link "http://www.forex-auto-scalper.com" #import "kernel32.dll" int GetTimeZoneInformation(int& a0[]); #import "wininet.dll" int InternetOpenA(string a0, int a1, string a2, string a3, int a4); int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5); int InternetReadFile(int a0, string a1, int a2, int& a3[]); int InternetCloseHandle(int a0); #import extern string Notice_0 = "* * * * V E R Y I M P O R T A N T * * * *"; extern string Notice_1 = "This robot is regularly enhanced & updated!"; extern string Notice_2 = "Please download the latest version from:"; extern string Notice_3 = "http://www.forex-auto-scalper.com"; extern string Notice_4 = ""; extern string Notice_5 = "DO NOT attempt to use or backtest it"; extern string Notice_6 = "before reading the manual!"; extern string Notice_7 = ""; int g_str2int_140 = 0; int g_str2int_144 = 6; extern int GMTOffset = 0; extern bool UseDST = FALSE; int g_str2int_156 = 80; int g_str2int_160 = 90; int g_str2int_164 = 10; int g_str2int_168 = 20; int g_str2int_172 = 80; int g_str2int_176 = 20; extern double RiskLevel = 0.0; extern bool ReduceLots = FALSE; extern double MaximumLots = 0.0; int gi_200 = 20; int gi_204 = 30; int gi_208 = 0; int gi_212 = 0; int g_slippage_216 = 3; extern string TradeNote = ""; extern int Reference = -1; bool gi_unused_232 = TRUE; string gs_abc_236 = "abc"; string gs_244 = "abc@def.ghi"; bool gi_252 = FALSE; bool g_str2int_256 = FALSE; int g_str2int_260 = 0; int g_str2int_264 = 0; int gi_268 = 1; int gi_272 = 0; double g_maxlot_276 = 0.0; double gd_284 = 0.0; int g_datetime_292 = 0; int g_bars_296; int gi_300; bool gi_304 = FALSE; int gi_308 = 0; int gi_312 = 0; bool gi_316 = TRUE; string gs_320 = "-"; string gs_328 = " "; string gs_336 = ""; string gs_344 = ""; string gs_352 = ""; int gi_unused_360 = 0; int gia_368[82]; int gi_372; int gi_376; int gi_380 = 0; int gi_384 = 1; int gi_unused_388 = 3; int gi_392 = 13; int init() { string ls_44; int lia_0[1] = {0}; int li_4 = 0; int l_count_8 = 0; string ls_12 = "EUR"; string ls_20 = "USD"; string ls_28 = ""; gi_316 = TRUE; if (!IsDllsAllowed()) { Comment(gs_328 + "*** Change MetaTrader Options ***\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog and click the \'Common\' tab\n" + gs_328 + "\'Allow DLL imports\' must be checked\n" + gs_328 + "\'Confirm DLL function calls\' must be unchecked"); gi_316 = FALSE; return (0); } if (!IsTesting() && !IsExpertEnabled()) { Comment(gs_328 + "*** Change MetaTrader Options ***\n" + gs_328 + "Click the red \'Expert Advisors\' button to enable EA processing\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog then click the \'OK\' button"); gi_316 = FALSE; return (0); } if (RiskLevel == 0.0) { Comment(gs_328 + "*** Change Expert Advisor Options ***\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog and click the \'Inputs\' tab\n" + gs_328 + "Enter a suitable RiskLevel value\n" + gs_328 + "- a positive value (i.e. 10) = the percentage of the account equity to risk per trade (scaled lots)\n" + gs_328 + "- a negative value (i.e. -0.15) = the lot size to use (fixed lots)"); gi_316 = FALSE; return (0); } if (StringFind(" " + Symbol(), ls_12, 0) < 1 || StringFind(" " + Symbol(), ls_20, 0) < 1) { Comment(gs_328 + "*** Wrong Currency Pair ***\n" + gs_328 + "This version of Auto-Scalper trades " + ls_12 + ls_20 + " only!"); gi_316 = FALSE; return (0); } ArrayInitialize(gia_368, 0); if (StringLen(gs_abc_236) < 3) { Comment(gs_328 + "*** Change Expert Advisor Options ***\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog and click the \'Inputs\' tab\n" + gs_328 + "Enter your FirstName (minimum 3 characters)"); gi_316 = FALSE; return (0); } if (StringLen(gs_244) < 8 || StringFind(gs_244, "@") < 1 || StringFind(gs_244, ".", StringFind(gs_244, "@")) < 0) { Comment(gs_328 + "*** Change Expert Advisor Options ***\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog and click the \'Inputs\' tab\n" + gs_328 + "Enter your EmailAddress"); gi_316 = FALSE; return (0); } if (Reference < 0) { Comment(gs_328 + "*** Change Expert Advisor Options ***\n" + gs_328 + "Press \'F7\' to access the Expert Advisor properties dialog and click the \'Inputs\' tab\n" + gs_328 + "Enter a Reference code (if you also trade manually then specify a value > 0)"); gi_316 = FALSE; return (0); } string ls_36 = "http://forex-auto-scalper.com/register/details.php?base=" + gia_368[1] + "&auth=" + gia_368[2] + "&file=AutoScalper" + "1.01" + "&pair=" + ls_12 + ls_20 + "&name=" + gs_abc_236 + "&mail=" + gs_244 + "&code=" + Reference; while (l_count_8 < 5) { l_count_8++; if (GrabWeb(ls_36, ls_44)) l_count_8 = 6; } if (l_count_8 == 5) { Comment(gs_328 + "*** Unable to communicate with server ***\n" + gs_328 + "Check internet connection and Windows Firewall / Anti-Virus settings\n" + gs_328 + "before restarting MetaTrader 4"); gi_316 = FALSE; return (0); } if (ls_44 == "MI") { Comment(gs_328 + "*** Server Communication Error ***\n" + gs_328 + "Please contact the Auto-Scalper support team\n" + gs_328 + "http://www.forex-auto-scalper.com/support"); gi_316 = FALSE; return (0); } if (StringSubstr(ls_44, 0, 2) == "AP" || StringSubstr(ls_44, 0, 2) == "UA") { li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); gs_352 = ""; if (ls_28 == "UA") gs_352 = "\n\n" + gs_328 + "Please update this copy of Forex Auto-Scalper!\n" + gs_328 + "Visit: http://www.forex-auto-scalper.com and resubmit your details"; li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_140 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_144 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_156 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_160 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_164 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_168 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_172 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_176 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); gi_200 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); gi_204 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); gi_208 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); gi_212 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_slippage_216 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_256 = StrToInteger(ls_28); li_4 = StringFind(ls_44, "|"); if (li_4 >= 0) { ls_28 = StringSubstr(ls_44, 0, li_4); ls_44 = StringSubstr(ls_44, li_4 + 1); g_str2int_260 = StrToInteger(ls_28); if (StringLen(ls_44) > 0) { ls_28 = ls_44; g_str2int_264 = StrToInteger(ls_28); } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } else gi_316 = FALSE; } if (!gi_316) { Comment(gs_328 + "*** Parameter Interpretation Error ***\n" + gs_328 + "Trading is suspended - manage open trades manually\n" + gs_328 + "Please contact the Auto-Scalper support team\n" + gs_328 + "Visit: http://www.forex-auto-scalper.com"); gi_316 = FALSE; return (0); } if (Period() != g_str2int_260) { Comment(gs_328 + "*** Wrong Chart Timeframe ***\n" + gs_328 + "Please change the chart to the " + g_str2int_260 + "-minute setting!"); gi_316 = FALSE; return (0); } g_datetime_292 = TimeCurrent(); HideTestIndicators(TRUE); g_bars_296 = Bars; if (g_str2int_256) gi_300 = 0; else gi_300 = 1; if (Digits == 5) gi_268 = 10; gi_200 *= gi_268; gi_204 *= gi_268; gi_208 *= gi_268; gi_212 *= gi_268; g_slippage_216 *= gi_268; gs_336 = gs_328 + "Auto-Scalper v" + "1.01" + "\n" + gs_328 + "====================================\n"; Comment(gs_336 + gs_328 + "Waiting for price data..." + gs_352); if (MarketInfo(Symbol(), MODE_MINLOT) < 1.0) gi_272 = 1; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.1) gi_272 = 2; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.01) gi_272 = 3; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.001) gi_272 = 4; if (MarketInfo(Symbol(), MODE_MINLOT) < 0.0001) gi_272 = 5; g_maxlot_276 = MarketInfo(Symbol(), MODE_MAXLOT); if (MaximumLots > 0.0) g_maxlot_276 = MathMax(MathMin(MaximumLots, MarketInfo(Symbol(), MODE_MAXLOT)), MarketInfo(Symbol(), MODE_MINLOT)); gi_308 = g_str2int_140 + TimeZoneServer(); if (gi_308 < 0) gi_308 += 24; gi_308 = MathMod(gi_308, 24); gi_312 = g_str2int_144 + TimeZoneServer(); if (gi_312 < 0) gi_312 += 24; gi_312 = MathMod(gi_312, 24); return (0); } int deinit() { return (0); } int start() { int l_ticket_12; double ld_16; double ld_24; double l_price_32; double l_price_40; int li_0 = 0; bool li_48 = FALSE; if (!IsTesting() && !IsExpertEnabled() || !gi_316) return; if (IsTesting()) { gi_308 = g_str2int_140 + GMTOffset; if (UseDST && IsBST()) gi_308++; if (gi_308 < 0) gi_308 += 24; gi_308 = MathMod(gi_308, 24); gi_312 = g_str2int_144 + GMTOffset; if (UseDST && IsBST()) gi_312++; if (gi_312 < 0) gi_312 += 24; gi_312 = MathMod(gi_312, 24); } else if (TimeDayOfYear(g_datetime_292) != DayOfYear()) init(); double l_istochastic_52 = iStochastic(NULL, g_str2int_260, g_str2int_156, 3, 3, MODE_SMA, 1, MODE_MAIN, gi_300 + g_str2int_264); double l_str2int_60 = g_str2int_164; double l_istochastic_68 = iStochastic(NULL, g_str2int_260, g_str2int_168, 3, 3, MODE_SMA, 1, MODE_MAIN, gi_300 + g_str2int_264); double l_str2int_76 = g_str2int_176; double l_istochastic_84 = iStochastic(NULL, g_str2int_260, g_str2int_156, 3, 3, MODE_SMA, 1, MODE_MAIN, gi_300 + g_str2int_264); double l_str2int_92 = g_str2int_160; double l_istochastic_100 = iStochastic(NULL, g_str2int_260, g_str2int_168, 3, 3, MODE_SMA, 1, MODE_MAIN, gi_300 + g_str2int_264); double l_str2int_108 = g_str2int_172; if (g_str2int_256 && Bars != g_bars_296) gi_304 = FALSE; int l_ord_total_8 = OrdersTotal(); li_0 = 0; if (l_istochastic_68 >= l_str2int_76) li_0 = 3; if (l_istochastic_100 <= l_str2int_108) li_0 = 4; for (int l_pos_4 = 0; l_pos_4 < l_ord_total_8; l_pos_4++) { OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES); if (OrderType() <= OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == Reference) { li_48 = TRUE; if (OrderType() == OP_BUY) { if (li_0 == 3 && (g_str2int_256 && !gi_304) || (!g_str2int_256 && Bars != g_bars_296)) { OrderClose(OrderTicket(), OrderLots(), MarketInfo(Symbol(), MODE_BID), g_slippage_216, MediumSeaGreen); if (gi_252) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(MarketInfo(Symbol(), MODE_BID), Digits) + " Closed Buy order"); if (!g_str2int_256) g_bars_296 = Bars; li_48 = FALSE; } else { if (gi_208 > 0) { if (gi_212 == 0 || MarketInfo(Symbol(), MODE_BID) - OrderOpenPrice() > gi_212 * Point) { if (MarketInfo(Symbol(), MODE_BID) - OrderOpenPrice() > gi_208 * Point) { if (OrderStopLoss() < MarketInfo(Symbol(), MODE_BID) - gi_208 * Point) { OrderModify(OrderTicket(), OrderOpenPrice(), MarketInfo(Symbol(), MODE_BID) - gi_208 * Point, OrderTakeProfit(), 0, MediumSeaGreen); if (!g_str2int_256) g_bars_296 = Bars; } } } } } } else { if (li_0 == 4 && (g_str2int_256 && !gi_304) || (!g_str2int_256 && Bars != g_bars_296)) { OrderClose(OrderTicket(), OrderLots(), MarketInfo(Symbol(), MODE_ASK), g_slippage_216, DarkOrange); if (gi_252) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(MarketInfo(Symbol(), MODE_ASK), Digits) + " Closed Sell order"); if (!g_str2int_256) g_bars_296 = Bars; li_48 = FALSE; } else { if (gi_208 > 0) { if (gi_212 == 0 || OrderOpenPrice() - MarketInfo(Symbol(), MODE_ASK) > gi_212 * Point) { if (OrderOpenPrice() - MarketInfo(Symbol(), MODE_ASK) > gi_208 * Point) { if (OrderStopLoss() > MarketInfo(Symbol(), MODE_ASK) + gi_208 * Point || OrderStopLoss() == 0.0) { OrderModify(OrderTicket(), OrderOpenPrice(), MarketInfo(Symbol(), MODE_ASK) + gi_208 * Point, OrderTakeProfit(), 0, DarkOrange); if (!g_str2int_256) g_bars_296 = Bars; } } } } } } } } Comment(gs_336 + gs_328 + "Local: " + TimeToStr(TimeLocal(), TIME_SECONDS) + " GMT: " + TimeToStr(TimeGMT(), TIME_SECONDS) + " Server: " + TimeToStr(TimeCurrent(), TIME_SECONDS) + " (" + StrTimeZoneServer() + ")\n" + gs_328 + "====================================\n" + gs_344 + gs_352); if (!((gi_308 < gi_312 && Hour() >= gi_308 && Hour() < gi_312) || (gi_308 >= gi_312 && Hour() >= gi_308 || Hour() < gi_312))) return (0); if (l_istochastic_52 <= l_str2int_60) li_0 = 1; if (l_istochastic_84 >= l_str2int_92) li_0 = 2; if (RiskLevel < 0.0) ld_16 = MathAbs(RiskLevel); else { ld_24 = AccountEquity() * RiskLevel / 100.0 / gi_204 / MarketInfo(Symbol(), MODE_TICKVALUE); ld_24 = (AccountEquity() - ld_24 * MarketInfo(Symbol(), MODE_MARGINREQUIRED)) * RiskLevel / 100.0 / gi_204 / MarketInfo(Symbol(), MODE_TICKVALUE); ld_16 = MathFloor(ld_24 * MathPow(10, gi_272)) / MathPow(10, gi_272); if (!ReduceLots && gd_284 > ld_16) ld_16 = gd_284; } ld_16 = NormalizeDouble(MathMin(MathMax(MarketInfo(Symbol(), MODE_MINLOT), ld_16), g_maxlot_276), gi_272); gd_284 = ld_16; if (RiskLevel > 0.0 && ld_24 < ld_16) { gs_344 = gs_328 + "Cannot adhere to RiskLevel due to trade size restrictions!\n" + gs_328 + "Optimal order size: " + DoubleToStr(ld_24, gi_272 + 2) + "\n" + gs_328 + "Actual order size: " + DoubleToStr(ld_16, gi_272) + "\n\n"; } else gs_344 = ""; if (li_0 == 1 && (g_str2int_256 && !gi_304) || (!g_str2int_256 && Bars != g_bars_296) && gs_320 != "U") { if (!li_48) { if (AccountFreeMargin() < 1000.0 * ld_16) { Print("We have no money. Free Margin = $", DoubleToStr(AccountFreeMargin(), 2)); return (0); } if (gi_204 > 0) l_price_32 = MarketInfo(Symbol(), MODE_ASK) - gi_204 * Point; else l_price_32 = 0.0; if (gi_200 > 0) l_price_40 = MarketInfo(Symbol(), MODE_ASK) + gi_200 * Point; else l_price_40 = 0.0; l_ticket_12 = OrderSend(Symbol(), OP_BUY, ld_16, MarketInfo(Symbol(), MODE_ASK), g_slippage_216, l_price_32, l_price_40, TradeNote, Reference, 0, DodgerBlue); if (l_ticket_12 > 0) { if (OrderSelect(l_ticket_12, SELECT_BY_TICKET, MODE_TRADES)) { Print("BUY order opened : ", DoubleToStr(OrderOpenPrice(), Digits)); if (gi_252) SendMail(StringTrimLeft(TradeNote + " [Signal Alert]"), "[" + Symbol() + "] " + DoubleToStr(MarketInfo(Symbol(), MODE_ASK), Digits) + " Opened Buy order"); gs_320 = "U"; } else Print("Error opening BUY order : ", GetLastError()); } if (g_str2int_256) gi_304 = TRUE; if (!g_str2int_256) g_bars_296 = Bars; return (0); } } if (li_0 == 2 && (g_str2int_256 && !gi_304) || (!g_str2int_256 && Bars != g_bars_296) && gs_320 != "D") { if (!li_48) { if (AccountFreeMargin() < 1000.0 * ld_16) { Print("We have no money. Free Margin = $", DoubleToStr(AccountFreeMargin(), 2)); return (0); } if (gi_204 > 0) l_price_32 = MarketInfo(Symbol(), MODE_BID) + gi_204 * Point; else l_price_32 = 0.0; if (gi_200 > 0) l_price_40 = MarketInfo(Symbol(), MODE_BID) - gi_200 * Point; else l_price_40 = 0.0; l_ticket_12 = OrderSend(Symbol(), OP_SELL, ld_16, MarketInfo(Symbol(), MODE_BID), g_slippage_216, l_price_32, l_price_40, TradeNote, Reference, 0, DeepPink); if (l_ticket_12 > 0) { if (OrderSelect(l_ticket_12, SELECT_BY_TICKET, MODE_TRADES)) { Print("SELL order opened : ", DoubleToStr(OrderOpenPrice(), Digits)); if (gi_252) SendMail(StringTrimLeft(TradeNote + " [Signal Alert]"), "[" + Symbol() + "] " + DoubleToStr(MarketInfo(Symbol(), MODE_BID), Digits) + " Opened Sell order"); gs_320 = "D"; } else Print("Error opening SELL order : ", GetLastError()); } if (g_str2int_256) gi_304 = TRUE; if (!g_str2int_256) g_bars_296 = Bars; return (0); } } if (!g_str2int_256) g_bars_296 = Bars; return (0); } double TimeZoneLocal() { int lia_0[43]; switch (GetTimeZoneInformation(lia_0)) { case 0: return (lia_0[0] / (-60.0)); case 1: return (lia_0[0] / (-60.0)); case 2: return ((lia_0[0] + lia_0[42]) / (-60.0)); } Print("Unknown return value from GetTimeZoneInformation in kernel32.dll. Returning 0"); return (0); } double TimeZoneServer() { int li_0 = (TimeCurrent() - TimeLocal()) / 60; int li_4 = MathRound(li_0 / 30.0); li_0 = 30 * li_4; return (TimeZoneLocal() + li_0 / 60.0); } string StrTimeZoneServer() { string ls_ret_0; if (TimeZoneServer() >= 0.0) ls_ret_0 = "GMT+" + DoubleToStr(TimeZoneServer(), 0); else ls_ret_0 = "GMT" + DoubleToStr(TimeZoneServer(), 0); return (ls_ret_0); } int TimeGMT() { int li_ret_0 = TimeLocal() - 3600.0 * TimeZoneLocal(); int li_ret_4 = TimeCurrent() - 3600.0 * TimeZoneServer(); if (li_ret_0 > li_ret_4 + 300) return (li_ret_0); return (li_ret_4); } int IsBST() { bool li_ret_0 = FALSE; if (TimeMonth(iTime(Symbol(), PERIOD_M1, 0)) > 3 || (TimeMonth(iTime(Symbol(), PERIOD_M1, 0)) == 3 && TimeDay(iTime(Symbol(), PERIOD_M1, 0)) - TimeDayOfWeek(iTime(Symbol(), PERIOD_M1, 0)) > 24)) li_ret_0 = TRUE; if (TimeMonth(iTime(Symbol(), PERIOD_M1, 0)) > 10 || (TimeMonth(iTime(Symbol(), PERIOD_M1, 0)) == 10 && TimeDay(iTime(Symbol(), PERIOD_M1, 0)) - TimeDayOfWeek(iTime(Symbol(), PERIOD_M1, 0)) > 24)) li_ret_0 = FALSE; return (li_ret_0); } int Session(bool ai_0) { string ls_4; if (gi_372 == 0) { ls_4 = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)"; gi_372 = InternetOpenA(ls_4, gi_380, "0", "0", 0); gi_376 = InternetOpenA(ls_4, gi_384, "0", "0", 0); } if (ai_0) return (gi_376); return (gi_372); } bool GrabWeb(string as_0, string &as_8) { int lia_24[] = {1}; string ls_28 = "x"; int li_16 = InternetOpenUrlA(Session(0), as_0, "0", 0, -2080374528, 0); if (li_16 == 0) return (FALSE); int li_20 = InternetReadFile(li_16, ls_28, gi_392, 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_392, 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); }