Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 4 new columns ({'mt4_name', 'diagnosis', 'mt5_retcode', 'mt4_error'}) and 4 missing columns ({'runtime_code', 'what_it_means', 'name', 'where_the_real_reason_is'}).

This happened while the csv dataset builder was generating data using

hf://datasets/tekkick/metatrader-error-codes/mt4_to_mt5_mapping.csv (at revision 63b9c5ddf6e76d33f5d11ab09b54c460d10f7741), ['hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/mql_runtime_errors.csv', 'hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/mt4_to_mt5_mapping.csv', 'hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/server_retcodes.csv']

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
                  writer.write_table(table)
                  ~~~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              mt4_error: int64
              mt4_name: string
              mt5_retcode: string
              diagnosis: string
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 749
              to
              {'runtime_code': Value('int64'), 'name': Value('string'), 'what_it_means': Value('string'), 'where_the_real_reason_is': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
                  ...<4 lines>...
                  )
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 4 new columns ({'mt4_name', 'diagnosis', 'mt5_retcode', 'mt4_error'}) and 4 missing columns ({'runtime_code', 'what_it_means', 'name', 'where_the_real_reason_is'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/tekkick/metatrader-error-codes/mt4_to_mt5_mapping.csv (at revision 63b9c5ddf6e76d33f5d11ab09b54c460d10f7741), ['hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/mql_runtime_errors.csv', 'hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/mt4_to_mt5_mapping.csv', 'hf://datasets/tekkick/metatrader-error-codes@63b9c5ddf6e76d33f5d11ab09b54c460d10f7741/server_retcodes.csv']
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

runtime_code
int64
name
string
what_it_means
string
where_the_real_reason_is
string
4,752
ERR_TRADE_DISABLED
Trading by expert advisors is prohibited
Retcode 10027 — the Algo Trading button or EA permission
4,753
ERR_TRADE_POSITION_NOT_FOUND
The position ticket does not exist
Usually a netting account that has already merged the position
4,754
ERR_TRADE_ORDER_NOT_FOUND
The order ticket does not exist
Already filled, cancelled, or the wrong ticket
4,755
ERR_TRADE_DEAL_NOT_FOUND
The deal ticket does not exist
History not yet selected with HistorySelect()
4,756
ERR_TRADE_SEND_FAILED
The trade request was not sent, or was rejected
MqlTradeResult.retcode — any of the codes in the table above
4,758
ERR_TRADE_CALC_FAIL
OrderCalcMargin or OrderCalcProfit failed
Bad symbol, volume or price passed to the calculation
4,759
ERR_TRADE_WRONG_PROPERTY
Wrong trade property requested
A code error in the EA, not the broker
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
REQUOTE
null
null
null
REJECT
null
null
null
CANCEL
null
null
null
PLACED
null
null
null
DONE
null
null
null
DONE_PARTIAL
null
null
null
ERROR
null
null
null
TIMEOUT
null
null
null
INVALID
null
null
null
INVALID_VOLUME
null
null
null
INVALID_PRICE
null
null
null
INVALID_STOPS
null
null
null
TRADE_DISABLED
null
null
null
MARKET_CLOSED
null
null
null
NO_MONEY
null
null
null
PRICE_CHANGED
null
null
null
PRICE_OFF
null
null
null
INVALID_EXPIRATION
null
null
null
ORDER_CHANGED
null
null
null
TOO_MANY_REQUESTS
null
null
null
NO_CHANGES
null
null
null
SERVER_DISABLES_AT
null
null
null
CLIENT_DISABLES_AT
null
null
null
LOCKED
null
null
null
FROZEN
null
null
null
INVALID_FILL
null
null
null
CONNECTION
null
null
null
ONLY_REAL
null
null
null
LIMIT_ORDERS
null
null
null
LIMIT_VOLUME
null
null
null
INVALID_ORDER
null
null
null
POSITION_CLOSED
null
null
null
INVALID_CLOSE_VOLUME
null
null
null
CLOSE_ORDER_EXIST
null
null
null
LIMIT_POSITIONS
null
null
null
REJECT_CANCEL
null
null
null
LONG_ONLY
null
null
null
SHORT_ONLY
null
null
null
CLOSE_ONLY
null
null
null
FIFO_CLOSE
null
null
null
HEDGE_PROHIBITED
null
null

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: https://techkick.me/help/mt5-error-codes

Citation

Licensed CC BY 4.0. Reuse commercially, attribute, no permission needed.

@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}
}
Downloads last month
30