Problem with market orders
Hello
I am having problems trying to get two orders to market at the same price range.
Sometimes it runs only Sell
Other times it runs only Buy
Are you using a USA based Broker ? Hedging is not allowed in the USA.
My broker is alpari UK.
This allowed the hedging
Repeatedly executes the two orders, but I usually run only one
My broker is alpari UK.
This allowed the hedging
Repeatedly executes the two orders, but I usually run only one
What error code do you get from the failed trade ?
RaptorUK:
What error code do you get from the failed trade ?
It does not return any kind of error in the log
It appears as you have not already sent and
It does not return any kind of error in the log
It appears as you have not already sent and
Did you add the code to report the error to the log ?
int ticket = OrderSend(..., 0,0,...) if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else if (!OrderSelect(ticket, SELECT_BY_TICKET)) Alert("OrderSelect failed: ", GetLastError()); else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0) Alert("OrderModify failed: ", GetLastError());
Such as
ok. I will try it
ok. I will try it
The error returned is:
| ERR_INVALID_PRICE | 129 | Invalid price. |
How fix this error?
Hello
I am having problems trying to get two orders to market at the same price range.
Sometimes it runs only Sell
Other times it runs only Buy
Sometimes running the two but less often than individually.
Do not know why this happens.
The code is this:
OrderSend(Symbol(),OP_BUY,0.10,Ask,20,1.3034,0,"My order #2",1,0,Green);
OrderSend(Symbol(),OP_SELL,0.10,Bid,20,1.3532,0,"My order #2",2,0,Green);
thanks for the answers