--- license: cc-by-4.0 language: - en tags: - finance - trading - metatrader - mql5 - error-codes - reference pretty_name: MetaTrader Error Code Cross-Reference (MT4 / MT5 / MQL) size_categories: - n<1K --- # MetaTrader Error Code Cross-Reference Three separate numbering systems describe the same failed order in MetaTrader, and nobody publishes the mapping between them as structured data. This dataset does. | System | Range | Where you see it | |---|---|---| | Server trade retcodes | 10004-10046 | `MqlTradeResult.retcode` after `OrderSend()` | | MQL5 runtime errors | 4752-4759 | `_LastError` / `GetLastError()` inside the EA | | MT4 error codes | 129-4112 | Older code, and most forum answers written before 2020 | ## Why the mapping matters An expert advisor that fails gets **4756** from `_LastError`, which means only "the trade request was not sent or was rejected". The reason is in `MqlTradeResult.retcode` — a completely different number. Developers routinely log the wrong one and lose the diagnosis. Separately, a decade of forum answers is written in MT4 numbers. Someone reading that **error 130** means an invalid stop needs to know it is **10016** on MT5. The conditions did not change when the platform did; only the numbering did. ## Files - `server_retcodes.csv` — 41 rows. Every trade server retcode with its constant name and meaning. - `mql_runtime_errors.csv` — 7 rows. The MQL5 trade runtime errors, and where the real reason lives for each. - `mt4_to_mt5_mapping.csv` — 13 rows. MT4 error number to MT5 retcode, with the diagnosis. - `metatrader_error_codes.json` — all three as one object. ## Source and method Values are the standard MQL4/MQL5 documentation constants, compiled and cross-referenced while writing a public troubleshooting reference for MetaTrader 5. Nothing is inferred or estimated. The dataset is generated directly from the source of that reference, so the two cannot drift apart. Full reference with diagnosis and fixes for each code: **** ## Citation Licensed CC BY 4.0. Reuse commercially, attribute, no permission needed. ```bibtex @dataset{techkick_metatrader_error_codes, author = {Tech Kick}, title = {MetaTrader Error Code Cross-Reference (MT4 / MT5 / MQL)}, year = {2026}, publisher = {Zenodo}, url = {https://techkick.me/help/mt5-error-codes} } ```