#property copyright "Rich" #property link "http://bestmt4brokers.com" extern string ver = "Last Modified: 2009.03.16 19:10"; extern double Lot_Size = 0.1; extern int StopLoss = 50; extern int TakeProfit = 50; extern bool EnableExit = FALSE; int gi_104 = 0; extern int MagicNumber = 9955599; extern int Slippage = 5; string gs_116 = ""; extern int First_WCCI_CCIPeriod = 34; extern int First_WCCI_TrendPeriod = 34; extern int First_WCCI_TurboCCIPeriod = 14; extern int First_WCCI_LSMAPeriod = 25; extern int First_WCCI_LSMAPrice = 0; string gs_144 = ""; extern int Second_WCCI_CCIPeriod = 34; extern int Second_WCCI_TrendPeriod = 34; extern int Second_WCCI_TurboCCIPeriod = 14; extern int Second_WCCI_LSMAPeriod = 25; extern int Second_WCCI_LSMAPrice = 0; string gs_172 = ""; extern int Third_WCCI_CCIPeriod = 14; extern int Third_WCCI_TrendPeriod = 14; extern int Third_WCCI_TurboCCIPeriod = 6; extern int Third_WCCI_LSMAPeriod = 25; extern int Third_WCCI_LSMAPrice = 0; string gs_200 = ""; extern int Fourth_WCCI_CCIPeriod = 6; extern int Fourth_WCCI_TrendPeriod = 6; extern int Fourth_WCCI_TurboCCIPeriod = 3; extern int Fourth_WCCI_LSMAPeriod = 25; extern int Fourth_WCCI_LSMAPrice = 0; extern int DSR_Pips = 50; extern int Minutes_Between_Trades = 15; string g_comment_236 = "Multi_EA_3"; int g_datetime_244 = 0; double g_point_248 = 0.0001; int init() { if (Point == 0.00001) g_point_248 = 0.0001; else { if (Point == 0.001) g_point_248 = 0.01; else g_point_248 = Point; } return (0); } int deinit() { return (0); } int start() { bool li_0 = FALSE; bool li_4 = FALSE; bool li_8 = FALSE; bool li_12 = FALSE; int li_16 = CheckSignal(); int li_20 = CheckExit(); if (li_16 == 1) li_0 = TRUE; if (li_16 == -1) li_4 = TRUE; if (li_20 == 2) li_8 = TRUE; if (li_20 == -2) li_12 = TRUE; if (EnableExit) { for (int l_pos_24 = 0; l_pos_24 < OrdersTotal(); l_pos_24++) { OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES); if (OrderType() == OP_BUY && OrderMagicNumber() == MagicNumber && li_8) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Yellow); if (OrderType() == OP_SELL && OrderMagicNumber() == MagicNumber && li_12) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Yellow); } } int l_ticket_28 = 0; double l_price_32 = 0; double l_price_40 = 0; if (IsTradeAllowed() && isNewSymbol(MagicNumber) && TimeCurrent() - g_datetime_244 >= 60 * Minutes_Between_Trades || g_datetime_244 == 0) { if (li_0) { if (EnableExit) { l_price_32 = Ask - StopLoss * g_point_248; l_ticket_28 = OrderSend(Symbol(), OP_BUY, Lot_Size, Ask, Slippage, 0, 0, g_comment_236, MagicNumber, 0, Red); if (l_ticket_28 > -1) { Sleep(500); OrderSelect(l_ticket_28, SELECT_BY_TICKET, MODE_TRADES); OrderModify(l_ticket_28, OrderOpenPrice(), l_price_32, 0, 0, Green); } } else { l_price_32 = Ask - StopLoss * g_point_248; l_price_40 = Ask + TakeProfit * g_point_248; l_ticket_28 = OrderSend(Symbol(), OP_BUY, Lot_Size, Ask, Slippage, 0, 0, g_comment_236, MagicNumber, 0, Red); if (l_ticket_28 > -1) { Sleep(500); OrderSelect(l_ticket_28, SELECT_BY_TICKET, MODE_TRADES); OrderModify(l_ticket_28, OrderOpenPrice(), l_price_32, l_price_40, 0, Green); } } g_datetime_244 = TimeCurrent(); } if (li_4) { if (EnableExit) { l_price_32 = Bid + StopLoss * g_point_248; l_ticket_28 = OrderSend(Symbol(), OP_SELL, Lot_Size, Bid, Slippage, 0, 0, g_comment_236, MagicNumber, 0, Green); if (l_ticket_28 > -1) { Sleep(500); OrderSelect(l_ticket_28, SELECT_BY_TICKET, MODE_TRADES); OrderModify(l_ticket_28, OrderOpenPrice(), l_price_32, 0, 0, Green); } } else { l_price_32 = Bid + StopLoss * g_point_248; l_price_40 = Bid - TakeProfit * g_point_248; l_ticket_28 = OrderSend(Symbol(), OP_SELL, Lot_Size, Bid, Slippage, 0, 0, g_comment_236, MagicNumber, 0, Green); if (l_ticket_28 > -1) { Sleep(500); OrderSelect(l_ticket_28, SELECT_BY_TICKET, MODE_TRADES); OrderModify(l_ticket_28, OrderOpenPrice(), l_price_32, l_price_40, 0, Green); } } g_datetime_244 = TimeCurrent(); } } return (0); } int isNewSymbol(int a_magic_0) { for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) { OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == a_magic_0) return (0); } return (1); } int CheckSignal() { string ls_0 = ""; string ls_8 = ""; string ls_16 = ""; string ls_24 = ""; string ls_32 = ""; string ls_40 = ""; string ls_48 = ""; string ls_56 = ""; double l_icustom_64 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 7, gi_104); double l_icustom_72 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 6, gi_104); double l_icustom_80 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 4, gi_104); double l_icustom_88 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 5, gi_104); double l_icustom_96 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 0, gi_104); double l_icustom_104 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 1, gi_104); double l_icustom_112 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 2, gi_104); double l_icustom_120 = iCustom(NULL, PERIOD_M15, "CCI Woodie MTF", gs_116, First_WCCI_CCIPeriod, First_WCCI_TrendPeriod, First_WCCI_TurboCCIPeriod, First_WCCI_LSMAPeriod, First_WCCI_LSMAPrice, 3, gi_104); if (l_icustom_80 == EMPTY_VALUE && l_icustom_88 == 0.0) ls_0 = "red"; if (l_icustom_80 == 0.0 && l_icustom_88 == EMPTY_VALUE) ls_0 = "green"; if (l_icustom_104 == EMPTY_VALUE && l_icustom_112 == EMPTY_VALUE && l_icustom_120 == EMPTY_VALUE) ls_32 = "gray"; if (l_icustom_104 != EMPTY_VALUE && l_icustom_112 == EMPTY_VALUE && l_icustom_120 == EMPTY_VALUE) ls_32 = "blue"; if (l_icustom_104 == EMPTY_VALUE && l_icustom_112 != EMPTY_VALUE && l_icustom_120 == EMPTY_VALUE) ls_32 = "red"; if (l_icustom_104 == EMPTY_VALUE && l_icustom_112 == EMPTY_VALUE && l_icustom_120 != EMPTY_VALUE) ls_32 = "yellow"; double l_icustom_128 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 7, gi_104); double l_icustom_136 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 6, gi_104); double l_icustom_144 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 4, gi_104); double l_icustom_152 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 5, gi_104); double l_icustom_160 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 0, gi_104); double l_icustom_168 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 1, gi_104); double l_icustom_176 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 2, gi_104); double l_icustom_184 = iCustom(NULL, PERIOD_M30, "CCI Woodie MTF", gs_144, Second_WCCI_CCIPeriod, Second_WCCI_TrendPeriod, Second_WCCI_TurboCCIPeriod, Second_WCCI_LSMAPeriod, Second_WCCI_LSMAPrice, 3, gi_104); if (l_icustom_144 == EMPTY_VALUE && l_icustom_152 == 0.0) ls_8 = "red"; if (l_icustom_144 == 0.0 && l_icustom_152 == EMPTY_VALUE) ls_8 = "green"; if (l_icustom_168 == EMPTY_VALUE && l_icustom_176 == EMPTY_VALUE && l_icustom_184 == EMPTY_VALUE) ls_40 = "gray"; if (l_icustom_168 != EMPTY_VALUE && l_icustom_176 == EMPTY_VALUE && l_icustom_184 == EMPTY_VALUE) ls_40 = "blue"; if (l_icustom_168 == EMPTY_VALUE && l_icustom_176 != EMPTY_VALUE && l_icustom_184 == EMPTY_VALUE) ls_40 = "red"; if (l_icustom_168 == EMPTY_VALUE && l_icustom_176 == EMPTY_VALUE && l_icustom_184 != EMPTY_VALUE) ls_40 = "yellow"; double l_icustom_192 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 7, gi_104); double l_icustom_200 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 6, gi_104); double l_icustom_208 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 4, gi_104); double l_icustom_216 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 5, gi_104); double l_icustom_224 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 0, gi_104); double l_icustom_232 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 1, gi_104); double l_icustom_240 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 2, gi_104); double l_icustom_248 = iCustom(NULL, PERIOD_H1, "CCI Woodie MTF", gs_172, Third_WCCI_CCIPeriod, Third_WCCI_TrendPeriod, Third_WCCI_TurboCCIPeriod, Third_WCCI_LSMAPeriod, Third_WCCI_LSMAPrice, 3, gi_104); if (l_icustom_208 == EMPTY_VALUE && l_icustom_216 == 0.0) ls_16 = "red"; if (l_icustom_208 == 0.0 && l_icustom_216 == EMPTY_VALUE) ls_16 = "green"; if (l_icustom_232 == EMPTY_VALUE && l_icustom_240 == EMPTY_VALUE && l_icustom_248 == EMPTY_VALUE) ls_48 = "gray"; if (l_icustom_232 != EMPTY_VALUE && l_icustom_240 == EMPTY_VALUE && l_icustom_248 == EMPTY_VALUE) ls_48 = "blue"; if (l_icustom_232 == EMPTY_VALUE && l_icustom_240 != EMPTY_VALUE && l_icustom_248 == EMPTY_VALUE) ls_48 = "red"; if (l_icustom_232 == EMPTY_VALUE && l_icustom_240 == EMPTY_VALUE && l_icustom_248 != EMPTY_VALUE) ls_48 = "yellow"; double l_icustom_256 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 7, gi_104); double l_icustom_264 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 6, gi_104); double l_icustom_272 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 4, gi_104); double l_icustom_280 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 5, gi_104); double l_icustom_288 = iCustom(NULL, 0, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 0, gi_104); double l_icustom_296 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 1, gi_104); double l_icustom_304 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 2, gi_104); double l_icustom_312 = iCustom(NULL, PERIOD_H4, "CCI Woodie MTF", gs_200, Fourth_WCCI_CCIPeriod, Fourth_WCCI_TrendPeriod, Fourth_WCCI_TurboCCIPeriod, Fourth_WCCI_LSMAPeriod, Fourth_WCCI_LSMAPrice, 3, gi_104); if (l_icustom_272 == EMPTY_VALUE && l_icustom_280 == 0.0) ls_24 = "red"; if (l_icustom_272 == 0.0 && l_icustom_280 == EMPTY_VALUE) ls_24 = "green"; if (l_icustom_296 == EMPTY_VALUE && l_icustom_304 == EMPTY_VALUE && l_icustom_312 == EMPTY_VALUE) ls_56 = "gray"; if (l_icustom_296 != EMPTY_VALUE && l_icustom_304 == EMPTY_VALUE && l_icustom_312 == EMPTY_VALUE) ls_56 = "blue"; if (l_icustom_296 == EMPTY_VALUE && l_icustom_304 != EMPTY_VALUE && l_icustom_312 == EMPTY_VALUE) ls_56 = "red"; if (l_icustom_296 == EMPTY_VALUE && l_icustom_304 == EMPTY_VALUE && l_icustom_312 != EMPTY_VALUE) ls_56 = "yellow"; double l_icustom_320 = iCustom(NULL, 0, "DM_DSR", "Dynamic Support/Resistance", "© 2007, CompassFX, LLC.", "www.compassfx.com", 2, gi_104); RefreshRates(); Comment("SQUARES --> ", ls_0, ":", ls_8, ":", ls_16, ":", ls_24, "\n", "VERTICALS --> ", ls_32, ":", ls_40, ":", ls_48, ":", ls_56, "\n", "First CCI --> ", l_icustom_64, "\n", "Second CCI --> ", l_icustom_128, "\n", "Third CCI --> ", l_icustom_192, "\n", "Real Third CCI --> ", iCCI(NULL, PERIOD_H1, Third_WCCI_TurboCCIPeriod, PRICE_TYPICAL, gi_104), "\n", "Fourth CCI --> ", l_icustom_256, "\n", "Real Fourth CCI --> ", iCCI(NULL, PERIOD_H4, Fourth_WCCI_TurboCCIPeriod, PRICE_TYPICAL, gi_104)); if (strstr(ls_0, "green") && strstr(ls_8, "green") && strstr(ls_16, "green") && strstr(ls_24, "green") && strstr(ls_32, "red") == 0 && strstr(ls_40, "red") == 0 && strstr(ls_48, "red") == 0 && strstr(ls_56, "red") == 0 && l_icustom_72 > 50.0 && l_icustom_136 > 50.0 && l_icustom_200 > 50.0 && l_icustom_264 > 50.0 && l_icustom_192 >= 100.0 && l_icustom_256 >= 80.0 && Close[gi_104] > l_icustom_320 && Close[gi_104] <= l_icustom_320 + DSR_Pips * g_point_248) return (1); if (strstr(ls_0, "red") && strstr(ls_8, "red") && strstr(ls_16, "red") && strstr(ls_24, "red") && strstr(ls_32, "blue") == 0 && strstr(ls_40, "blue") == 0 && strstr(ls_48, "blue") == 0 && strstr(ls_56, "blue") == 0 && l_icustom_72 < -50.0 && l_icustom_136 < -50.0 && l_icustom_200 < -50.0 && l_icustom_264 < -50.0 && l_icustom_192 <= -100.0 && l_icustom_256 <= -80.0 && Close[gi_104] < l_icustom_320 && Close[gi_104] >= l_icustom_320 - DSR_Pips * g_point_248) return (-1); return (0); } int CheckExit() { RefreshRates(); double l_icci_0 = iCCI(NULL, PERIOD_M30, Third_WCCI_TurboCCIPeriod, PRICE_TYPICAL, 1); if (l_icci_0 < 100.0) return (2); if (l_icci_0 > -100.0) return (-2); return (0); } int strstr(string as_0, string as_8) { if (StringFind(as_0, as_8, 0) > -1) return (1); return (0); }