Lot size errors are among the most common issues encountered in MT5 automated trading. Regardless of whether your strategy involves EAs, trade copying services, or signal providers, improper lot sizes may cause order rejection, high risks during trades, or "Error 131: Invalid Volume" in MetaTrader 5.
Services such as MetaConnector make it easier for traders to automate their MT5 trading process, although configuring volumes correctly remains important nonetheless.
Why MT5 Lot Size Errors Happen
MT5 automation tools calculate trade volume based on:
- Account balance
- Risk percentage
- Leverage
- Broker specifications
- Signal provider settings
Problems occur when the calculated volume does not match the broker’s allowed minimum, maximum, or lot step size.
For example, if your broker only supports 0.01 lot increments, a trade request like 0.033333 lots may be rejected automatically.
1. Check Broker Volume Specifications
Every broker has different contract specifications for trading instruments.
To verify them in MT5:
- Press Ctrl + U
- Select your trading symbol
- Open the Specification tab
Check:
- Minimum lot size
- Maximum lot size
- Volume step
Most brokers support a minimum volume of 0.01 lots with increments of 0.01.
Your EA or automation software must follow these limits exactly.
2. Normalize Lot Size in EA Code
Many MT5 Expert Advisors dynamically calculate lot sizes using account risk formulas. However, these calculations often generate unsupported decimal values.
To fix this, normalize the volume before sending the order.
- Example MQL5 Code
- double min_lot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
- double max_lot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
- double lot_step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
- double final_volume = NormalizeDouble(calculated_volume / lot_step, 0) * lot_step;
This ensures the final trade size matches broker requirements and prevents invalid volume errors.
3. Review Signal and Copy Trading Settings
If you use MT5 copy trading automation, incorrect signal settings may also cause wrong lot sizes.
Go to:
Tools > Options > Signals
Check:
- Deposit load percentage
- Risk scaling
- Fixed or proportional lot settings
- Sometimes the system automatically increases position size based on account balance, creating unwanted exposure.
Solutions like MetaConnector help improve synchronization between signal providers and MT5 accounts.
4. Check MT5 Error Logs
If the issue continues, review the:
- Journal tab
Expert Advisors tab - Look for:
Error 131 (ERR_INVALID_VOLUME)
The logs show the exact lot size requested and why the broker rejected it.
Final Thoughts
Proper lot size fixing for MT5 automation involves ensuring correct broker parameters, risk management, and proper trade volume normalization. Always make sure to double-check broker parameters, signal settings, and check MT5 logs.
Using proper trading software and tools such as MetaConnector with proper lot size management helps minimize mistakes in automated trading.
Sign in to leave a comment.