Salut,
J'ai essayé un truc sur ton expert mais le TS a pas l'air de se déclencher. J'ai utilisé un code de ce genre:
Code:
for (I=0;I<OrdersTotal();I++)
{
OrderSelect(I,SELECT_BY_POS);
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY)
{
if (Bid-OrderOpenPrice() > (TS*Point))
{
if (OrderStopLoss() < (Bid - TS*Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-TS*Point,Digits),OrderTakeProfit(),0, Blue);
Print("Order modified for Trailing Stop n°: ",OrderTicket()," || SL to ",NormalizeDouble(Bid-TS*Point,Digits));
}
}
}
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL)
{
if (OrderOpenPrice() - Ask > (TS * Point))
{
if (OrderStopLoss() > (Ask + TS * Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+TS*Point,Digits),OrderTakeProfit(),0, Blue);
Print("Order modified for Trailing Stop n°: ",OrderTicket()," || SL to ",NormalizeDouble(Ask+TS*Point,Digits));
}
}
}
}
Je pense que ce genre de truc devrait fonctionner. J'ai pas trop le temps de tester trop avant ton code pour voir pourquoi ça se déclenche pas, si c'est une erreur dans mon code ou que je l'ai mal adapté, ou tout simplement que dans ma période de test y avait pas de raisons qu'il se déclenche
. Mais ça peut peut-être t'aider.
A+
Cam'