The FXNook Lab blog
Practical guides on MT4 and MT5 Expert Advisors, indicators and MQL4/MQL5 code: converting, fixing errors, testing and running EAs.
- MQL4 Array Out of Range: Causes, Fixes, and Code: An MQL4 “array out of range” error means code accessed an index the array does not have. Learn how to find the failing access, fix common loop and series-indexing mistakes, and test the correction.
- MQL5 Array Out of Range Error: Causes and Fixes: An MQL5 array out of range error means code tried to use an index the array does not contain. Learn how to find the failing access and prevent it in loops, price series, and CopyBuffer code.
- MT4 Indicators List: Built-In Tools by Category: This reference lists MetaTrader 4’s standard indicators by Navigator category and explains what each displays. Follow the setup and troubleshooting steps to add an indicator or tell a built-in tool from a custom file.
- MT4 Error 133: Why Trading Is Disabled and How to Fix It: MT4 error 133 means trading is disabled for the request. Find out how to separate terminal and EA settings from account, broker and symbol restrictions, then verify the fix with one controlled test.
- MT5 Error 4014: Causes and Fixes in MQL5: Error 4014 is a program-context restriction, not a broker rejection. Learn how to trace the call, handle Strategy Tester limitations, and move indicator signals into an EA.
- MT4 EA Cannot Load? Causes, Checks, and Fixes: An MT4 EA that is missing from Navigator, fails to compile, or will not attach needs a different fix in each case. Follow the checks in order, then use the Experts and Journal tabs to identify what MT4 is reporting.
- Trailing Stop MQL5 Code: A Working EA Example: This complete MQL5 EA trails buy and sell positions by symbol and magic number, while respecting broker stop constraints and preserving take-profit levels. Learn how to configure its inputs and verify stop modifications in the Strategy Tester.
- Convert a TradingView Indicator to an MT5 EA: Steps: Pine Script cannot run in MetaEditor: its signals must be recreated in MQL5 and given explicit entry, exit and risk rules. Follow a moving-average crossover example and learn how to compare signal timing and test the resulting EA.
- How to Use an EA in MT5: Setup, Test, and Run: Follow an Expert Advisor from its .ex5 file to an MT5 chart, then test it in Strategy Tester. Learn which permissions to check and how to use logs to separate setup problems from EA logic.
- OrderSend Error 131: Fix Invalid Volume in MT4: MT4 OrderSend error 131 means the requested lot size does not meet the broker’s volume rules for that symbol. Learn how to read those rules with MarketInfo and validate lots before sending an order without silently changing exposure.
- MT4 Indicator Source Code: A Working MQL4 Example: A complete MT4 moving-average crossover arrow indicator, with an explanation of its buffers and calculations. Follow the steps to compile the MQ4 source, install the indicator, and diagnose common chart-display problems.
- MT5 Non-Repaint Indicator: How to Check and Build One: Learn the difference between an expected signal change on the live candle and a change to closed-bar history. Follow a repeatable test and see a compact MQL5 example that plots signals on closed bars.
- MT4 Support and Resistance Indicator: Levels and Setup: Learn how MT4 support and resistance indicators mark prior turning points, choose between levels and zones, and install or build a swing-based indicator. A testing checklist helps you spot repainting, errors, and clutter.
- Cách backtest EA trên MT5: hướng dẫn từng bước: Chạy EA trong Strategy Tester của MT5 theo một quy trình rõ ràng, chọn thiết lập phù hợp với logic và đọc báo cáo mà không nhầm kết quả quá khứ với dự báo giao dịch.
- Backtest an EA in MT5 Online: What Actually Works: A browser alone cannot run MetaTrader 5’s native Strategy Tester, but MT5 can run on a remote computer and supported tester jobs can use MQL5 Cloud Network agents. Follow the setup steps and result checks to make a backtest easier to assess and repeat.
- MT5 Strategy Tester Not Working: Causes and Fixes: Work out whether the MT5 Strategy Tester is failing to launch, stalling, or completing normally without trades. Follow a symptom-led sequence through test settings, history, agents and logs to isolate the cause.
- MT5 to MT4 Adapter: What Works and How to Convert: MT4 cannot run an MT5 EA or indicator as-is, and a runtime adapter cannot automatically bridge their different APIs and trade models. This guide explains what can be converted, which parts need rewriting, and how to test the MT4 version.
- MT5 EA Builder: Turn a Strategy into a Tested EA: A practical workflow for turning a trading idea into explicit rules, building an MT5 Expert Advisor, and checking its code and behavior before live use. Includes a moving-average example, a Strategy Tester checklist, and common builder mistakes.
- MT5 EA Source Code: Build and Test a Working Example: Build a small MQL5 EMA-crossover EA and follow its source from MetaEditor compilation through Strategy Tester. The example shows indicator handles, closed-bar signals, CTrade orders and the checks to make when an EA compiles but does not trade.
- MT4 EA Close All Positions: MQL4 Code and Checks: Close MT4 market orders from an EA with a backward order-pool loop, current prices, and optional symbol and magic-number filters. The examples also show how to delete pending orders separately and troubleshoot failures in the Experts log.
- MQL4 to MQL5 Converter: How to Choose and Verify One: A converter can translate code, but MT5’s trade and indicator models can change how an EA behaves. Compare conversion routes and use a practical checklist to verify the result before demo testing.
- MT4 to MT5 Converter: What It Converts and What It Doesn’t: An MT4-to-MT5 converter can map much of an EA or indicator, but MT5 uses different trade and indicator models. Learn what to provide, what to check after conversion, and how to compare the result in MetaTrader 5.
- MT5 EA Not Taking Trades: Checks, Causes, and Fixes: Separate an EA that never reaches its entry logic from one whose trade request the broker rejects. Follow an MT5-specific checklist for signals, retcodes, symbol constraints, account mode and Strategy Tester logs.
- How to Fix OrderSend Error 130: Invalid Stops in MT4: MT4 error 130 means the trade server rejected a stop price as invalid. Learn how to check stop distance, validate buy and sell levels before OrderSend, and diagnose floating broker restrictions.
- MT4 EA Not Opening Trades: Checks, Causes and Fixes: Work through a practical checklist to find whether an MT4 EA is waiting for a signal, blocked by settings, or having orders rejected. Learn how to inspect logs, read OrderSend errors and retest a fix without removing important safeguards.
- MQL4 to MQL5 Conversion Guide: Code, APIs, Testing: MQL4 code does not run unchanged in MT5: trade handling, indicators, and account models all need attention. This guide maps the main API differences, shows code patterns, and gives you a compile-and-test checklist.
- How to Convert an MT4 EA to MT5: A Practical Guide: Converting an MT4 EA to MT5 means checking trade, position, indicator and event behavior, not just changing function names. Follow a practical code example and verification checklist to find the changes most likely to affect how the EA runs.