int gi_76 = 0; extern int MagicNo = 523532; bool gi_84 = FALSE; bool gi_unused_88 = FALSE; double gd_unused_92 = 5.0; extern double Lots = 0.1; extern double Leverage = 0.0; double gd_unused_116 = 100.0; int gi_124 = 1; double gd_128 = 0.0; extern double TakeProfit = 25.0; double g_pips_144 = 10.0; extern double StopLoss = 200.0; double gd_160 = 0.0; bool gi_unused_168 = FALSE; int gi_unused_172 = 2; bool gi_unused_176 = FALSE; double gd_unused_180 = 2.0; bool gi_unused_188 = FALSE; int gi_192 = 10; bool gi_196 = TRUE; extern int Slippage = 3; int gi_204 = 100; int gi_unused_208 = 20; int gi_unused_212 = 288; int g_period_216 = 10; int gi_220 = 20; double gd_unused_224 = 5.0; double gd_unused_232 = 10.0; double gd_unused_240 = 22.0; double gd_unused_248 = 20.0; int gi_unused_256 = 11; double gd_unused_260 = 26.0; double gd_unused_268 = 13.0; double gd_unused_276 = 15.0; double gd_unused_284 = 10.0; double g_maxlot_292; double g_minlot_300; double g_lotstep_308; double gd_316; double g_point_324; int gi_unused_332; int gi_unused_336; int gi_unused_340; int gi_344 = 0; int gi_348 = 0; int init() { if (Point == 0.00001) g_point_324 = 0.0001; else { if (Point == 0.001) g_point_324 = 0.01; else g_point_324 = Point; } return (0); } int deinit() { return (0); } int start() { bool li_8; bool li_12; bool li_16; bool li_20; bool li_24; bool li_28; bool li_32; bool li_36; bool li_40; bool li_44; bool li_48; bool li_52; int li_unused_56; int li_unused_60; int li_unused_64; int li_unused_68; if (AccountNumber() != 600079) { Print("このアカウントでは使用できません。"); return (0); } HideTestIndicators(TRUE); int l_hour_88 = TimeHour(TimeCurrent()); int l_count_92 = 0; int li_unused_96 = 0; int li_unused_100 = 0; int l_count_104 = 0; gi_unused_340 = gi_76; bool li_108 = TRUE; int li_unused_112 = 0; double l_high_116 = High[iHighest(NULL, 0, MODE_HIGH, gi_204, 0)]; double l_low_124 = Low[iLowest(NULL, 0, MODE_LOW, gi_204, 0)]; double l_imacd_132 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0); double l_imacd_140 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1); double l_imacd_148 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, 0); double l_imacd_156 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, 1); double l_imacd_164 = iMACD(NULL, PERIOD_M30, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0); double l_imacd_172 = iMACD(NULL, PERIOD_M30, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1); double l_ima_180 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_HIGH, 0); double l_ima_188 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_HIGH, 1); double l_ima_196 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_LOW, 0); double l_ima_204 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_LOW, 1); double l_ima_212 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 0); double l_ima_220 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 5); double l_ima_228 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 1); double l_ima_236 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 0); double l_ima_244 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 1); double l_ima_252 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 2); double l_ima_260 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, 1); double l_ima_268 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 5); double l_ima_276 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, 0); double l_ima_284 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, 1); double l_ima_292 = iMA(NULL, 0, 100, 0, MODE_SMA, PRICE_CLOSE, 0); double l_istddev_300 = iStdDev(NULL, 0, 100, 0, MODE_SMA, PRICE_CLOSE, 0); double l_istddev_308 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0); double l_istddev_316 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 1); double l_iwpr_324 = iWPR(NULL, 0, 26, 0); double l_iwpr_332 = iWPR(NULL, 0, 26, 1); double l_iwpr_340 = iWPR(NULL, 0, 26, 2); double l_iwpr_348 = iWPR(NULL, 0, 114, 0); double l_iwpr_356 = iWPR(NULL, 0, 114, 1); double l_idemarker_364 = iDeMarker(NULL, 0, 13, 0); double l_idemarker_372 = iDeMarker(NULL, 0, 13, 1); double l_idemarker_380 = iDeMarker(NULL, 0, 13, 2); double l_istochastic_388 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 0); double l_istochastic_396 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 1); double l_istochastic_404 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 0); double l_istochastic_412 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 1); if (l_istochastic_396 < l_istochastic_412 - 5.0 && l_istochastic_388 >= l_istochastic_404) li_16 = TRUE; if (l_istochastic_396 > l_istochastic_412 + 5.0 && l_istochastic_388 <= l_istochastic_404) li_20 = TRUE; if (l_istochastic_396 > l_istochastic_412 && l_istochastic_388 > l_istochastic_404) li_24 = TRUE; if (l_istochastic_396 < l_istochastic_412 && l_istochastic_388 < l_istochastic_404) li_28 = TRUE; double l_istochastic_420 = iStochastic(NULL, PERIOD_M1, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 0); double l_istochastic_428 = iStochastic(NULL, PERIOD_M1, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 1); double l_istochastic_436 = iStochastic(NULL, PERIOD_M1, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 0); double l_istochastic_444 = iStochastic(NULL, PERIOD_M1, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 1); if (l_istochastic_428 < l_istochastic_444 && l_istochastic_420 >= l_istochastic_436) li_unused_56 = 1; if (l_istochastic_428 > l_istochastic_444 && l_istochastic_420 <= l_istochastic_436) li_unused_60 = 1; if (l_istochastic_428 > l_istochastic_444 && l_istochastic_420 > l_istochastic_436) li_unused_64 = 1; if (l_istochastic_428 < l_istochastic_444 && l_istochastic_420 < l_istochastic_436) li_unused_68 = 1; double l_istochastic_452 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_MAIN, 0); double l_istochastic_460 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_MAIN, 1); double l_istochastic_468 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_SIGNAL, 0); double l_istochastic_476 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_SIGNAL, 1); if (l_istochastic_460 < l_istochastic_476 - 5.0 && l_istochastic_452 >= l_istochastic_468) li_32 = TRUE; if (l_istochastic_460 > l_istochastic_476 + 5.0 && l_istochastic_452 <= l_istochastic_468) li_36 = TRUE; if (l_istochastic_460 < l_istochastic_476 && l_istochastic_452 >= l_istochastic_468) li_40 = TRUE; if (l_istochastic_460 > l_istochastic_476 && l_istochastic_452 <= l_istochastic_468) li_44 = TRUE; if (l_istochastic_460 > l_istochastic_476 && l_istochastic_452 > l_istochastic_468) li_48 = TRUE; if (l_istochastic_460 < l_istochastic_476 && l_istochastic_452 < l_istochastic_468) li_52 = TRUE; double l_irsi_484 = iRSI(NULL, 0, 14, PRICE_CLOSE, 0); double l_irsi_492 = iRSI(NULL, 0, 14, PRICE_CLOSE, 1); double l_irsi_500 = iRSI(NULL, 0, 14, PRICE_CLOSE, 2); double ld_unused_508 = 0; if (l_irsi_484 < 30.0) ld_unused_508 = 1; if (l_irsi_484 > 70.0) ld_unused_508 = 2; double l_ibands_516 = iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_LOWER, 1); double l_ibands_524 = iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_LOWER, 2); double l_ibands_532 = iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_UPPER, 1); double l_ibands_540 = iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_UPPER, 2); double l_iadx_548 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_MAIN, 0); double l_iadx_556 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_MAIN, 1); double l_iadx_564 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_PLUSDI, 0); double l_iadx_572 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_PLUSDI, 1); double l_iadx_580 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_MINUSDI, 0); double l_iadx_588 = iADX(NULL, 0, 14, PRICE_HIGH, MODE_MINUSDI, 1); if (l_iadx_564 > l_iadx_580) li_12 = TRUE; if (l_iadx_580 > l_iadx_564) li_8 = TRUE; if (l_iadx_548 < 30.0) { li_8 = FALSE; li_12 = FALSE; } bool li_596 = FALSE; bool li_600 = FALSE; int li_604 = Crossed(l_ima_284, l_ima_228); gi_unused_332 = Slippage; if (gi_192 > gd_160 && gd_160 > 0.0) gi_192 = gd_160; double ld_unused_608 = StopLoss; if (gi_84) gi_196 = FALSE; if (!li_108) return (0); gi_unused_336 = MarketInfo(Symbol(), MODE_STOPLEVEL); g_maxlot_292 = MarketInfo(Symbol(), MODE_MAXLOT); g_minlot_300 = MarketInfo(Symbol(), MODE_MINLOT); g_lotstep_308 = MarketInfo(Symbol(), MODE_LOTSTEP); gd_316 = MarketInfo(Symbol(), MODE_MARGINREQUIRED) * g_lotstep_308; int l_ord_total_616 = OrdersTotal(); if (Bars < 100) return (0); if (AccountFreeMargin() < 100.0 * lotCalculation()) { Print("We have not enough money. Free Margin = ", AccountFreeMargin()); return (0); } if (l_ord_total_616 > 0) { for (int l_pos_620 = 0; l_pos_620 < l_ord_total_616; l_pos_620++) { OrderSelect(l_pos_620, SELECT_BY_POS); if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) { if (OrderMagicNumber() == MagicNo) l_count_104++; } else l_count_92++; if (OrderType() == OP_BUY && !gi_196) li_596 = TRUE; if (OrderType() == OP_SELL && !gi_196) li_600 = TRUE; } } if (l_count_104 < gi_124) { if (l_count_104 > 0) if (TimeCurrent() - OrderOpenTime() < 60.0 * gd_128) return (0); if (li_600 == FALSE) { if (li_24 == TRUE) { if (l_ima_276 > l_ima_284 && l_ima_212 > l_ima_228 + 1.7 * g_point_324 && Open[0] < l_ima_212 + l_istddev_308 && (l_istochastic_452 > l_istochastic_460 && l_istochastic_468 > l_istochastic_476) || (l_istochastic_388 > l_istochastic_396 && l_istochastic_404 > l_istochastic_412) && l_iwpr_324 < -15.0 && l_iwpr_324 > l_iwpr_332 + 3.0 && l_ima_236 > l_ima_212 && Open[0] > l_ima_276) { OrderProcess(1, 1, 1); return (0); } if (l_iwpr_348 > l_iwpr_356 && l_iwpr_348 > -15.0 && l_iwpr_356 > -15.0 && l_iwpr_324 > l_iwpr_332 + 25.0 && l_iwpr_324 < -15.0 && l_iwpr_332 < l_iwpr_340 && l_istddev_308 > l_istddev_316 && l_idemarker_364 > l_idemarker_372 && l_ima_236 > l_ima_268 && l_ima_276 > l_ima_284 && l_iadx_548 > 25.0 && Open[0] < Close[0] && Open[0] > Close[1]) { OrderProcess(1, 1, 1); return (0); } if (Close[1] < l_ima_212 - 3.0 * l_istddev_316 && l_iwpr_324 > l_iwpr_332 + 5.0 && l_iwpr_324 < -75.0 && li_24 && (l_istochastic_388 >= 20.0 && l_istddev_308 > l_istddev_316) || l_iwpr_332 < l_iwpr_340) { OrderProcess(1, 1, 1); return (0); } if (l_ima_180 > l_ima_236 && l_ima_180 > l_ima_188 && l_ima_188 < l_ima_236 && Open[0] > Close[1] && l_ima_212 > l_ima_220 + 2.0 * g_point_324 && Open[1] < Close[1] && l_iwpr_324 > l_iwpr_332 + 7.0 && l_idemarker_364 > l_idemarker_372 && l_iadx_564 > l_iadx_580) { OrderProcess(1, 1, 1); return (0); } if (l_imacd_132 > l_imacd_140 && l_imacd_132 < (-2.5 * g_point_324) && l_imacd_132 > l_imacd_148 && l_imacd_140 < l_imacd_156 && l_iwpr_324 > l_iwpr_332 && li_12 && l_ima_260 > l_ima_244 && l_imacd_164 > l_imacd_172 && Close[1] < Open[0] && Close[1] > Open[1] && l_istddev_308 > l_istddev_316) { OrderProcess(1, 1, 1); return (0); } if (l_iwpr_324 >= -75.0 && l_iwpr_324 > l_iwpr_332 + 9.0 && l_iwpr_332 < l_iwpr_340 - 5.0 && Open[2] < Close[2] && Open[1] > Close[2] && Open[1] < Close[1] && l_istochastic_388 < 70.0 && l_ima_236 > l_ima_244 + 1.0 * g_point_324 && l_iadx_548 > 25.0 && l_iadx_564 > 25.0 && l_ima_260 > l_ima_244) { OrderProcess(1, 1, 1); return (0); } if (li_604 == 1 && l_iadx_564 > 25.0 && l_iwpr_324 > l_iwpr_332 + 12.0 && l_iadx_548 > 25.0 && l_iadx_564 > l_iadx_572 || l_ima_260 > l_ima_244 && l_ima_212 >= l_ima_228 && l_ima_284 < l_ima_268) { OrderProcess(1, 1, 1); return (0); } if (l_ima_276 > l_ima_284 && l_ima_236 > l_ima_244 && l_ima_212 > l_ima_228 && l_ima_212 > l_ima_220 + 5.0 * g_point_324 && l_ima_236 - l_ima_244 > l_ima_212 - l_ima_228 && l_ima_276 - l_ima_212 > l_ima_284 - l_ima_228 && l_iwpr_324 < -15.0 && l_iwpr_324 > l_iwpr_332 + 15.0 && l_ima_276 > l_ima_236 && l_ima_236 > l_ima_212 && Open[0] > l_ima_276) { OrderProcess(1, 1, 1); return (0); } if (Close[1] > l_ima_244 && Open[1] < l_ima_244 && l_ima_260 > l_ima_244 && l_iadx_548 > 30.0 && l_iadx_564 > 25.0 && l_ima_212 > l_ima_220 + 3.0 * g_point_324 && l_istochastic_388 < 75.0 && l_iwpr_324 > l_iwpr_332 + 18.0 && l_iwpr_332 > l_iwpr_340 + 7.0) { OrderProcess(1, 1, 1); return (0); } if (l_iadx_564 > l_iadx_572 && l_iadx_572 < l_iadx_588 && l_iadx_564 >= l_iadx_580 && l_iadx_548 >= 35.0 && l_iadx_564 > 30.0 && l_iwpr_324 > l_iwpr_332 + 15.0) { OrderProcess(1, 1, 1); return (0); } } if (li_16 == TRUE) { if (l_imacd_132 > l_imacd_140 && l_imacd_132 > l_imacd_148 && l_ima_260 > l_ima_244 && li_12 && l_iwpr_324 > l_iwpr_332 + 7.0 && Open[0] > l_ima_276 && l_istochastic_388 > l_istochastic_396 && l_istochastic_404 > l_istochastic_412 + 1.0) { OrderProcess(1, 1, 1); return (0); } if (l_imacd_132 > l_imacd_140 && l_imacd_132 > l_imacd_148 && Open[0] > Close[1] && l_ima_236 < l_ima_244 && l_iwpr_324 > l_iwpr_332 + 9.0 && li_12 && l_ima_260 > l_ima_244) { OrderProcess(1, 1, 1); return (0); } if (l_istochastic_388 < 30.0 && Open[1] > l_ima_204 && Close[1] > l_ima_268 && Open[0] > l_ima_180 && l_ima_236 < l_ima_268 && l_ima_236 < l_ima_244 && l_iwpr_324 > l_iwpr_332 + 5.0) { OrderProcess(1, 1, 1); return (0); } if (Open[1] > l_ima_204 && Open[0] > l_ima_180 && Open[0] < Close[1] && l_iwpr_324 > l_iwpr_332 + 7.0 && l_idemarker_364 > l_idemarker_372 + 0.08 && l_istddev_308 > l_istddev_316) { OrderProcess(1, 1, 1); return (0); } } if (Open[0] > Close[1]) { if (Close[4] < Close[3] && Close[3] > Close[2] && Close[2] > Close[1] && High[1] - Close[1] < Open[1] - Low[1] && l_ima_236 > l_ima_268 + 5.0 * g_point_324 && l_iwpr_324 > l_iwpr_332 + 9.0 && l_iadx_548 > 25.0 && l_iadx_564 > 25.0 && l_imacd_132 > l_imacd_140 && l_iwpr_332 > l_iwpr_340) { OrderProcess(1, 1, 1); return (0); } if (Close[2] < l_ibands_524 && Close[1] > l_ibands_516 && l_istddev_308 > l_istddev_316 && Open[1] < l_ibands_516 && li_48 && l_iwpr_324 > l_iwpr_332 + 9.0 && l_idemarker_364 > l_idemarker_372 && l_ima_260 > l_ima_244 && l_ima_236 < l_ima_212) { OrderProcess(1, 1, 1); return (0); } if (Close[3] > l_ima_268 && Open[2] > l_ima_244 && Open[1] < Close[1] && Open[1] > Close[2] && Close[1] > l_ima_212 + 2.2 * l_istddev_316 && li_24 && l_iwpr_324 > l_iwpr_332 + 7.0 && l_iwpr_324 < -20.0 && l_idemarker_364 > l_idemarker_372) { OrderProcess(1, 1, 1); return (0); } if (l_ima_244 < l_ima_252 - 0.9 * g_point_324 && l_ima_236 > l_ima_244 + 1.0 * g_point_324 && l_ima_236 > l_ima_252 + 0.9 * g_point_324 && l_ima_244 < l_ima_228 && li_24 && l_ima_212 > l_ima_220) { OrderProcess(1, 1, 1); return (0); } } if (l_ima_260 > l_ima_244) { if (l_irsi_492 < l_irsi_500 && l_irsi_484 > l_irsi_492 + 5.0 && l_irsi_492 < 30.0 && l_iadx_548 > 25.0 && l_iadx_564 > 25.0) { OrderProcess(1, 1, 1); return (0); } if (li_32 && Open[1] > l_ima_204 && Open[0] > l_ima_180 && Open[1] < Close[1] && l_ima_212 > l_ima_228 + 1.5 * g_point_324 && l_iadx_548 > 25.0 && l_iadx_564 > 25.0 && l_iwpr_324 > l_iwpr_332 + 9.0) { OrderProcess(1, 1, 1); return (0); } if ((li_40 && l_istochastic_460 < 25.0) || (li_32 && l_istochastic_460 < 30.0) && l_ima_212 > l_ima_228 + 1.5 * g_point_324) { OrderProcess(1, 1, 1); return (0); } } if (Open[1] < Close[1] && Close[2] < l_ima_212 && Close[1] > l_ima_212 && Open[1] > l_ima_276 && Open[0] > l_ima_180 && l_ima_212 > l_ima_220 + 5.0 * g_point_324 && l_iwpr_324 < -5.0 && l_iwpr_324 > l_iwpr_332 + 7.0 && l_idemarker_364 > l_idemarker_372 && l_idemarker_372 > l_idemarker_380) { OrderProcess(1, 1, 1); return (0); } if (li_32 && l_imacd_132 > l_imacd_140 && l_imacd_132 < 0.0 && l_imacd_132 > l_imacd_148 && l_iadx_548 > 25.0 && l_iadx_564 > 25.0 && l_iwpr_324 > l_iwpr_332 + 7.0 && l_istochastic_452 > l_istochastic_460 && l_istochastic_468 > l_istochastic_476 + 1.0) { OrderProcess(1, 1, 1); return (0); } if (l_ima_228 - l_ima_292 < l_ima_212 - l_ima_292 && l_ima_212 < (l_high_116 + l_low_124) / 2.0 - 2.0 * l_istddev_300 && l_ima_212 - l_ima_292 > l_istddev_308 && li_48) { OrderProcess(1, 1, 1); return (0); } if (Group() == 1.0 && (l_istochastic_388 < 40.0 && Open[1] < l_ima_204 && l_ima_212 > l_ima_268 && Open[0] > Close[1] && li_24) || (l_istochastic_460 < 40.0 && l_ima_212 > l_ima_228 && l_ima_260 > l_ima_244 && li_24) || (Open[2] > l_ima_244 && Open[1] < Close[1] && Open[0] > Close[1] && li_24 && l_iwpr_324 > l_iwpr_332 + 7.0 && l_istochastic_388 < 45.0 && l_idemarker_364 > l_idemarker_372 + 0.05) || ((l_iwpr_324 > l_iwpr_332 && li_48) || (l_iwpr_324 > l_iwpr_332 && li_24) && l_istochastic_460 < 40.0 && l_idemarker_364 > l_idemarker_372 + 0.05 && l_ima_244 < l_ima_228) || ((l_iwpr_324 > l_iwpr_332 + 9.0 && l_istochastic_452 < 40.0 && li_48) || (l_iwpr_324 > l_iwpr_332 + 7.0 && l_istochastic_388 < 50.0 && li_24) && l_ima_244 > l_ima_228 && l_ima_212 > l_ima_228 && l_idemarker_364 > l_idemarker_372 + 0.03) || (l_istochastic_388 < 50.0 && li_24 && l_ima_244 > l_ima_252 && l_ima_236 > l_ima_212 && l_ima_276 > l_ima_284 + 1.5 * g_point_324)) { OrderProcess(1, 3, 1); return (0); } if (Group2() == 1.0 && li_24 && l_istochastic_388 < 50.0 && l_iwpr_324 > l_iwpr_332 + 5.0 && ((Open[1] > l_ima_204 && l_ima_236 < l_ima_268) || Open[2] < Close[2] && l_idemarker_364 > l_idemarker_372 + 0.05 && Open[0] > Close[1] && Open[1] > Close[1]) || (l_ima_212 < l_ima_244 && l_ima_276 > l_ima_284 + 1.0 * g_point_324 && Open[0] > Close[1])) { OrderProcess(1, 2, 1); return (0); } if (Group2() == 3.0 && Open[0] > Close[1] && Open[1] < Close[1] && l_iwpr_324 > l_iwpr_332 && li_24) { OrderProcess(1, 2, 1); return (0); } } if (li_596 == FALSE) { if (li_28 == TRUE) { if (l_ima_276 < l_ima_284 && l_ima_212 < l_ima_228 - 1.5 * g_point_324 && Open[0] > l_ima_212 - l_istddev_308 && (l_istochastic_452 < l_istochastic_460 && l_istochastic_468 < l_istochastic_476) || (l_istochastic_388 < l_istochastic_396 && l_istochastic_404 < l_istochastic_412) && l_iwpr_324 > -85.0 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_ima_236 < l_ima_212 && Open[0] < l_ima_276) { OrderProcess(2, 1, 1); return (0); } if (l_iwpr_348 < l_iwpr_356 && l_iwpr_348 < -80.0 && l_iwpr_356 < -80.0 && l_iwpr_324 < l_iwpr_332 - 25.0 && l_iwpr_324 > -85.0 && l_iwpr_332 > l_iwpr_340 && l_istddev_308 > l_istddev_316 && l_idemarker_364 < l_idemarker_372 && l_ima_236 < l_ima_268 && li_28 && l_iadx_548 > 25.0 && Open[0] > Close[0] && Open[0] < Close[1]) { OrderProcess(2, 1, 1); return (0); } if (Close[1] > l_ima_212 + 3.1 * l_istddev_316 && l_iwpr_324 < l_iwpr_332 - 3.0 && l_iwpr_324 > -25.0 && li_28 && (l_istochastic_388 <= 80.0 && l_istddev_308 > l_istddev_316) || l_iwpr_332 > l_iwpr_340) { OrderProcess(2, 1, 1); return (0); } if (l_ima_196 < l_ima_236 && l_ima_196 < l_ima_204 && l_ima_204 > l_ima_236 && Open[0] < Close[1] && l_ima_212 < l_ima_220 - 1.5 * g_point_324 && Open[1] > Close[1] && l_iwpr_324 < l_iwpr_332 - 7.0 && l_idemarker_364 < l_idemarker_372 && l_iadx_580 > l_iadx_564) { OrderProcess(2, 1, 1); return (0); } if (l_imacd_132 < l_imacd_140 && l_imacd_132 > 2.5 * g_point_324 && l_imacd_132 < l_imacd_148 && l_imacd_140 > l_imacd_156 && l_iwpr_324 < l_iwpr_332 && li_8 && l_ima_260 < l_ima_244 && l_imacd_164 < l_imacd_172 && Close[1] > Open[0] && Close[1] < Open[1] && l_istddev_308 > l_istddev_316) { OrderProcess(2, 1, 1); return (0); } if (l_iwpr_324 <= -25.0 && l_iwpr_324 < l_iwpr_332 - 9.0 && l_iwpr_332 > l_iwpr_340 + 5.0 && Open[2] > Close[2] && Open[1] < Close[2] && Open[1] > Close[1] && l_istochastic_388 > 35.0 && l_ima_236 < l_ima_244 - 1.0 * g_point_324 && l_iadx_548 > 25.0 && l_iadx_580 > 25.0 && l_ima_260 < l_ima_244) { OrderProcess(2, 1, 1); return (0); } if (li_604 == 2 && l_iadx_580 > 25.0 && l_iwpr_324 < l_iwpr_332 - 12.0 && l_iadx_548 > 25.0 && l_iadx_580 > l_iadx_588 || l_ima_260 < l_ima_244 && l_ima_212 <= l_ima_228 && l_ima_284 > l_ima_268 && l_istochastic_388 > 25.0) { OrderProcess(2, 1, 1); return (0); } if (l_ima_276 < l_ima_284 && l_ima_236 < l_ima_244 && l_ima_212 < l_ima_228 && l_ima_212 < l_ima_220 - 5.0 * g_point_324 && l_ima_244 - l_ima_236 > l_ima_228 - l_ima_212 && l_ima_212 - l_ima_276 > l_ima_228 - l_ima_284 && l_iwpr_324 > -85.0 && l_iwpr_324 < l_iwpr_332 - 15.0 && l_ima_276 < l_ima_236 && l_ima_236 < l_ima_212 && Open[0] < l_ima_276) { OrderProcess(2, 1, 1); return (0); } if (Close[1] < l_ima_244 && Open[1] > l_ima_244 && l_ima_260 < l_ima_244 && l_iadx_548 > 30.0 && l_iadx_580 > 25.0 && l_ima_212 < l_ima_220 - 3.0 * g_point_324 && l_istochastic_388 > 25.0 && l_iwpr_324 < l_iwpr_332 - 18.0 && l_iwpr_332 < l_iwpr_340 - 7.0) { OrderProcess(2, 1, 1); return (0); } if (l_iadx_580 > l_iadx_588 && l_iadx_572 > l_iadx_588 && l_iadx_564 <= l_iadx_580 && l_iadx_548 >= 35.0 && l_iadx_580 > 30.0 && l_iwpr_324 < l_iwpr_332 - 15.0 && li_28) { OrderProcess(2, 1, 1); return (0); } } if (li_20 == TRUE) { if (l_imacd_132 < l_imacd_140 && l_imacd_132 < l_imacd_148 && l_ima_260 < l_ima_244 && li_8 && l_iwpr_324 < l_iwpr_332 - 7.0 && Open[0] < l_ima_276 && l_istochastic_388 < l_istochastic_396 && l_istochastic_404 < l_istochastic_412 - 1.0) { OrderProcess(2, 1, 1); return (0); } if (l_imacd_132 < l_imacd_140 && l_imacd_132 < l_imacd_148 && Open[0] < Close[1] && l_ima_236 > l_ima_244 && l_iwpr_324 < l_iwpr_332 - 9.0 && li_8 && l_ima_260 < l_ima_244) { OrderProcess(2, 1, 1); return (0); } if (l_istochastic_388 > 70.0 && Open[1] < l_ima_188 && Close[1] < l_ima_268 && Open[0] < l_ima_196 && l_ima_236 > l_ima_268 && l_ima_236 > l_ima_244 && l_iwpr_324 < l_iwpr_332 - 5.0) { OrderProcess(2, 1, 1); return (0); } if (Open[1] < l_ima_188 && Open[0] < l_ima_196 && Open[0] > Close[1] && l_iwpr_324 < l_iwpr_332 - 7.0 && l_idemarker_364 < l_idemarker_372 - 0.08 && l_istddev_308 > l_istddev_316) { OrderProcess(2, 1, 1); return (0); } } if (Open[0] < Close[1]) { if (Close[4] > Close[3] && Close[3] < Close[2] && Close[2] < Close[1] && Close[1] - Low[1] < High[1] - Open[1] && l_ima_236 < l_ima_268 - 5.0 * g_point_324 && l_iwpr_324 < l_iwpr_332 - 9.0 && l_iadx_548 > 25.0 && l_iadx_580 > 25.0 && l_iwpr_332 < l_iwpr_340) { OrderProcess(2, 1, 1); return (0); } if (Close[2] > l_ibands_540 && Close[1] < l_ibands_532 && l_istddev_308 > l_istddev_316 && Open[1] > l_ibands_532 && li_52 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_idemarker_364 < l_idemarker_372 - 0.05 && l_ima_260 < l_ima_244 && l_ima_236 > l_ima_212) { OrderProcess(2, 1, 1); return (0); } if (Close[3] < l_ima_268 && Open[2] < l_ima_244 && Open[1] > Close[1] && Open[1] < Close[2] && Close[1] < l_ima_212 - 2.2 * l_istddev_316 && li_28 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_iwpr_324 > -85.0 && l_idemarker_364 < l_idemarker_372) { OrderProcess(2, 1, 1); return (0); } if (l_ima_244 > l_ima_252 + 0.9 * g_point_324 && l_ima_236 < l_ima_244 - 1.0 * g_point_324 && l_ima_236 < l_ima_252 - 0.9 * g_point_324 && l_ima_244 > l_ima_228 && li_28 && l_ima_212 < l_ima_220) { OrderProcess(2, 1, 1); return (0); } } if (l_ima_260 < l_ima_244) { if (l_irsi_492 > l_irsi_500 && l_irsi_484 < l_irsi_492 - 5.0 && l_irsi_492 > 70.0 && l_iadx_548 > 25.0 && l_iadx_580 > 25.0) { OrderProcess(2, 1, 1); return (0); } if (li_36 && Open[1] < l_ima_188 && Open[0] < l_ima_196 && Open[1] > Close[1] && l_ima_212 < l_ima_228 - 1.5 * g_point_324 && l_iadx_548 > 25.0 && l_iadx_580 > 25.0 && l_iwpr_324 < l_iwpr_332 - 9.0) { OrderProcess(2, 1, 1); return (0); } if ((li_44 && l_istochastic_460 > 75.0) || (li_36 && l_istochastic_460 > 70.0) && l_ima_212 < l_ima_228 - 1.5 * g_point_324) { OrderProcess(2, 1, 1); return (0); } } if (Open[1] > Close[1] && Close[2] > l_ima_212 && Close[1] < l_ima_212 && Open[1] < l_ima_276 && Open[0] < l_ima_196 && l_ima_212 < l_ima_220 - 5.0 * g_point_324 && l_iwpr_324 > -95.0 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_idemarker_364 < l_idemarker_372 && l_idemarker_372 < l_idemarker_380) { OrderProcess(2, 1, 1); return (0); } if (li_36 && l_imacd_132 < l_imacd_140 && l_imacd_132 > 0.0 && l_imacd_132 < l_imacd_148 && l_iadx_548 > 25.0 && l_iadx_580 > 25.0 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_istochastic_452 < l_istochastic_460 && l_istochastic_468 < l_istochastic_476 - 1.0) { OrderProcess(2, 1, 1); return (0); } if (l_ima_228 - l_ima_292 > l_ima_212 - l_ima_292 && l_ima_212 > (l_high_116 + l_low_124) / 2.0 + 2.0 * l_istddev_300 && l_ima_292 - l_ima_212 > l_istddev_308 && li_52) { OrderProcess(2, 1, 1); return (0); } if (Group() == 2.0 && (l_istochastic_388 > 60.0 && Open[1] > l_ima_188 && l_ima_212 < l_ima_268 && Open[1] < Close[1] && Open[0] < Close[1] && li_28) || (l_istochastic_460 > 60.0 && l_ima_212 < l_ima_228 && l_ima_260 < l_ima_244 && li_28) || (Open[2] < l_ima_244 && Open[1] > Close[1] && Open[0] < Close[1] && li_28 && l_iwpr_324 < l_iwpr_332 - 7.0 && l_istochastic_388 > 55.0 && l_idemarker_364 < l_idemarker_372 - 0.05) || ((l_iwpr_324 < l_iwpr_332 && li_52) || (l_iwpr_324 < l_iwpr_332 - 7.0 && li_28) && l_istochastic_460 > 40.0 && l_idemarker_364 < l_idemarker_372 - 0.05 && l_ima_244 > l_ima_228) || ((l_iwpr_324 < l_iwpr_332 - 9.0 && l_istochastic_452 > 60.0 && li_52) || (l_iwpr_324 < l_iwpr_332 - 7.0 && l_istochastic_388 > 40.0 && li_28) && l_ima_244 < l_ima_228 && l_ima_212 < l_ima_228 && l_idemarker_364 < l_idemarker_372 - 0.05) || (l_istochastic_388 > 50.0 && li_28 && l_ima_244 < l_ima_252 && l_ima_236 < l_ima_244 && l_ima_276 < l_ima_284 - 1.5 * g_point_324)) { OrderProcess(2, 3, 1); return (0); } if (Group2() == 2.0 && li_28 && l_istochastic_388 > 50.0 && l_iwpr_324 < l_iwpr_332 - 5.0 && ((Open[1] < l_ima_188 && l_ima_236 > l_ima_268) || Open[2] > Close[2] && Open[0] < Close[1] && Open[1] < Close[1] && l_idemarker_364 < l_idemarker_372 - 0.05) || (l_ima_212 > l_ima_244 && l_ima_276 < l_ima_284 - 1.0 * g_point_324)) { OrderProcess(2, 2, 1); return (0); } if (Group2() == 4.0 && Open[0] < Close[1] && Open[1] > Close[1] && l_iwpr_324 < l_iwpr_332 && li_28) { OrderProcess(2, 2, 1); return (0); } } } return (0); } double Group() { double l_ima_0; double l_ima_8; double l_ima_16; double l_istddev_24; double ld_32 = 0; double ld_40 = 0; double ld_48 = 0; double ld_56 = 0; double ld_unused_64 = 0; double ld_unused_72 = 0; double ld_80 = 0; double ld_88 = 0; double ld_96 = 0; double ld_104 = 0; double ld_112 = 0; double ld_unused_120 = 0; double ld_128 = 0; double ld_136 = 0; double ld_144 = 0; double ld_152 = 0; double l_ima_160 = iMA(NULL, 0, g_period_216, 0, MODE_SMA, PRICE_CLOSE, 0); for (int li_168 = 1; li_168 <= g_period_216; li_168++) { l_ima_0 = iMA(NULL, 0, g_period_216, 0, MODE_SMA, PRICE_CLOSE, li_168); l_ima_8 = iMA(NULL, 0, g_period_216, 0, MODE_SMA, PRICE_HIGH, li_168); l_ima_16 = iMA(NULL, 0, g_period_216, 0, MODE_SMA, PRICE_LOW, li_168); l_istddev_24 = iStdDev(NULL, 0, g_period_216, 0, MODE_SMA, PRICE_CLOSE, li_168); ld_32 += (High[li_168] + Low[li_168]) / 2.0; ld_40 += Close[li_168]; ld_48 += ld_32 - ld_40; ld_56 += l_ima_0; ld_104 += l_istddev_24; ld_128 += Close[li_168] - Open[li_168] - (Close[li_168 - 1] - (Open[li_168 - 1])); ld_152 = ld_152 + (l_ima_8 - l_ima_0) + (l_ima_16 - l_ima_0); } ld_80 = ld_32 / g_period_216; ld_88 = ld_40 / g_period_216; ld_96 = ld_56 / g_period_216; ld_112 = ld_104 / g_period_216; ld_144 = ld_48 / g_period_216; ld_136 = ld_128 / g_period_216; if (ld_144 > 0.0 && l_ima_160 > ld_96 && ld_136 > 0.0 && Open[0] < l_ima_160 + ld_112 && Open[0] > l_ima_160) return (1); if (ld_144 < 0.0 && l_ima_160 < ld_96 && ld_136 < 0.0 && Open[0] > l_ima_160 - ld_112 && Open[0] < l_ima_160) return (2); return (0.0); } double Group2() { double ld_0 = 0; double ld_8 = 0; double ld_16 = 0; double ld_24 = 0; double ld_32 = 0; double ld_40 = 0; double ld_48 = 0; double ld_56 = 0; double ld_64 = 0; double l_istddev_72 = 0; double ld_80 = 0; double ld_88 = 0; double ld_96 = 0; l_istddev_72 = iStdDev(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, 0); double l_istddev_104 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0); double l_ima_112 = iMA(NULL, PERIOD_M30, 10, 0, MODE_SMA, PRICE_CLOSE, 0); double l_ima_120 = iMA(NULL, PERIOD_M30, 10, 0, MODE_SMA, PRICE_CLOSE, 1); double l_ima_128 = iMA(NULL, PERIOD_M30, 10, 0, MODE_SMA, PRICE_CLOSE, 2); for (int li_136 = 1; li_136 <= gi_220; li_136++) { ld_0 += Close[li_136]; ld_8 += High[li_136] - Low[li_136]; ld_16 += Close[li_136] - Open[li_136]; if (li_136 <= 10) { ld_80 += Close[li_136]; ld_88 += High[li_136] - Low[li_136]; ld_96 += Close[li_136] - Open[li_136]; } } ld_24 = ld_0 / gi_220; ld_32 = ld_8 / gi_220; ld_40 = ld_16 / gi_220; double ld_140 = ld_80 / 10.0; double ld_148 = ld_88 / 10.0; double ld_156 = ld_96 / 10.0; ld_64 = (Open[0] - ld_140) / l_istddev_72; double ld_164 = (Open[0] - ld_24) / l_istddev_104; ld_48 = ld_140 + 0.308 * ld_148; double ld_172 = ld_24 + 0.18 * ld_32; ld_56 = ld_140 - 0.308 * ld_148; double ld_180 = ld_24 - 0.18 * ld_32; if ((l_ima_112 - l_ima_128 > l_ima_120 - l_ima_128 + 2.0 * g_point_324 && ld_156 > 0.0 && ld_96 > 0.0 && Open[0] > ld_56 && Open[0] <= ld_140 + ld_64 * ld_156 && ld_64 < 0.0 && High[1] - Low[1] < 1.777 * ld_148) || (l_ima_112 - l_ima_128 > l_ima_120 - l_ima_128 + 2.0 * g_point_324 && ld_40 > 0.0 && ld_16 > 0.0 && Open[0] > ld_180 && Open[0] <= ld_24 + ld_64 * ld_40 && ld_164 < 0.0 && High[1] - Low[1] < 1.586 * ld_148)) return (1); if ((l_ima_112 - l_ima_128 < l_ima_120 - l_ima_128 - 2.0 * g_point_324 && ld_156 < 0.0 && ld_96 < 0.0 && Open[0] < ld_48 && Open[0] >= ld_140 + ld_64 * ld_156 && ld_64 > 0.0 && High[1] - Low[1] < 1.777 * ld_148) || (l_ima_112 - l_ima_128 < l_ima_120 - l_ima_128 - 2.0 * g_point_324 && ld_40 < 0.0 && ld_16 < 0.0 && Open[0] < ld_172 && Open[0] >= ld_24 + ld_64 * ld_40 && ld_164 > 0.0 && High[1] - Low[1] < 1.586 * ld_148)) return (2); if (l_ima_112 - l_ima_128 > l_ima_120 - l_ima_128 + 2.0 * g_point_324 && ld_40 > 0.0 && ld_16 > 0.0 && Open[0] > ld_180 && Open[0] <= ld_24 + ld_64 * ld_40 && ld_164 < 0.0 && High[1] - Low[1] > 1.586 * ld_148) return (3); if (l_ima_112 - l_ima_128 < l_ima_120 - l_ima_128 - 2.0 * g_point_324 && ld_40 < 0.0 && ld_16 < 0.0 && Open[0] < ld_172 && Open[0] >= ld_24 + ld_64 * ld_40 && ld_164 > 0.0 && High[1] - Low[1] > 1.586 * ld_148) return (4); return (0.0); } int Crossed(double ad_0, double ad_8) { if (ad_0 > ad_8) gi_348 = 1; if (ad_0 < ad_8) gi_348 = 2; if (gi_348 != gi_344) { gi_344 = gi_348; return (gi_344); } return (0); } double lotCalculation() { double ld_ret_48; string ls_56; double ld_64; int li_0 = 1; double ld_4 = 0; int li_12 = 0; double l_lotsize_16 = MarketInfo(Symbol(), MODE_LOTSIZE); double l_maxlot_24 = MarketInfo(Symbol(), MODE_MAXLOT); double l_minlot_32 = MarketInfo(Symbol(), MODE_MINLOT); double l_free_magrin_40 = AccountFreeMargin(); if (Leverage == 0.0) ld_ret_48 = Lots; else { ls_56 = AccountCurrency(); if (ls_56 == "JPY") li_0 = 100; if (ls_56 == "USD") li_0 = 1; ld_64 = l_free_magrin_40 * Leverage / (li_0 * l_lotsize_16); if (l_minlot_32 >= 1.0) li_12 = 0; else { if (l_minlot_32 >= 0.1) li_12 = 1; else if (l_minlot_32 >= 0.01) li_12 = 2; } ld_4 = NormalizeDouble(ld_64, li_12); if (ld_4 < l_minlot_32) ld_4 = l_minlot_32; if (ld_4 > l_maxlot_24) ld_4 = l_maxlot_24; ld_ret_48 = ld_4; } return (ld_ret_48); } int OrderProcess(int ai_0, int ai_4, int ai_8) { int l_ticket_12; double ld_16 = StopLoss; double l_price_24 = 0; double l_price_32 = 0; double l_istddev_40 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0); double l_istddev_48 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 1); int l_slippage_56 = Slippage; if (ai_0 == 1) { if (ai_8 == 1) l_ticket_12 = OrderSend(Symbol(), OP_BUY, lotCalculation(), Ask, l_slippage_56, 0, 0, "Buster", MagicNo, 0, Blue); if (l_ticket_12 > 0) { if (OrderSelect(l_ticket_12, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); if (!gi_84) { if (ld_16 > 0.0) l_price_24 = Ask - StopLoss * g_point_324; if (ld_16 <= 0.0) l_price_24 = 0; if (TakeProfit > 0.0 && ai_4 == 1) l_price_32 = Ask + TakeProfit * g_point_324; if (g_pips_144 > 0.0 && ai_4 == 2) l_price_32 = Ask + (l_istddev_40 + l_istddev_48) / 2.0 + g_pips_144 * g_point_324; if (g_pips_144 > 0.0 && ai_4 == 3) l_price_32 = Ask + g_pips_144 * g_point_324; if (l_price_24 > 0.0 || l_price_32 > 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, l_price_32, 0, CLR_NONE); } } else Print("Error opening BUY order : ", GetLastError()); } else { if (ai_0 == 2) { if (ai_8 == 1) l_ticket_12 = OrderSend(Symbol(), OP_SELL, lotCalculation(), Bid, l_slippage_56, 0, 0, "Buster", MagicNo, 0, Red); if (l_ticket_12 > 0) { if (OrderSelect(l_ticket_12, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); if (!gi_84) { if (ld_16 > 0.0) l_price_24 = Bid + StopLoss * g_point_324; if (ld_16 <= 0.0) l_price_24 = 0; if (TakeProfit > 0.0 && ai_4 == 1) l_price_32 = Bid - TakeProfit * g_point_324; if (g_pips_144 > 0.0 && ai_4 == 2) l_price_32 = Bid - (l_istddev_40 + l_istddev_48) / 2.0 - g_pips_144 * g_point_324; if (g_pips_144 > 0.0 && ai_4 == 3) l_price_32 = Bid - g_pips_144 * g_point_324; if (l_price_24 > 0.0 || l_price_32 > 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, l_price_32, 0, CLR_NONE); } } else Print("Error opening SELL order : ", GetLastError()); } } return (0); }