Error 131 means Invalid Stops.
Check the STOPLEVEL values. Maybe the SopLoss is smaller than the StopLevel
Or if the IG is STP broker (I don't know) you should use the OrderSend command in 2 steps.
Step 1: Send OrderSend command with SL=0 and TP=0,
Step 2 Use OrderModify to set the correct SL and TP.
If the EA is not your own - report the problem to the author. He has to modify the EA.
BR
AlgoGURU
Don't call MarketInfo in OnInit. Don't try to use any price or server related functions in
OnInit (or on load,) as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.

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,
This happened in broker only.
When placing order on real account thru EA getting OrderSend Error 131 Demo account is working fine. I believe the reason for the error that: MODE_MINLOT, MODE_LOTSTEP and MODE_MAXLOT are all 0.0
Prints results:
Print("MODE_LOTSIZE = ", MarketInfo(Symbol(),MODE_LOTSIZE), ", Symbol = ", Symbol());
Print("MODE_MINLOT = ", MarketInfo(Symbol(),MODE_MINLOT), ", Symbol = ", Symbol());
Print("MODE_LOTSTEP = ", MarketInfo(Symbol(),MODE_LOTSTEP), ", Symbol = ", Symbol());
Print("MODE_MAXLOT = ", MarketInfo(Symbol(),MODE_MAXLOT), ", Symbol = ", Symbol());
Real account:
MODE_LOTSIZE = 100000.0
MODE_MINLOT = 0.0
MODE_LOTSTEP = 0.0
MODE_MAXLOT = 0.0
Demo account:
MODE_LOTSIZE = 100000.0
MODE_MINLOT = 0.01
MODE_LOTSTEP = 0.01
MODE_MAXLOT = 50.0
EA working fine on forex.com real account.
Any advise?
Thank you