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?
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.
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());
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.
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.
MarketInfo(OrderSymbol(),MODE_ASK) MarketInfo(OrderSymbol(),MODE_BID)
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?