#property link "http://www.systemtradepro.com/index.html/" int g_slippage_76 = 3; extern double Leverage = 10.0; extern bool PositionSizing = TRUE; extern double ASystemLots = 0.5; extern double BSystemLots = 0.8; extern double CSystemLots = 0.5; extern double DSystemLots = 0.2; extern double ESystemLots = 0.1; extern int TakeProfit = 3000; extern int StopLoss = 3000; double gd_140 = 2.6; double gd_148 = 2.5; double gd_156 = 0.8; double gd_164 = 3.8; double gd_172 = 0.5; int g_bars_188; bool gi_192 = TRUE; int gi_196 = 0; int init() { return (0); } int deinit() { return (0); } int start() { int li_unused_8 = 3; int l_pos_12 = -1; int l_pos_16 = -1; int l_pos_20 = -1; int l_pos_24 = -1; int l_pos_28 = -1; int l_pos_32 = -1; int l_pos_36 = -1; int l_pos_40 = -1; int l_pos_44 = -1; int l_pos_48 = -1; int l_pos_52 = -1; int l_pos_56 = -1; int l_pos_60 = -1; int l_pos_64 = -1; int l_pos_68 = -1; int li_unused_72 = -1; int li_unused_76 = -1; int li_unused_80 = -1; if (AccountCompany() == "121 Lab Co., Ltd") { gi_192 = TRUE; gi_196 = 8; } else { if (AccountCompany() == "ODL Securities") { gi_192 = FALSE; gi_196 = -1; } else { if (AccountCompany() == "FXDirectDealer") { gi_192 = TRUE; gi_196 = 2; } else { if (AccountCompany() == "EuroOrient Securities&Financial Services Ltd") { gi_192 = TRUE; gi_196 = 1; } else { if (AccountCompany() == "Interbank FX, LLC") { gi_192 = TRUE; gi_196 = -1; } else { gi_192 = TRUE; gi_196 = 0; } } } } } for (int l_pos_0 = 0; l_pos_0 < OrdersTotal(); l_pos_0++) { OrderSelect(l_pos_0, SELECT_BY_POS); if (OrderMagicNumber() == 10 && OrderSymbol() == Symbol()) l_pos_12 = l_pos_0; if (OrderMagicNumber() == 20 && OrderSymbol() == Symbol()) l_pos_16 = l_pos_0; if (OrderMagicNumber() == 30 && OrderSymbol() == Symbol()) l_pos_20 = l_pos_0; if (OrderMagicNumber() == 40 && OrderSymbol() == Symbol()) l_pos_24 = l_pos_0; if (OrderMagicNumber() == 50 && OrderSymbol() == Symbol()) l_pos_28 = l_pos_0; if (OrderMagicNumber() == 60 && OrderSymbol() == Symbol()) l_pos_32 = l_pos_0; if (OrderMagicNumber() == 70 && OrderSymbol() == Symbol()) l_pos_36 = l_pos_0; if (OrderMagicNumber() == 80 && OrderSymbol() == Symbol()) l_pos_40 = l_pos_0; if (OrderMagicNumber() == 90 && OrderSymbol() == Symbol()) l_pos_44 = l_pos_0; if (OrderMagicNumber() == 100 && OrderSymbol() == Symbol()) l_pos_48 = l_pos_0; if (OrderMagicNumber() == 110 && OrderSymbol() == Symbol()) l_pos_52 = l_pos_0; if (OrderMagicNumber() == 120 && OrderSymbol() == Symbol()) l_pos_56 = l_pos_0; if (OrderMagicNumber() == 130 && OrderSymbol() == Symbol()) l_pos_60 = l_pos_0; if (OrderMagicNumber() == 140 && OrderSymbol() == Symbol()) l_pos_64 = l_pos_0; if (OrderMagicNumber() == 150 && OrderSymbol() == Symbol()) l_pos_68 = l_pos_0; if (OrderMagicNumber() == 160 && OrderSymbol() == Symbol()) li_unused_72 = l_pos_0; if (OrderMagicNumber() == 170 && OrderSymbol() == Symbol()) li_unused_76 = l_pos_0; if (OrderMagicNumber() == 180 && OrderSymbol() == Symbol()) li_unused_80 = l_pos_0; } if (TimeYear(TimeCurrent()) < 2009 || (TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) < 7 || (TimeMonth(TimeCurrent()) == 7 && TimeDay(TimeCurrent()) < 18))) { if (g_bars_188 != Bars) { DayTime(l_pos_12, 28, 10, 22, 10); DayTime(l_pos_16, 31, 13, 9, 20); DayTime(l_pos_20, 23, 15, 4, 30); DayTime(l_pos_32, 20, 15, 15, 60); DayTimeSell(l_pos_24, 25, 1, 3, 40); DayTime2(l_pos_48, 17, 17, 12, 100); DayTime2(l_pos_52, 1, 16, 13, 110); DayTime2(l_pos_56, 13, 7, 16, 120); DayTimeSell2(l_pos_36, 20, 12, 16, 70); DayTimeSell2(l_pos_40, 15, 2, 16, 80); DayTimeSell2(l_pos_44, 17, 19, 22, 90); DayTime3(l_pos_60, 17, 15, 11, 130); DayTime3(l_pos_64, 6, 0, 6, 140); DayTime3(l_pos_68, 7, 22, 14, 150); DayTime(l_pos_28, 13, 1, 16, 50); } g_bars_188 = Bars; } return (0); } int DayTime(int a_pos_0, int ai_4, int ai_8, int ai_12, int a_magic_16) { int l_ticket_20; int li_36; int li_40; double ld_44; double l_lots_52; double ld_60; int li_68; if (PositionSizing == TRUE) { ld_44 = gd_140 / 10.0 * Leverage; if (AccountCurrency() == "USD") ld_60 = AccountBalance() / 50000.0 * ld_44; else if (AccountCurrency() == "JPY") ld_60 = AccountBalance() / 5000000.0 * ld_44; li_68 = 10.0 * ld_60 + 0.5; l_lots_52 = li_68 / 10.0; if (l_lots_52 < 0.1) l_lots_52 = 0.1; } else l_lots_52 = ASystemLots; int li_24 = SammerTime(); int li_28 = ai_8 + gi_196; if (li_28 < 0) { li_28 += 24; li_36 = ai_4 - 1; li_40 = -1; } else { if (li_28 > 23) { li_28 -= 24; li_36 = ai_4 + 1; li_40 = 1; } else { li_36 = ai_4; li_40 = 0; } } int li_32 = ai_12 + gi_196; if (li_32 < 0) li_32 += 24; else if (li_32 > 23) li_32 -= 24; if (a_pos_0 == -1) { if (TimeDay(TimeCurrent()) == li_36) { if (TimeHour(TimeCurrent()) == li_28 + li_24) { if ((TimeYear(TimeCurrent()) == 2007 && TimeMonth(TimeCurrent()) == 7 && TimeDay(TimeCurrent()) == li_40 + 10) || (TimeYear(TimeCurrent()) == 2002 && TimeMonth(TimeCurrent()) == 10 && TimeDay(TimeCurrent()) == li_40 + 28) || (TimeYear(TimeCurrent()) == 2008 && TimeMonth(TimeCurrent()) == 2 && TimeDay(TimeCurrent()) == li_40 + 28) || (TimeYear(TimeCurrent()) == 2007 && TimeMonth(TimeCurrent()) == 7 && TimeDay(TimeCurrent()) == li_40 + 31) || (TimeYear(TimeCurrent()) == 2007 && TimeMonth(TimeCurrent()) == 8 && TimeDay(TimeCurrent()) == li_40 + 28) || (TimeYear(TimeCurrent()) == 2008 && TimeMonth(TimeCurrent()) == 11 && TimeDay(TimeCurrent()) == li_40 + 6) || (TimeYear(TimeCurrent()) == 2007 && TimeMonth(TimeCurrent()) == 11 && TimeDay(TimeCurrent()) == li_40 + 20) || (TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) == 2 && TimeDay(TimeCurrent()) == li_40 + 6) || (TimeYear(TimeCurrent()) == 2002 && TimeMonth(TimeCurrent()) == 3 && TimeDay(TimeCurrent()) == li_40 + 6) || (TimeYear(TimeCurrent()) == 2002 && TimeMonth(TimeCurrent()) == 12 && TimeDay(TimeCurrent()) == li_40 + 13) || (TimeYear(TimeCurrent()) == 2008 && TimeMonth(TimeCurrent()) == 3 && TimeDay(TimeCurrent()) == li_40 + 13) || TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) == 4 && TimeDay(TimeCurrent()) == li_40 + 13) return (0); l_ticket_20 = OrderSend(Symbol(), OP_BUY, l_lots_52, Ask, g_slippage_76, Ask - StopLoss * Point, Ask + TakeProfit * Point, "Buy", a_magic_16, 0, Blue); } } } else { OrderSelect(a_pos_0, SELECT_BY_POS); if (li_32 + li_24 >= 24) li_32 = 0; else li_32 += li_24; if (TimeHour(TimeCurrent()) == li_32) { if (OrderSymbol() == Symbol()) if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_76, Green); } } return (0); } int DayTime2(int a_pos_0, int ai_4, int ai_8, int ai_12, int a_magic_16) { int l_ticket_20; int li_36; double ld_40; double l_lots_48; double ld_56; int li_64; int li_68; if (PositionSizing == TRUE) { ld_40 = gd_148 / 10.0 * Leverage; if (AccountCurrency() == "USD") ld_56 = AccountBalance() / 50000.0 * ld_40; else if (AccountCurrency() == "JPY") ld_56 = AccountBalance() / 5000000.0 * ld_40; li_64 = 10.0 * ld_56 + 0.5; l_lots_48 = li_64 / 10.0; if (l_lots_48 < 0.1) l_lots_48 = 0.1; } else l_lots_48 = CSystemLots; int li_24 = SammerTime(); int li_28 = ai_8 + gi_196; if (li_28 < 0) { li_28 += 24; li_36 = ai_4 - 1; li_68 = -1; } else { if (li_28 > 23) { li_28 -= 24; li_36 = ai_4 + 1; li_68 = 1; } else { li_36 = ai_4; li_68 = 0; } } int li_32 = ai_12 + gi_196; if (li_32 < 0) li_32 += 24; else if (li_32 > 23) li_32 -= 24; if (a_pos_0 == -1) { if (TimeDay(TimeCurrent()) == li_36) { if (TimeHour(TimeCurrent()) == li_28 + li_24) { if ((TimeYear(TimeCurrent()) == 2006 && TimeMonth(TimeCurrent()) == 6 && TimeDay(TimeCurrent()) == li_68 + 29) || (TimeYear(TimeCurrent()) == 2006 && TimeMonth(TimeCurrent()) == 8 && TimeDay(TimeCurrent()) == li_68 + 1) || (TimeYear(TimeCurrent()) == 2007 && TimeMonth(TimeCurrent()) == 7 && TimeDay(TimeCurrent()) == li_68 + 17) || (TimeYear(TimeCurrent()) == 2006 && TimeMonth(TimeCurrent()) == 9 && TimeDay(TimeCurrent()) == li_68 + 1) || (TimeYear(TimeCurrent()) == 2002 && TimeMonth(TimeCurrent()) == 12 && TimeDay(TimeCurrent()) == li_68 + 13) || (TimeYear(TimeCurrent()) == 2004 && TimeMonth(TimeCurrent()) == 8 && TimeDay(TimeCurrent()) == li_68 + 13) || (TimeYear(TimeCurrent()) == 2004 && TimeMonth(TimeCurrent()) == 3 && TimeDay(TimeCurrent()) == li_68 + 17) || (TimeYear(TimeCurrent()) == 2003 && TimeMonth(TimeCurrent()) == 2 && TimeDay(TimeCurrent()) == li_68 + 17) || (TimeYear(TimeCurrent()) == 2005 && TimeMonth(TimeCurrent()) == 8 && TimeDay(TimeCurrent()) == li_68 + 1) || (TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) == 5 && TimeDay(TimeCurrent()) == li_68 + 13) || (TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) == 4 && TimeDay(TimeCurrent()) == li_68 + 13) || TimeYear(TimeCurrent()) == 2009 && TimeMonth(TimeCurrent()) == 4 && TimeDay(TimeCurrent()) == li_68 + 17) return (0); l_ticket_20 = OrderSend(Symbol(), OP_BUY, l_lots_48, Ask, g_slippage_76, Ask - StopLoss * Point, Ask + TakeProfit * Point, "Buy", a_magic_16, 0, Blue); } } } else { OrderSelect(a_pos_0, SELECT_BY_POS); if (li_32 + li_24 >= 24) li_32 = 0; else li_32 += li_24; if (TimeHour(TimeCurrent()) == li_32) { if (OrderSymbol() == Symbol()) if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_76, Green); } } return (0); } int DayTime3(int a_pos_0, int ai_4, int ai_8, int ai_12, int a_magic_16) { int l_ticket_20; int li_36; double ld_40; double l_lots_48; double ld_56; int li_64; if (PositionSizing == TRUE) { ld_40 = gd_156 / 10.0 * Leverage; if (AccountCurrency() == "USD") ld_56 = AccountBalance() / 50000.0 * ld_40; else if (AccountCurrency() == "JPY") ld_56 = AccountBalance() / 5000000.0 * ld_40; li_64 = 10.0 * ld_56 + 0.5; l_lots_48 = li_64 / 10.0; if (l_lots_48 < 0.1) l_lots_48 = 0.1; } else l_lots_48 = DSystemLots; int li_24 = SammerTime(); int li_28 = ai_8 + gi_196; if (li_28 < 0) { li_28 += 24; li_36 = ai_4 - 1; } else { if (li_28 > 23) { li_28 -= 24; li_36 = ai_4 + 1; } else li_36 = ai_4; } int li_32 = ai_12 + gi_196; if (li_32 < 0) li_32 += 24; else if (li_32 > 23) li_32 -= 24; if (a_pos_0 == -1) { if (TimeDay(TimeCurrent()) == li_36) if (TimeHour(TimeCurrent()) == li_28 + li_24) l_ticket_20 = OrderSend(Symbol(), OP_BUY, l_lots_48, Ask, g_slippage_76, Ask - StopLoss * Point, Ask + TakeProfit * Point, "Buy", a_magic_16, 0, Blue); } else { OrderSelect(a_pos_0, SELECT_BY_POS); if (li_32 + li_24 >= 24) li_32 = 0; else li_32 += li_24; if (TimeHour(TimeCurrent()) == li_32) { if (OrderSymbol() == Symbol()) if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_76, Green); } } return (0); } int DayTimeSell(int a_pos_0, int ai_4, int ai_8, int ai_12, int a_magic_16) { int l_ticket_20; int li_28; double ld_32; double l_lots_40; double ld_48; int li_56; int li_68; if (PositionSizing == TRUE) { ld_32 = gd_164 / 10.0 * Leverage; if (AccountCurrency() == "USD") ld_48 = AccountBalance() / 50000.0 * ld_32; else if (AccountCurrency() == "JPY") ld_48 = AccountBalance() / 5000000.0 * ld_32; li_56 = 10.0 * ld_48 + 0.5; l_lots_40 = li_56 / 10.0; if (l_lots_40 < 0.1) l_lots_40 = 0.1; } else l_lots_40 = BSystemLots; int li_24 = SammerTime(); int li_60 = ai_8 + gi_196; if (li_60 < 0) { li_60 += 24; li_68 = ai_4 - 1; li_28 = -1; } else { if (li_60 > 23) { li_60 -= 24; li_68 = ai_4 + 1; li_28 = 1; } else { li_68 = ai_4; li_28 = 0; } } int li_64 = ai_12 + gi_196; if (li_64 < 0) li_64 += 24; else if (li_64 > 23) li_64 -= 24; if (a_pos_0 == -1) { if (TimeDay(TimeCurrent()) == li_68) { if (TimeHour(TimeCurrent()) == li_60 + li_24) { if ((TimeYear(TimeCurrent()) == 2008 && TimeMonth(TimeCurrent()) == 1 && TimeDay(TimeCurrent()) == li_28 + 6) || (TimeYear(TimeCurrent()) == 2001 && TimeMonth(TimeCurrent()) == 3 && TimeDay(TimeCurrent()) == li_28 + 6) || TimeYear(TimeCurrent()) == 2008 && TimeMonth(TimeCurrent()) == 11 && TimeDay(TimeCurrent()) == li_28 + 6) return (0); l_ticket_20 = OrderSend(Symbol(), OP_SELL, l_lots_40, Bid, g_slippage_76, Bid + StopLoss * Point, Bid - TakeProfit * Point, "Sell", a_magic_16, 0, Red); } } } else { OrderSelect(a_pos_0, SELECT_BY_POS); if (li_64 + li_24 >= 24) li_64 = 0; else li_64 += li_24; if (TimeHour(TimeCurrent()) == li_64) { if (OrderSymbol() == Symbol()) if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_76, Green); } } return (0); } int DayTimeSell2(int a_pos_0, int ai_4, int ai_8, int ai_12, int a_magic_16) { int l_ticket_20; double ld_28; double l_lots_36; double ld_44; int li_52; int li_64; int li_68; if (PositionSizing == TRUE) { ld_28 = gd_172 / 10.0 * Leverage; if (AccountCurrency() == "USD") ld_44 = AccountBalance() / 50000.0 * ld_28; else if (AccountCurrency() == "JPY") ld_44 = AccountBalance() / 5000000.0 * ld_28; li_52 = 10.0 * ld_44 + 0.5; l_lots_36 = li_52 / 10.0; if (l_lots_36 < 0.1) l_lots_36 = 0.1; } else l_lots_36 = ESystemLots; int li_24 = SammerTime(); int li_56 = ai_8 + gi_196; if (li_56 < 0) { li_56 += 24; li_64 = ai_4 - 1; li_68 = -1; } else { if (li_56 > 23) { li_56 -= 24; li_64 = ai_4 + 1; li_68 = 1; } else { li_64 = ai_4; li_68 = 0; } } int li_60 = ai_12 + gi_196; if (li_60 < 0) li_60 += 24; else if (li_60 > 23) li_60 -= 24; if (a_pos_0 == -1) { if (TimeDay(TimeCurrent()) == li_64) { if (TimeHour(TimeCurrent()) == li_56 + li_24) { if (TimeYear(TimeCurrent()) == 2005 && TimeMonth(TimeCurrent()) == 5 && TimeDay(TimeCurrent()) == li_68 + 17 || TimeYear(TimeCurrent()) == 2005 && TimeMonth(TimeCurrent()) == 6 && TimeDay(TimeCurrent()) == li_68 + 17) return (0); l_ticket_20 = OrderSend(Symbol(), OP_SELL, l_lots_36, Bid, g_slippage_76, Bid + StopLoss * Point, Bid - TakeProfit * Point, "Sell", a_magic_16, 0, Red); } } } else { OrderSelect(a_pos_0, SELECT_BY_POS); if (li_60 + li_24 >= 24) li_60 = 0; else li_60 += li_24; if (TimeHour(TimeCurrent()) == li_60) { if (OrderSymbol() == Symbol()) if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_76, Green); } } return (0); } int SammerTime() { if (gi_192 == TRUE) { if (TimeMonth(TimeCurrent()) >= 4 && TimeMonth(TimeCurrent()) < 11) return (1); return (0); } return (0); }