Camovia Tray™

Blog · Knowledge

MT4 Error 131: What Causes "Invalid Trade Volume" and How to Fix It

Camovia Tray Team · 2026-09-15

You've just spent hours fine-tuning your Expert Advisor. You're confident in your strategy, the backtest looked promising, and you're ready to go live. You hit the "AutoTrading" button, watch the Journal tab—and then you see it: OrderSend error 131. The trade didn't go through.

It's a frustrating moment, especially when you're in the middle of analyzing charts and managing your open positions. You double-check your lot size. 0.1, standard. That should work, right?

Not necessarily. Error 131, defined in the MQL4 reference as ERR_INVALID_TRADE_VOLUME, is one of the most common stumbling blocks for traders, but it's usually straightforward to fix. It simply means the lot size you're trying to trade doesn't match what your broker allows for that specific instrument.

Why Does Error 131 Happen?

The core issue is a mismatch between your order volume and the broker's specifications. Think of it like trying to fit a square peg into a round hole. The trading server checks your requested lot size against three key rules, and if any fail, it rejects the order with error 131:

  1. Lot Size Below Minimum: Most brokers require a minimum of 0.01 lots for standard accounts. If your EA tries to send 0.001 (some code might accidentally use an integer instead of a double), you'll instantly get this error.
  2. Lot Size Above Maximum: Some brokers set a maximum lot size per trade. Requesting 100 lots on an account that caps at 50 will trigger the same error.
  3. Lot Step Violation: The lot size must be a multiple of the broker's "lot step." If the step is 0.01, you can trade 0.01, 0.02, or 0.03; but you can't trade 0.015.

A Common Scenario: EA vs. Broker Specifications

Imagine you've developed or purchased an Expert Advisor. It's been tested on a demo account with one broker, working perfectly. You then move it to a live account with a different broker, and suddenly, it starts failing with error 131.

This is a classic situation. The EA's code might have a fixed lot size of 0.1. However, your new broker might not allow 0.1 lots for the specific pair you're trading. For instance, some brokers have a minimum lot size of 1.0, or they might have a different lot step. Your EA, built for one environment, is now incompatible with another.

How to Fix MT4 Error 131

Here's how to get your EA back on track:

  1. Check the Broker's Specifications: In your MT4 terminal, right-click on the symbol you're trying to trade (e.g., EURUSD) and select "Specification". A window will pop up showing the Volume Min, Volume Max, and Volume Step. These are your golden rules.
  2. Normalize Your Lot Size in Your EA: The most robust fix is to have your EA automatically adjust the lot size to match these specifications before it sends an order. This is called "normalizing" the volume.

A simple MQL4 function for this would look like:

double NormalizeLotSize(double requestedLots, string symbol = "") {
   if (symbol == "") symbol = Symbol();
   double lotStep = MarketInfo(symbol, MODE_LOTSTEP);
   double minLot = MarketInfo(symbol, MODE_MINLOT);
   double maxLot = MarketInfo(symbol, MODE_MAXLOT);

   requestedLots = MathRound(requestedLots / lotStep) * lotStep;
   requestedLots = MathMax(minLot, MathMin(maxLot, requestedLots));

   return requestedLots;
}

Calling this function before OrderSend() ensures your EA always submits a valid trade volume.

Beyond the Code: Managing Your Trades Smoothly

While fixing error 131 is a technical fix, dealing with such interruptions highlights a broader need for a smoother trading workflow. You want to monitor your trades and market conditions without constantly wrestling with the MT4 terminal interface.

This is where a tool like Camovia Tray comes in. It turns your MT4 (and MT5) into a lightweight tray tool, placing essential features right at your fingertips in the system tray. Instead of keeping the full terminal open and navigating through menus, you can quickly check live quotes by hovering over the tray icon. You can also view all your open positions—including details like direction, lot size, open price, and current profit—in a convenient floating panel.

This is particularly useful when you've just resolved an error like 131 and placed a trade. With Camovia Tray, you can keep an eye on your new positions and even close them with a single click, all without reopening the main MT4 window. It provides a faster, less intrusive way to manage your trades and stay on top of the market.

Error 131 is a simple fix: check your broker's rules and adjust your lot size. But when it comes to streamlining the entire trading process, a tool that offers quick, glanceable information can make a significant difference in your daily routine.

MT4/MT5 Tray Assistant

Silent tracking, one-click close - check quotes and manage positions right from the tray.

Download Camovia Tray

Frequently Asked Questions

Can the tray icon be disguised?

Yes. The tray icon can disguise itself as a cloud drive or a common system tool, so market watching stays low-key.

What is the tray lock feature?

Lock the tray function instantly at key moments to protect your privacy and prevent private information from leaking.

What information can I monitor?

Quotes and open positions: symbol, direction, open time, current P&L, and more - all visible in the popup positions tab. Click an order to close it.

Which languages are supported?

Chinese and English, switchable on both the website and the client.

Popular Symbols Trading Hours

Open/close times, weekend hours & live market status: