Strategy testing and trading software · Germanycontact@stratcorealpha.com · DE
All trading software errors

MT4 · code and request checks

MT4 error 4109: check permission before changing the signal

Your EA should send 0 requests when permission is off. My MT4 test rejected both disabled inputs and accepted 1 simulated order.

Own native MT4 tester: four synthetic permission guard cases and one simulated BUY with error zero; no real4109 claimed.

Arnold Holm · 2026-10-14

What the error means

A trader wanted a small MT4 script to open a BUY, but it stopped with error 4109. The script ran and exited before he could inspect its settings. His question was how to enable trading for a script that disappears so quickly. The thread later records his successful checkbox fix. In the official MQL4 error list, 4109 means trade is not allowed in the program properties. It is a different diagnosis from an invalid stop or insufficient funds. I ran my own permission helper in native MT4 build 1491 on EURUSD H4. I supplied disabled terminal and program inputs separately. Each closed the gate without sending. A busy-context input also closed it. With both permission inputs enabled and the real tester reporting IsTradeAllowed true, one simulated BUY returned ticket 1 and error 0. I check permission before changing the entry rule, and leave the intended trade blocked until its settings have been reviewed.

Three code paths to check

  1. 1. The EA or script is attached without trading permission

    Check the Common tab for the exact program producing the failed request. An indicator and an Expert Advisor have different jobs, so confirm which file is actually issuing the order. For a script that exits immediately, its property declarations can make the input dialog appear before execution. The original trader discovered that a confirmation popup alone did not expose the trading checkbox. A developer can use the appropriate script property dialog rather than tell you to catch a window that has already disappeared. Keep a screenshot of the settings and the matching log time.

  2. 2. The terminal permission changed after the program was loaded

    Read AutoTrading and the terminal Expert Advisors options alongside the program setting. Turning on one switch is not a complete diagnosis of every permission layer. The terminal may be configured to disable automated trading after certain account, profile or chart changes. If the EA stopped after such a change, compare that event with the Journal. I would record which layer was disabled before deciding to enable anything. A permission check should explain why an entry was skipped instead of leaving you to guess whether the signal disappeared.

  3. 3. A different failure is being treated as 4109

    Capture the error immediately after the failed trade operation. Another function can change the stored last error before you print it. Keep the requested symbol, order side and program name beside the number. In MQL4, a busy context has its own code, 146, and server-disabled automated trading has code 4112. The same number in another platform can mean something else. Check the platform and the actual operation first. Repeated OrderSend calls cannot repair a disabled checkbox; changing lot size to solve a permission error can hide the original problem while adding another one.

The permission helper from my native MT4 test

The helper above is the exact function tested. Its inputs were deliberately supplied: terminal off and program on, terminal on and program off, both on with a busy context, then both on with a clear context. The first three rejected a send. For the allowed case, the program also read the real IsTradeAllowed value before OrderSend. It bought 0.10 simulated lots at Ask 1.2054, selected ticket 1 to confirm a BUY, then closed the simulated position. Compile errors and warnings were both zero. These separate checks make it easy to see whether a failure is in the guard or in the later order operation.

bool PermissionGate(bool terminalAllowed,bool programAllowed,bool contextBusy)
{
  return terminalAllowed && programAllowed && !contextBusy;
}

The disabled inputs were synthetic helper cases in the native tester. This run did not reproduce a real 4109 rejection or change a terminal trading setting. Account orders sent: zero.

How you know it is fixed

Either disabled permission prevents a send

Terminal-off and program-off inputs each produced gate 0 and zero requests. Preserve that behaviour so an entry cannot fall through into OrderSend after a skip was logged.

Both enabled still need a clear context

Both-on with a busy input produced gate 0. Both-on and clear produced gate 1, and the real tester allowed the simulated BUY with error 0. Recheck the send result even after a positive permission check.

Your five-minute check

Open the failed request in your MT4 Experts log. Compare its time with AutoTrading and the Allow live trading setting for that exact EA or script. Identify the disabled layer before editing the signal, lot size or stop distance. Keep your current settings until you understand what enabling them would cause the program to trade.

Your own source

Find the next line to check

Start with the free EA-Check. Your code stays in your browser. It highlights patterns with line numbers; it does not prove the broker accepts an order.

Check my EA locally

Want one small change shown on your own case?

SOLVED-FIRST: one small fix or change to your own case, shown first as screenshots or a short screen video. 15 USD fixed (or the higher platform minimum), first five paid orders only during 4–17 October 2026. The file follows within 24 hours after funding. Close on Upwork first; marketplace cases stay on their marketplace.

Outside that sprint: R49: one authorised, reproducible MT4/MT5 defect, with three agreed cases. 49 USD fixed. Delivery within 48 hours after source review and funding. The exact case is agreed before funded work.

Send the expected and actual behaviour

Common questions

Does the checkbox fix every missing trade?

It addresses a disabled program permission. A missing entry can also come from the signal, terminal state, symbol rules or another rejected request. Read the actual error and its operation before choosing a fix.

Can I rely on a successful backtest for the live permission setting?

The tester checks the program behaviour in its own environment. Review the actual terminal and program settings separately. My run deliberately used synthetic disabled inputs and left account trading untouched.

Sources and limits

These public questions explain the error; use your own EA log to check whether the same cause applies.

Trading risk disclosure

Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one's financial security or lifestyle. Only risk capital should be used for trading, and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical performance disclosure

Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. There are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical results are generally prepared with the benefit of hindsight, do not involve financial risk, and cannot completely account for the impact of financial risk in actual trading. Market conditions, the ability to withstand losses, and adherence to a trading program can all materially affect actual results.

NinjaTrader trademark disclosure

NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described herein, or any interest, ownership or otherwise, in any such product or service, or endorses, recommends or approves any such product or service.

Testimonials, when shown, may not represent the experience of other clients and are not a guarantee of future performance or success. Virtual-currency trading carries additional risks. See the CFTC customer advisories. Read the full financial risk disclaimer.