Position & Risk
Size exposure using equity, stop distance and actual specifications.
Search official trade, runtime and compilation codes and warnings. Calculate risk using actual contract specifications.
Size exposure using equity, stop distance and actual specifications.
Estimate margin, tick value and price-move value.
A mathematical scenario, not a forecast of strategy returns.
Calculations run locally in your browser. Inputs are not uploaded or saved. Terminal and broker margin rules apply; estimates exclude slippage, commission and swap.
1171 matching records
| Platform / category | Code / constant | Official meaning | Troubleshooting |
|---|---|---|---|
| MT4 · Runtime errors | 5006 ERR_FILE_CANNOT_DELETE | Cannot delete file | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5007 ERR_FILE_INVALID_HANDLE | Invalid file handle (file closed or was not opened) | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5008 ERR_FILE_WRONG_HANDLE | Wrong file handle (handle index is out of handle table) | YI GOLD suggestionsCheck length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access. MetaQuotes |
| MT4 · Runtime errors | 5009 ERR_FILE_NOT_TOWRITE | File must be opened with FILE_WRITE flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5010 ERR_FILE_NOT_TOREAD | File must be opened with FILE_READ flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5011 ERR_FILE_NOT_BIN | File must be opened with FILE_BIN flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5012 ERR_FILE_NOT_TXT | File must be opened with FILE_TXT flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5013 ERR_FILE_NOT_TXTORCSV | File must be opened with FILE_TXT or FILE_CSV flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5014 ERR_FILE_NOT_CSV | File must be opened with FILE_CSV flag | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5015 ERR_FILE_READ_ERROR | File read error | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5016 ERR_FILE_WRITE_ERROR | File write error | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5017 ERR_FILE_BIN_STRINGSIZE | String size must be specified for binary file | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5018 ERR_FILE_INCOMPATIBLE | Incompatible file (for string arrays-TXT, for others-BIN) | YI GOLD suggestionsCheck length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access. MetaQuotes |
| MT4 · Runtime errors | 5019 ERR_FILE_IS_DIRECTORY | File is directory not file | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5020 ERR_FILE_NOT_EXIST | File does not exist | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5021 ERR_FILE_CANNOT_REWRITE | File cannot be rewritten | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5022 ERR_FILE_WRONG_DIRECTORYNAME | Wrong directory name | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5023 ERR_FILE_DIRECTORY_NOT_EXIST | Directory does not exist | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5024 ERR_FILE_NOT_DIRECTORY | Specified file is not directory | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5025 ERR_FILE_CANNOT_DELETE_DIRECTORY | Cannot delete directory | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5026 ERR_FILE_CANNOT_CLEAN_DIRECTORY | Cannot clean directory | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5027 ERR_FILE_ARRAYRESIZE_ERROR | Array resize error | YI GOLD suggestionsCheck length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access. MetaQuotes |
| MT4 · Runtime errors | 5028 ERR_FILE_STRINGRESIZE_ERROR | String resize error | YI GOLD suggestionsCheck permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access. MetaQuotes |
| MT4 · Runtime errors | 5029 ERR_FILE_STRUCT_WITH_OBJECTS | Structure contains strings or dynamic arrays | YI GOLD suggestionsCheck length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access. MetaQuotes |
| MT4 · Runtime errors | 5200 ERR_WEBREQUEST_INVALID_ADDRESS | Invalid URL | YI GOLD suggestionsInspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description. MetaQuotes |
| MT4 · Runtime errors | 5201 ERR_WEBREQUEST_CONNECT_FAILED | Failed to connect to specified URL | YI GOLD suggestionsInspect connectivity, logs and request time. Verify actual order status before bounded retries with backoff to avoid duplicate exposure after a timeout. MetaQuotes |
| MT4 · Runtime errors | 5202 ERR_WEBREQUEST_TIMEOUT | Timeout exceeded | YI GOLD suggestionsInspect connectivity, logs and request time. Verify actual order status before bounded retries with backoff to avoid duplicate exposure after a timeout. MetaQuotes |
| MT4 · Runtime errors | 5203 ERR_WEBREQUEST_REQUEST_FAILED | HTTP request failed | YI GOLD suggestionsInspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description. MetaQuotes |
| MT4 · Runtime errors | 65536 ERR_USER_ERROR_FIRST | User defined errors start with this code | YI GOLD suggestionsInspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description. MetaQuotes |
| MT4 · Trade return codes | 0 ERR_NO_ERROR | No error returned | YI GOLD suggestionsDo not treat this as a failure. Still check the function return value and operation state. MetaQuotes |
| MT4 · Trade return codes | 1 ERR_NO_RESULT | No error returned, but the result is unknown | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT4 · Trade return codes | 2 ERR_COMMON_ERROR | Common error | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT4 · Trade return codes | 3 ERR_INVALID_TRADE_PARAMETERS | Invalid trade parameters | YI GOLD suggestionsCompare each argument and reference mode with the official signature. Validate ranges and preserve relevant failure context. MetaQuotes |
| MT4 · Trade return codes | 4 ERR_SERVER_BUSY | Trade server is busy | YI GOLD suggestionsSerialize account requests, verify previous outcomes, reduce frequency and use bounded backoff. MetaQuotes |
| MT4 · Trade return codes | 5 ERR_OLD_VERSION | Old version of the client terminal | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT4 · Trade return codes | 6 ERR_NO_CONNECTION | No connection with trade server | YI GOLD suggestionsInspect connectivity, logs and request time. Verify actual order status before bounded retries with backoff to avoid duplicate exposure after a timeout. MetaQuotes |
| MT4 · Trade return codes | 7 ERR_NOT_ENOUGH_RIGHTS | Not enough rights | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT4 · Trade return codes | 8 ERR_TOO_FREQUENT_REQUESTS | Too frequent requests | YI GOLD suggestionsSerialize account requests, verify previous outcomes, reduce frequency and use bounded backoff. MetaQuotes |
| MT4 · Trade return codes | 9 ERR_MALFUNCTIONAL_TRADE | Malfunctional trade operation | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT4 · Trade return codes | 64 ERR_ACCOUNT_DISABLED | Account disabled | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
Official meanings and YI GOLD suggestions are presented separately. References are verified during version builds; page visits do not fetch external sites.