vulcano:
Are you using a USA based Broker ? Hedging is not allowed in the USA.
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
RaptorUK:
Are you using a USA based Broker ? Hedging is not allowed in the USA.
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
vulcano:
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
vulcano:
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 ?
It does not return any kind of error in the log
It appears as you have not already sent and
RaptorUK:
Did you add the code to report the error to the log ?
Such asDid 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());
WHRoeder:
Such as
Such as
ok. I will try it
vulcano:
If you had tried it when I suggested it you would already know what your issue is and have already fixed it . . .
ok. I will try it
vulcano:
Without seeing more of your code it is very hard to say why you are getting this error . . . . it is most likely that the Bid or Ask has become out of date . . . try adding a RefreshRates(); before the OrderSend() lines . . .
The error returned is:
ERR_INVALID_PRICE | 129 | Invalid price. |
How fix this error?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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