#property copyright "Copyright © 2009, Profit Trader" #property link "http://smalbiz.co.cc" extern string EA_Name = " Profit Trader v.1.1 "; extern string _1 = " FULL AUTO TRADE "; extern bool ProTrader_Settings = TRUE; extern bool Agressive_Trade = FALSE; extern string _2 = " MONEY MANAGEMENT "; extern int SL_Balance = 0; extern int TP_Balance = 1000000; extern double Lots = 0.1; extern double Risk = 1.0; extern bool Auto_Lot = TRUE; extern string _3 = " MARTINGALE SETTINGS "; extern bool Auto_Range = TRUE; extern double Range_Pips = 35.0; extern double Slippage = 5.0; extern string _4 = " SECURE SETTINGS "; extern bool Auto_Secure = TRUE; extern int Secure_Order = 3; extern double Secure_PL = 10.0; extern string _5 = " TIME FILTER "; extern int Start_Hour_on_Monday = 10; extern int End_Hour_on_Friday = 16; bool g_corner_204 = TRUE; int g_magic_208 = 11311; double gd_212; int init() { Comment(" -----------------------------------------------------------------------", "\n Account Number : ", AccountNumber(), "\n Owner : ", AccountName(), "\n -----------------------------------------------------------------------"); return (0); } int deinit() { ObjectsDeleteAll(0, OBJ_LABEL); return (0); } int start() { int li_0; double l_bid_4; double l_ask_12; string ls_unused_20; int li_28; int li_32; if (!IsDemo() && !IsTesting()) { if (!ValidRealAccNumber()) { DisplayText("warning4", "Your account have not registered yet.", "Tahoma Bold", 8, Salmon, 10, 135); DisplayText("warning5", "You must open a Demo Account !", "Tahoma Bold", 8, Salmon, 10, 150); return; } } Comment(" -----------------------------------------------------------------------", "\n Account Number : ", AccountNumber(), "\n Owner : ", AccountName(), "\n Start Trade on Monday at ", Start_Hour_on_Monday, ":00 ", "\n Close Trade on Friday at more than ", End_Hour_on_Friday, ":00 ", "\n -----------------------------------------------------------------------"); DisplayText("warning1", "Major Pairs Use Only :", "Tahoma Bold", 8, Yellow, 10, 90); DisplayText("warning2", "EURUSD, GBPUSD, AUDUSD", "Tahoma Bold", 8, DodgerBlue, 10, 105); DisplayText("warning3", "USDCAD, USDCHF, USDJPY", "Tahoma Bold", 8, DodgerBlue, 10, 120); ObjectDelete("EndTrade"); double l_ihigh_36 = 0.0; double l_ilow_44 = 0.0; double l_iclose_52 = 0.0; double ld_unused_60 = 10; int l_ord_total_68 = OrdersTotal(); int li_unused_72 = 0; l_ihigh_36 = iHigh(Symbol(), PERIOD_D1, 1); l_ilow_44 = iLow(Symbol(), PERIOD_D1, 1); l_iclose_52 = iClose(Symbol(), PERIOD_D1, 1); double ld_76 = (l_ihigh_36 + l_ilow_44 + l_iclose_52) / 3.0; double ld_84 = ld_76 - (l_ihigh_36 - ld_76); double ld_92 = ld_76 - (l_ihigh_36 - l_ilow_44); double ld_100 = ld_76 + (ld_76 - l_ilow_44); double ld_108 = ld_76 + (l_ihigh_36 - l_ilow_44); double ld_116 = ld_100; double ld_124 = ld_84; int l_count_132 = 0; int l_count_136 = 0; int li_140 = 0; gd_212 = 0; for (int l_pos_144 = 0; l_pos_144 < OrdersTotal(); l_pos_144++) { if (OrderSelect(l_pos_144, SELECT_BY_POS, MODE_TRADES) == TRUE) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_208 && OrderCloseTime() == 0) { gd_212 += OrderProfit(); if (OrderType() == OP_BUY) l_count_136++; if (OrderType() == OP_SELL) l_count_132++; } } } li_140 = l_count_136 + l_count_132; double ld_148 = AccountBalance(); double ld_156 = AccountMargin(); double l_free_magrin_164 = AccountFreeMargin(); double ld_172 = AccountEquity(); double ld_180 = AccountProfit(); double ld_188 = 100.0 * (l_free_magrin_164 / ld_172); double ld_196 = 100.0 * (ld_156 / ld_172); double ld_204 = 100.0 * (ld_172 / ld_148); bool li_212 = TRUE; color l_color_216 = LawnGreen; color l_color_220 = Fuchsia; int li_224 = 13959039; int li_228 = 16748574; int li_232 = 16748574; int li_236 = 64636; int li_240 = 65535; int li_244 = 16748574; int li_248 = 65535; int li_252 = 16760576; int li_256 = 9639167; int li_260 = 55295; string ls_unused_264 = "Font Size"; int l_fontsize_272 = 24; int l_fontsize_276 = 14; string ls_unused_280 = "Font Type"; string l_fontname_288 = "Arial Bold"; int li_296 = 5; int li_300 = 12903679; int li_304 = 0; int li_308 = 0; int li_312 = 0; int li_316 = 0; int li_320 = 0; int li_324 = 0; li_304 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point; for (li_324 = 1; li_324 <= 5; li_324++) li_308 = li_308 + (iHigh(NULL, PERIOD_D1, li_324) - iLow(NULL, PERIOD_D1, li_324)) / Point; for (li_324 = 1; li_324 <= 10; li_324++) li_312 = li_312 + (iHigh(NULL, PERIOD_D1, li_324) - iLow(NULL, PERIOD_D1, li_324)) / Point; for (li_324 = 1; li_324 <= 20; li_324++) li_316 = li_316 + (iHigh(NULL, PERIOD_D1, li_324) - iLow(NULL, PERIOD_D1, li_324)) / Point; li_308 /= 5; li_312 /= 10; li_316 /= 20; li_320 = (li_304 + li_308 + li_312 + li_316) / 4; string ls_unused_328 = ""; string ls_unused_336 = ""; string l_dbl2str_344 = ""; string l_dbl2str_352 = ""; string l_dbl2str_360 = ""; string l_dbl2str_368 = ""; string ls_unused_376 = ""; string ls_unused_384 = ""; string ls_392 = ""; double l_iopen_400 = iOpen(NULL, PERIOD_D1, 0); double l_iclose_408 = iClose(NULL, PERIOD_D1, 0); double ld_416 = (Ask - Bid) / Point; double l_ihigh_424 = iHigh(NULL, PERIOD_D1, 0); double l_ilow_432 = iLow(NULL, PERIOD_D1, 0); l_dbl2str_352 = DoubleToStr((l_iclose_408 - l_iopen_400) / Point, 0); l_dbl2str_344 = DoubleToStr(ld_416, Digits - 4); l_dbl2str_360 = DoubleToStr(li_320, Digits - 4); ls_392 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point; l_dbl2str_368 = DoubleToStr((l_ihigh_424 - l_ilow_432) / Point, 0); if (l_iclose_408 >= l_iopen_400) { ls_unused_376 = "-"; li_28 = 13959039; } if (l_iclose_408 < l_iopen_400) { ls_unused_376 = "-"; li_28 = 17919; } if (l_dbl2str_360 > ls_392) { ls_unused_384 = "-"; li_32 = 17919; } if (l_dbl2str_360 < ls_392) { ls_unused_384 = "-"; li_32 = 13959039; } string ls_unused_440 = ""; string ls_448 = ""; if (Auto_Range > FALSE) ls_unused_440 = "Active"; else ls_unused_440 = "Inactive"; if (Auto_Secure > FALSE) ls_448 = "Active"; else ls_448 = "Inactive"; if (li_212 == TRUE) { if (Bid > l_bid_4) l_color_220 = LawnGreen; if (Bid < l_bid_4) l_color_220 = Fuchsia; l_bid_4 = Bid; if (Ask > l_ask_12) l_color_216 = Fuchsia; if (Ask < l_ask_12) l_color_216 = LawnGreen; l_ask_12 = Ask; } string l_dbl2str_456 = DoubleToStr(Bid, Digits); ObjectCreate("Harga_Bid", OBJ_LABEL, 0, 0, 0); ObjectSetText("Harga_Bid", l_dbl2str_456, l_fontsize_272, l_fontname_288, l_color_220); ObjectSet("Harga_Bid", OBJPROP_CORNER, g_corner_204); ObjectSet("Harga_Bid", OBJPROP_XDISTANCE, 15); ObjectSet("Harga_Bid", OBJPROP_YDISTANCE, 8); string l_dbl2str_464 = DoubleToStr(Ask, Digits); ObjectCreate("Harga_Ask", OBJ_LABEL, 0, 0, 0); ObjectSetText("Harga_Ask", l_dbl2str_464, l_fontsize_276, l_fontname_288, l_color_216); ObjectSet("Harga_Ask", OBJPROP_CORNER, g_corner_204); ObjectSet("Harga_Ask", OBJPROP_XDISTANCE, 15); ObjectSet("Harga_Ask", OBJPROP_YDISTANCE, 40); if (g_corner_204 == 1) { if (AccountProfit() > 0.0) li_0 = 64636; if (AccountProfit() < 0.0) li_0 = 4678655; if (AccountProfit() == 0.0) li_0 = 12632256; if (AccountEquity() >= AccountBalance()) li_236 = 64636; if (AccountEquity() < AccountBalance()) li_236 = 4678655; if (li_140 == 0) { li_252 = 12632256; li_256 = 12632256; li_260 = 12632256; li_224 = 8388352; li_228 = 12632256; li_232 = 12632256; li_236 = 8388352; li_240 = 12632256; li_244 = 12632256; li_248 = 12632256; } DisplayTextCorner("LblSpread", "Spread", "Tahoma", 8, li_300, li_296 + 45, 60); DisplayTextCorner("Spread", "" + l_dbl2str_344 + "", "Tahoma Bold", 10, Yellow, li_296 + 10, 60); DisplayTextCorner("LblChange", "Change", "Tahoma", 8, li_300, li_296 + 45, 75); DisplayTextCorner("Change", "" + l_dbl2str_352 + "", "Tahoma Bold", 10, li_28, li_296 + 10, 75); DisplayTextCorner("LblHi-Lo", "Hi-Low", "Tahoma", 8, li_300, li_296 + 45, 90); DisplayTextCorner("Hi-Lo", "" + l_dbl2str_368 + "", "Tahoma Bold", 10, Yellow, li_296 + 10, 90); DisplayTextCorner("LblAvg", "Average", "Tahoma", 8, li_300, li_296 + 45, 105); DisplayTextCorner("Avg", "" + l_dbl2str_360 + "", "Tahoma Bold", 10, li_32, li_296 + 10, 105); DisplayTextCorner("garis1", "==================", "Tahoma", 7, Silver, 15, 120); DisplayTextCorner("LblRangePips", "Range Pips Today :", "Tahoma", 8, LightBlue, 60, 130); DisplayTextCorner("RangePips", " " + DoubleToStr(Range_Pips, 0), "Tahoma Bold", 8, LightBlue, 15, 130); DisplayTextCorner("LblSecure", "Auto Secure :", "Tahoma", 8, LightBlue, 60, 145); DisplayTextCorner("Secure", "" + ls_448 + "", "Tahoma Bold", 8, LightBlue, 15, 145); DisplayTextCorner("Lbl%Free", "Free Mrgn (%) :", "Tahoma", 8, li_240, 60, 160); DisplayTextCorner("%Free", " " + DoubleToStr(ld_188, 2), "Tahoma Bold", 8, li_240, 15, 160); DisplayTextCorner("Lbl%Used", "Used Mrgn (%) :", "Tahoma", 8, li_244, 60, 175); DisplayTextCorner("%Used", " " + DoubleToStr(ld_196, 2), "Tahoma Bold", 8, li_244, 15, 175); DisplayTextCorner("Lbl%Equi", "Equity (%) :", "Tahoma", 8, li_248, 60, 190); DisplayTextCorner("%Equi", " " + DoubleToStr(ld_204, 2), "Tahoma Bold", 8, li_248, 15, 190); DisplayTextCorner("garis2", "==================", "Tahoma", 7, Silver, 15, 200); DisplayTextCorner("LblOPbuy", "OP BUY :", "Tahoma", 7, li_252, 80, 215); DisplayTextCorner("OPbuy", " " + DoubleToStr(l_count_136, 0), "Tahoma Bold", 7, li_252, 15, 215); DisplayTextCorner("LblOPsell", "OP SELL :", "Tahoma", 7, li_256, 80, 225); DisplayTextCorner("OPsell", " " + DoubleToStr(l_count_132, 0), "Tahoma Bold", 7, li_256, 15, 225); DisplayTextCorner("LblOPtot", "TOTAL OP :", "Tahoma", 7, li_260, 80, 235); DisplayTextCorner("OPtot", " " + DoubleToStr(li_140, 0), "Tahoma Bold", 7, li_260, 15, 235); DisplayTextCorner("LblTtlPL", "TOTAL P/L :", "Tahoma", 7, li_0, 80, 245); DisplayTextCorner("TtlPL", " " + DoubleToStr(ld_180, 2), "Tahoma Bold", 7, li_0, 15, 245); DisplayTextCorner("garis3", "==================", "Tahoma", 7, Silver, 15, 255); DisplayTextCorner("LblBal", "Balance :", "Tahoma", 7, li_224, 80, 265); DisplayTextCorner("Bal", " " + DoubleToStr(ld_148, 2), "Tahoma Bold", 8, li_224, 15, 265); DisplayTextCorner("LblFree", "Free Margin :", "Tahoma", 7, li_232, 80, 280); DisplayTextCorner("Free", " " + DoubleToStr(l_free_magrin_164, 2), "Tahoma Bold", 8, li_232, 15, 280); DisplayTextCorner("LblMrgn", "Used Margin :", "Tahoma", 7, li_228, 80, 295); DisplayTextCorner("Mrgn", " " + DoubleToStr(ld_156, 2), "Tahoma Bold", 8, li_228, 15, 295); DisplayTextCorner("LblEqui", "Equity :", "Tahoma", 7, li_236, 80, 310); DisplayTextCorner("Equi", " " + DoubleToStr(ld_172, 2), "Tahoma Bold", 8, li_236, 15, 310); DisplayTextCorner("garis4", "==================", "Tahoma", 7, Silver, 15, 320); DisplayTextCorner("Info", "PP/SUP/RES TODAY :", "Tahoma", 7, Khaki, 15, 330); DisplayTextCorner("LblR2", " R2 : ", "Tahoma", 7, DodgerBlue, 60, 340); DisplayTextCorner("R2", " " + DoubleToStr(ld_108, 4), "Tahoma", 7, DodgerBlue, 15, 340); DisplayTextCorner("LblR1", " R1 : ", "Tahoma", 7, Aquamarine, 60, 350); DisplayTextCorner("R1", " " + DoubleToStr(ld_100, 4), "Tahoma", 7, Aqua, 15, 350); DisplayTextCorner("LblPP", " PP : ", "Tahoma", 7, LawnGreen, 60, 360); DisplayTextCorner("PP", " " + DoubleToStr(ld_76, 4), "Tahoma", 7, LawnGreen, 15, 360); DisplayTextCorner("LblS1", " S1 : ", "Tahoma", 7, Fuchsia, 60, 370); DisplayTextCorner("S1", " " + DoubleToStr(ld_84, 4), "Tahoma", 7, Fuchsia, 15, 370); DisplayTextCorner("LblS2", " S2 : ", "Tahoma", 7, Red, 60, 380); DisplayTextCorner("S2", " " + DoubleToStr(ld_92, 4), "Tahoma", 7, Red, 15, 380); } int li_472 = 100; int li_476 = 150; int li_480 = 200; int li_484 = 300; int li_488 = 400; int li_492 = 500; if (ProTrader_Settings == TRUE) { Auto_Range = TRUE; if (Symbol() == "EURUSD" || Symbol() == "EURUSD.") { if (Range_Pips < 50.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 50.0 && Range_Pips <= 60.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 60.0) { Secure_Order = 5; Secure_PL = 10; } } if (Symbol() == "GBPUSD" || Symbol() == "GBPUSD.") { if (Range_Pips < 50.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 50.0 && Range_Pips <= 60.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 60.0) { Secure_Order = 5; Secure_PL = 10; } } if (Symbol() == "USDJPY" || Symbol() == "USDJPY.") { if (Range_Pips < 35.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 35.0 && Range_Pips <= 40.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 40.0) { Secure_Order = 5; Secure_PL = 10; } } if (Symbol() == "USDCHF" || Symbol() == "USDCHF.") { if (Range_Pips < 60.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 60.0 && Range_Pips <= 70.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 60.0) { Secure_Order = 5; Secure_PL = 10; } } if (Symbol() == "USDCAD" || Symbol() == "USDCAD.") { if (Range_Pips < 60.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 60.0 && Range_Pips <= 70.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 60.0) { Secure_Order = 5; Secure_PL = 10; } } if (Symbol() == "AUDUSD" || Symbol() == "AUDUSD.") { if (Range_Pips < 50.0) { Secure_Order = 4; Secure_PL = 5; } if (Range_Pips >= 50.0 && Range_Pips <= 60.0) { Secure_Order = 5; Secure_PL = 10; } if (Range_Pips > 60.0) { Secure_Order = 5; Secure_PL = 10; } } } if (Agressive_Trade == TRUE) { ld_116 = ld_108; ld_124 = ld_92; Auto_Range = TRUE; Auto_Secure = TRUE; } if (Agressive_Trade == FALSE) { ld_116 = ld_100; ld_124 = ld_84; Auto_Range = TRUE; Auto_Secure = TRUE; } if (Auto_Range == TRUE) { if (Symbol() == "EURUSD" || Symbol() == "EURUSD.") { if (li_320 < li_472) Range_Pips = 40; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 50; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 60; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 70; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 80; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } if (Symbol() == "GBPUSD" || Symbol() == "GBPUSD.") { if (li_320 < li_472) Range_Pips = 40; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 50; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 60; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 70; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 80; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } if (Symbol() == "USDJPY" || Symbol() == "USDJPY.") { if (li_320 < li_472) Range_Pips = 30; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 30; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 35; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 40; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 50; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } if (Symbol() == "USDCHF" || Symbol() == "USDCHF.") { if (li_320 < li_472) Range_Pips = 50; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 60; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 70; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 80; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 90; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } if (Symbol() == "USDCAD" || Symbol() == "USDCAD.") { if (li_320 < li_472) Range_Pips = 50; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 60; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 70; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 80; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 90; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } if (Symbol() == "AUDUSD" || Symbol() == "AUDUSD.") { if (li_320 < li_472) Range_Pips = 40; if (li_320 >= li_472 && li_320 < li_476) Range_Pips = 45; if (li_320 >= li_476 && li_320 < li_480) Range_Pips = 50; if (li_320 >= li_480 && li_320 < li_484) Range_Pips = 60; if (li_320 >= li_484 && li_320 < li_488) Range_Pips = 80; if (li_320 >= li_488 && li_320 < li_492) Range_Pips = 100; if (li_320 >= li_492) Range_Pips = 125; } } if (Auto_Lot == TRUE) { if (Symbol() == "USDJPY" || Symbol() == "USDJPY.") { if (AccountBalance() < 30000.0) Lots = 0.1; if (AccountBalance() >= 30000.0 && AccountBalance() < 60000.0) Lots = 0.2; if (AccountBalance() >= 60000.0 && AccountBalance() < 80000.0) Lots = 0.3; if (AccountBalance() >= 80000.0 && AccountBalance() < 100000.0) Lots = 0.4; if (AccountBalance() >= 100000.0 && AccountBalance() < 120000.0) Lots = 0.5; if (AccountBalance() >= 120000.0 && AccountBalance() < 140000.0) Lots = 0.6; if (AccountBalance() >= 140000.0 && AccountBalance() < 160000.0) Lots = 0.7; if (AccountBalance() >= 160000.0 && AccountBalance() < 180000.0) Lots = 0.8; if (AccountBalance() >= 180000.0 && AccountBalance() < 200000.0) Lots = 0.9; if (AccountBalance() >= 200000.0) Lots = 1.0; } else { if (AccountBalance() < 80000.0) Lots = 0.1; if (AccountBalance() >= 80000.0 && AccountBalance() < 120000.0) Lots = 0.2; if (AccountBalance() >= 120000.0 && AccountBalance() < 160000.0) Lots = 0.3; if (AccountBalance() >= 160000.0 && AccountBalance() < 200000.0) Lots = 0.4; if (AccountBalance() >= 200000.0) Lots = 0.5; } } if (AccountEquity() <= SL_Balance || AccountEquity() >= TP_Balance) { closebuy(); closesell(); Alert("Your target or stoploss balance was reached..."); return (0); } if (DayOfWeek() == 1 && Hour() < Start_Hour_on_Monday) return (0); if (DayOfWeek() == 5 && Hour() >= End_Hour_on_Friday && AccountProfit() >= 0.0) { closebuy(); closesell(); DisplayText("EndTrade", "GOOD JOB ! Have a nice weekend...", "Tahoma", 14, Gold, 300, 75); return (0); } if (Auto_Secure == TRUE && Secure_Order > 0 && Secure_Order <= li_140 && Secure_PL >= -1000.0 && Secure_PL <= gd_212) { closebuy(); closesell(); Alert("All order was close by Profit Trader !"); ObjectDelete("Securing"); return (0); } if (li_140 >= Secure_Order) DisplayTextCorner("Securing", "Looking for secure now...be patient...", "Tahoma Bold", 10, Khaki, 150, 8); if (l_ord_total_68 < 1 && Ask < ld_116 && Ask > ld_124) { if (Ask > ld_76) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, Ask + Range_Pips * Point, "ProfitTrader.v1.1 Buy", g_magic_208, 0, Blue); if (Ask < ld_76) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, Bid - Range_Pips * Point, "ProfitTrader.v1.1 Sell", g_magic_208, 0, Red); } else { OrderSelect(l_ord_total_68 - 1, SELECT_BY_POS, MODE_TRADES); if (OrderType() == OP_BUY) { if (Ask <= OrderOpenPrice() - Range_Pips * Point - ld_416 * Point) { if (Ask > ld_76) { RefreshRates(); OrderSend(Symbol(), OP_BUY, 2.0 * OrderLots(), Ask, Slippage, 0, OrderOpenPrice(), "ProfitTrader.v.1.1 Double Buy", g_magic_208, 0, Blue); Alert("ProTrader double lot BUY ", Symbol(), " at ", " " + DoubleToStr(Ask, Digits), " TP :", " " + DoubleToStr(OrderOpenPrice(), Digits)); } else { RefreshRates(); OrderSend(Symbol(), OP_SELL, Lots * Risk, Bid, Slippage, 0, Bid - Range_Pips * Point, "ProfitTrader.v1.1 Hedging Sell", g_magic_208, 0, Red); Alert("ProTrader hedging SELL ", Symbol(), " at ", " " + DoubleToStr(Bid, Digits), " TP :", " " + DoubleToStr(Bid - Range_Pips * Point, Digits)); RefreshRates(); OrderSend(Symbol(), OP_BUY, 2.0 * OrderLots(), Ask, Slippage, 0, OrderOpenPrice(), "ProfitTrader.v1.1 Double Buy", g_magic_208, 0, Blue); Alert("ProTrader double lot BUY ", Symbol(), " at ", " " + DoubleToStr(Ask, Digits), " TP :", " " + DoubleToStr(OrderOpenPrice(), Digits)); } } else if (Bid >= OrderOpenPrice() + Range_Pips * Point) closebuy(); } if (OrderType() == OP_SELL) { if (Bid >= OrderOpenPrice() + Range_Pips * Point + ld_416 * Point) { if (Bid < ld_76) { RefreshRates(); OrderSend(Symbol(), OP_SELL, 2.0 * OrderLots(), Bid, Slippage, 0, OrderOpenPrice(), "ProfitTrader.v1.1 Double Sell", g_magic_208, 0, Red); Alert("ProTrader double lot SELL ", Symbol(), " at ", " " + DoubleToStr(Bid, Digits), " TP :", " " + DoubleToStr(OrderOpenPrice(), Digits)); } else { RefreshRates(); OrderSend(Symbol(), OP_BUY, Lots * Risk, Ask, Slippage, 0, Ask + Range_Pips * Point, "ProfitTrader.v1.1 Hedging Buy", g_magic_208, 0, Blue); Alert("ProTrader hedging BUY ", Symbol(), " at ", " " + DoubleToStr(Ask, Digits), " TP :", " " + DoubleToStr(Ask + Range_Pips * Point, Digits)); RefreshRates(); OrderSend(Symbol(), OP_SELL, 2.0 * OrderLots(), Bid, Slippage, 0, OrderOpenPrice(), "ProfitTrader.v1.1 Double Sell", g_magic_208, 0, Red); Alert("ProTrader double lot SELL ", Symbol(), " at ", " " + DoubleToStr(Bid, Digits), " TP :", " " + DoubleToStr(OrderOpenPrice(), Digits)); } } else if (Ask <= OrderOpenPrice() - Range_Pips * Point) closesell(); } } return (0); } void closebuy() { 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, MODE_TRADES); if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red); } } void closesell() { 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, MODE_TRADES); if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red); } } void DisplayTextCorner(string a_name_0, string a_text_8, string a_fontname_16, int a_fontsize_24, color a_color_28, int a_x_32, int a_y_36) { ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0); ObjectSetText(a_name_0, a_text_8, a_fontsize_24, a_fontname_16, a_color_28); ObjectSet(a_name_0, OBJPROP_CORNER, g_corner_204); ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_32); ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_36); } void DisplayText(string a_name_0, string a_text_8, string a_fontname_16, int a_fontsize_24, color a_color_28, int a_x_32, int a_y_36) { ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0); ObjectSetText(a_name_0, a_text_8, a_fontsize_24, a_fontname_16, a_color_28); ObjectSet(a_name_0, OBJPROP_CORNER, 0); ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_32); ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_36); } bool ValidRealAccNumber() { if (AccountNumber() == 4667794) return (TRUE); if (AccountNumber() == 9874) return (TRUE); return (FALSE); }