Your issue is likely due to:
Incorrect pip value assumption — pipValue = 10.0 is hardcoded and only valid for some symbols like EURUSD.
Wrong pip conversion — dividing by (_Point * 10) is not reliable across all instruments (e.g. gold, indices).
This causes wrong lot sizes (like 0.2 lots) during Market verification.
Fix:
Use dynamic pip value and correct pip calculation:
double CalculateRiskLot(double sl, double entry) { double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE); double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double contractSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_CONTRACT_SIZE); double risk = AccountInfoDouble(ACCOUNT_BALANCE) * RiskPercent / 100.0; double slDistance = MathAbs(entry - sl); double pipValue = (tickValue / tickSize) * _Point; double lotValue = risk / (slDistance * pipValue); double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); double stepLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); double lot = MathMax(minLot, lotValue); lot = MathFloor(lot / stepLot) * stepLot; lot = NormalizeDouble(lot, 2); return lot; }
This handles different symbol types correctly and avoids Market rejection.
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. When I want to load an EA in mql market, during verification it gives me some errors that give me a headache.
The first time it gave me Risk lot calculation, then I modified the code and another error appears with trade opened 0.2 lot.