Во-вторых: кто-то явно льстит себе

int start()
{
// if (TrailingStop!=0) Trailing();
int res, b = 0, s = 0, p = 0;
//ИНДИКАТОР RSI
double RSI0 = iRSI(NULL, 0, 5, PRICE_CLOSE, 0);
double RSI1 = iRSI(NULL, 0, 5, PRICE_CLOSE, 1);
// СИГНАЛЫ
bool signal_buy = (RSI0 > 50 && RSI1 < 50);
bool signal_sell = (RSI0 < 50 && RSI1 > 50);
for (int i = 0; i < OrdersTotal(); i++)
{
if (OrderSelect(i, SELECT_BY_POS) == false || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic) continue;
if (OrderType() == OP_BUY || OrderType() == OP_SELL) p++;
if (OrderType() == OP_BUYSTOP)
{
if ( signal_sell && OrderDelete(OrderTicket()) ) continue;
else b++;
}
if (OrderType() == OP_SELLSTOP)
{
if ( signal_buy && OrderDelete(OrderTicket()) ) continue;
else s++;
}
}
// buy stop
if(signal_buy && p < 1 && b < 1)
{
double BuyPrice = Ask + Delta * Point;
res = OrderSend(Symbol(), OP_BUYSTOP, LOT, BuyPrice, 0, BuyPrice - StopLoss * Point, BuyPrice + TakeProfit * Point, "ОТЛОЖКИ", Magic, 0, Blue);
/* if (res < 0) error(); */
}
// sell stop
if(signal_sell && p < 1 && s < 1)
{
double SellPrice = Bid - Delta * Point;
res = OrderSend(Symbol(), OP_SELLSTOP, LOT, SellPrice, 0, SellPrice + StopLoss * Point, SellPrice - TakeProfit * Point, "ОТЛОЖКИ", Magic, 0, Red);
/* if (res < 0) error(); */
}
//----
return(0);
}
guest111