You have to normalize your price. See documentation of OrderSend.
Calculated or unnormalized price cannot
be applied. If there has not been the requested open price in the price
thread or it has not been normalized according to the amount of digits
after decimal point, the error 129 (ERR_INVALID_PRICE) will be
generated.
niqmadu: I might send an order with a take profit or a stop loss of say 125 points which would be translated to 12.5 points for the 4 digit broker. So adding that to the four digit price would give five digits and might cause an error. Is it typical to just limit the tp or sl on a five digit broker to a multiple of 10 and truncate or round that extra digit off?
- You have to adjust for 4/5 digit brokers Pips to points so your original SL of 12.5 Pips becomes 125 points on a 5 and 12.5 points on a four.
- You don't need to normalize price, except for pending order open price.
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
Just that question. Am adding 4/5 digit broker detection to an ea I wrote on a 5 digit broker. On the 5 digit broker I might send an order with a take profit or a stop loss of say 125 points which would be translated to 12.5 points for the 4 digit broker. So adding that to the four digit price would give five digits and might cause an error. Is it typical to just limit the tp or sl on a five digit broker to a multiple of 10 and truncate or round that extra digit off?
Thanks,