//+------------------------------------------------------------------+ //| 111.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "" #property link "" l_pos_120 = 0; while (l_pos_120 < OrdersTotal()) { if (OrderSelect(l_pos_120, SELECT_BY_POS) == TRUE) { l_pos_120++; if (l_magic_116 == l_magic_116) { Comment("ЗАКРЫВАЮ"); if (OrderSymbol() == Symbol()) { if (OrderTicket() == l_ticket_388) { if (OrderType() == OP_BUY) { if (IsConnected() == TRUE && IsTradeContextBusy() == FALSE) { if (OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 30, Olive) == 0) { for (int i=0; i<300; i++) { lineбай[i]= "Уровень.бай = "+i; ObjectDelete(lineбай[i]); } l_pos_120--;} else { if (ls_408 == "закр_бай_минус") l_count_324++; if (ls_408 == "закр_бай_плюс") l_count_316++; } } } if (OrderType() == OP_SELL) { if (IsConnected() == TRUE && IsTradeContextBusy() == FALSE) { if (OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 30, Olive) == 0) l_pos_120--; else { if (ls_408 == "закр_селл_минус") l_count_328++; if (ls_408 == "закр_селл_плюс") l_count_320++; } } } } } } } } Comment("ПРОВЕРЯЮ"); if (li_300 <= l_count_316 && li_304 <= l_count_320 && li_308 <= l_count_324 && li_312 <= l_count_328) { Comment("ВЫШЕЛ"); return; } } } if (gi_176 == TRUE) { if (ld_204 < MarketInfo(OrderSymbol(), MODE_ASK) && l_count_140 != 0) li_8 = FALSE; if (ld_212 > MarketInfo(OrderSymbol(), MODE_BID) && l_count_144 != 0) li_12 = FALSE; } else { if (OrdersTotal() > 0) { l_pos_120 = 0; while (l_pos_120 < OrdersTotal()) { if (OrderSelect(l_pos_120, SELECT_BY_POS) == TRUE) { l_pos_120++; if (l_magic_116 == OrderMagicNumber()) { if (OrderType() == OP_BUY && OrderSymbol() == Symbol()) if (OrderOpenPrice() <= MarketInfo(Symbol(), MODE_ASK) && l_count_140 != 0) li_8 = FALSE; if (OrderType() == OP_SELL && OrderSymbol() == Symbol()) if (OrderOpenPrice() >= MarketInfo(Symbol(), MODE_BID) && l_count_144 != 0) li_12 = FALSE; } } } } } if (l_datetime_220 > iTime(Symbol(), Period(), 0)) li_8 = FALSE; if (l_datetime_224 > iTime(Symbol(), Period(), 0)) li_12 = FALSE; if (auto_lot == TRUE && ls_244 == "лот_увеличиваем") { if (li_8 == TRUE) ld_0 = 2.0 * (ld_124 / число_ставок); if (li_12 == TRUE) ld_0 = 2.0 * (ld_132 / число_ставок); } if (auto_lot == TRUE && ls_228 == "первая_завершеная") { if (li_8 == TRUE) ld_0 = ld_124; if (li_12 == TRUE) ld_0 = ld_132; } ld_0 = NormalizeDouble(ld_0, 2); if (ld_0 > MarketInfo(Symbol(), MODE_MAXLOT)) ld_0 = MarketInfo(Symbol(), MODE_MAXLOT); if (ld_0 < MarketInfo(Symbol(), MODE_MINLOT)) ld_0 = MarketInfo(Symbol(), MODE_MINLOT); ld_0 = NormalizeDouble(ld_0, 2); double ld_416 = 0; int l_count_424 = 0; if (OrdersTotal() > 0) { l_pos_120 = 0; while (l_pos_120 < OrdersTotal()) { if (OrderSelect(l_pos_120, SELECT_BY_POS) == TRUE) { l_pos_120++; ld_416 += OrderLots(); l_count_424++; } } } int l_count_428 = 0; int l_count_432 = 0; int li_436 = 1; if (ls_228 != "нулевая") li_436 = число_ставок; if (l_count_424 < максимальное_количество_сделок && ld_416 < максимальный_лот) { if (li_8 == TRUE || li_12 == TRUE) { if (AccountFreeMarginCheck(Symbol(), OP_SELL, ld_0) > 0.0 && AccountFreeMarginCheck(Symbol(), OP_BUY, ld_0) > 0.0) { while (l_count_428 < li_436) { if (звук == TRUE) PlaySound("wait.wav"); if (li_8 == TRUE) { if (OrderSend(Symbol(), OP_BUY, ld_0, MarketInfo(Symbol(), MODE_ASK), 30, 0, 0, "", l_magic_116, 0, Lime) != -1){ l_count_4281++; for (int i=0; i