//+------------------------------------------------------------------+
//| модуль установки ордеров |
//+------------------------------------------------------------------+
if (li_64 == 0 && li_68 == 0 && ld_24 > MaxLoss) { //если
price_112 = NormalizeDouble(Ask + FirstStep * Point, Digits); // то цена =
if (li_56 == 0 ||price_112 < NormalizeDouble(ld_76 - FirstStep * Point, Digits)) {
if (li_56 == 0) lots_120 = lot; // если li_56(бай) не изменилось то лот равен условленному
OrderSend(Symbol(), OP_BUYSTOP, lots_120, price_112, 3, 0, 0, " TStopOrd_T BuyS", Magic, 0, Blue); //посылаем ордер
}
}
if (cmd_72 == OP_SELL && li_60 != 0) { //если
price_112 = NormalizeDouble(Ask + FirstStep * Point, Digits); // то цена =
if (cmd_72 == OP_SELL || price_112 < NormalizeDouble(ld_76 - FirstStep * Point, Digits)) {
if (li_60 != 0 && cmd_72 == OP_SELL )lots_120 = lot * MathPow(K_Lot, li_60) + li_60 * PlusLot; //иначе lot_120 =
OrderSend(Symbol(), OP_BUYSTOP, lots_120, price_112, 3, 0, 0, "TStopOrd_T BuyS ", Magic, 0, Blue); //посылаем ордер
}
}
if (li_68 == 0 && li_64 == 0 && ld_16 > MaxLoss) { //если
price_112 = NormalizeDouble(Bid - FirstStep * Point, Digits); // то цена =
if (li_60 == 0 || price_112 > NormalizeDouble(ld_100 + FirstStep * Point, Digits)) {
if (li_60 == 0) lots_120 = lot; // если li_60 sell не изменилось то лот равен условленному
OrderSend(Symbol(), OP_SELLSTOP, lots_120, price_112, 3, 0, 0, " TStopOrd_T SellS", Magic, 0, Red); //посылаем ордер
}
}
if (cmd_72 == OP_BUY && li_56 != 0) { //если
price_112 = NormalizeDouble(Bid - FirstStep * Point, Digits);
if (cmd_72 == OP_BUY || price_112 > NormalizeDouble(ld_100 + FirstStep * Point, Digits)) {
if (li_56 != 0 && cmd_72 == OP_BUY) lots_120 = lot * MathPow(K_Lot, li_56) + li_56 * PlusLot; //иначе lot_120 =
OrderSend(Symbol(), OP_SELLSTOP, lots_120, price_112, 3, 0, 0, " TStopOrd_T SellS", Magic, 0, Red); //посылаем ордер
}
}
if (cmd_72 == OP_BUYSTOP && li_60 == 1 || lots_120 == lot)OrderDelete(OrderTicket());
if (cmd_72 == OP_SELLSTOP && li_56 == 1 || lots_120 == lot)OrderDelete(OrderTicket());