131 | ERR_INVALID_TRADE_VOLUME |
Invalid trade volume |
- Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
- Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is usually wrong, as it is in this case.
- Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.

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
Hi guys,
I am not advanced coder in mql4 but I am learning the basic.
Here I would like to an help about how i have adapt the code that I tested on currencies for index, metals and commodities .
My broker has 5 digits so I fixed SL and TP at xxx points.
examples for German 30 I have this price :12792.78 and spread example 1.10
and I got this error Germany30,M5 and US30: OrderSend error 131
Can someone help to me?
I think is due to different using of digits than currencies.
Thank you