Is it a Requote?

 

I see these failed trades with invalid t/p or s/l the code could never have set. I notice these failed trades happen during volatile markets,

I think they are Requotes, are they not?


 
Ndumiso Mavuso:

I see these failed trades with invalid t/p or s/l the code could never have set. I notice these failed trades happen during volatile markets,

I think they are Requotes, are they not?


If it was a requote you would get a requote message. It's a bug in your code, the TP is above SL for SELL and below for BUY, should be the reverse.
 
Alain Verleyen:
If it was a requote you would get a requote message. It's a bug in your code, the TP is above SL for SELL and below for BUY, should be the reverse.
But the code works fine 98% of the time without these error. Are you still confident that its a Bug that happen to come and go?
 

This is the code. I do not Modify the Orders after.

  extern double Stoploss=4;
  extern double TakeProfit=20;

if(!OrderSend(Symbol(),OP_BUY,lot,NormalizeDouble(MarketInfo(OrderSymbol(),MODE_ASK),Digits),Slippage,NormalizeDouble(MarketInfo(OrderSymbol(),MODE_BID)-StopLoss*UsePoint,Digits),NormalizeDouble(Bid+TakeProfit*UsePoint,Digits),NULL,MagicNumber))
  Print("Open Buy Failed",GetLastError());

  if(!OrderSend(Symbol(),OP_SELL,lot,NormalizeDouble(MarketInfo(OrderSymbol(),MODE_BID),Digits),Slippage,NormalizeDouble(MarketInfo(OrderSymbol(),MODE_ASK)+StopLoss*UsePoint,Digits),NormalizeDouble(Ask-TakeProfit*UsePoint,Digits),NULL,MagicNumber))
  Print("Open Sell Failed",GetLastError()); 
 
Ndumiso Mavuso:
But the code works fine 98% of the time without these error. Are you still confident that its a Bug that happen to come and go?

Of course it's a bug. Working 98% is irrelevant, a bug doesn't have to occur all the time.

The snippet of code you posted is not enough to figure out the issue.

 
Alain Verleyen:

Of course it's a bug. Working 98% is irrelevant, a bug doesn't have to occur all the time.

The snippet of code you posted is not enough to figure out the issue.

But its a simple code, this is the snippet that send orders nonthing else interferes with them.

The other thing is that I do not get the "Open Buy Failed" Print, why is that?
 
Yes it was a Bug. Had to replace Ask/Bid with:
MarketInfo(OrderSymbol(),MODE_ASK)

MarketInfo(OrderSymbol(),MODE_BID)
Reason: