//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CandleTrailing(int count)
{
bool mod;
double sl=0;
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
sl=NormalizeDouble(iLow(NULL,PERIOD_D1,count)-111*Point,Digits);
if(Bid>sl)
{
if(OrderStopLoss()<sl && OrderOpenPrice()<sl)
{
if(OrderStopLoss()!=sl) mod=OrderModify(OrderTicket(),OrderOpenPrice(),sl,OrderTakeProfit(),0,Yellow);
return;
}
}
}
if(OrderType()==OP_SELL)
{
sl=NormalizeDouble(iHigh(NULL,PERIOD_D1,count)+111*Point,Digits);
if(Ask<sl && OrderOpenPrice()>sl)
{
if(OrderStopLoss()>sl || OrderStopLoss()==0)
{
if(OrderStopLoss()!=sl) mod=OrderModify(OrderTicket(),OrderOpenPrice(),sl,OrderTakeProfit(),0,Yellow);
return;
}
}
}
}
}
}
}
не много под градусом
Значение OPEN фиксируется только 1 раз на той свече, на которой поставлен ордер, на свече входа.</blockquote
этого не было в тз
а было вот что и не пишите что это подразумевалось![]()
Советник фиксирует в своих «мозгах» точку OPEN текущей свечи
посмотрю еще в праздники
AM2