GetLastError() — функция, возвращающая коды ошибок. Кодовые константы ошибок определены
в файле stderror.mqh. Для вывода текстовых сообщений следует использовать функцию
ErrorDescription(), определенную в файле stdlib.mqh.
Константа | Значение | Описание |
---|---|---|
ERR_NO_ERROR | 0 | Нет ошибки |
ERR_NO_RESULT | 1 | Нет ошибки, но результат неизвестен |
ERR_COMMON_ERROR | 2 | Общая ошибка |
ERR_INVALID_TRADE_PARAMETERS | 3 | Неправильные параметры |
ERR_SERVER_BUSY | 4 | Торговый сервер занят |
ERR_OLD_VERSION | 5 | Старая версия клиентского терминала |
ERR_NO_CONNECTION | 6 | Нет связи с торговым сервером |
ERR_NOT_ENOUGH_RIGHTS | 7 | Недостаточно прав |
ERR_TOO_FREQUENT_REQUESTS | 8 | Слишком частые запросы |
ERR_MALFUNCTIONAL_TRADE | 9 | Недопустимая операция нарушающая функционирование сервера |
ERR_ACCOUNT_DISABLED | 64 | Счет заблокирован |
ERR_INVALID_ACCOUNT | 65 | Неправильный номер счета |
ERR_TRADE_TIMEOUT | 128 | Истек срок ожидания совершения сделки |
ERR_INVALID_PRICE | 129 | Неправильная цена |
ERR_INVALID_STOPS | 130 | Неправильные стопы |
ERR_INVALID_TRADE_VOLUME | 131 | Неправильный объем |
ERR_MARKET_CLOSED | 132 | Рынок закрыт |
ERR_TRADE_DISABLED | 133 | Торговля запрещена |
ERR_NOT_ENOUGH_MONEY | 134 | Недостаточно денег для совершения операции |
ERR_PRICE_CHANGED | 135 | Цена изменилась |
ERR_OFF_QUOTES | 136 | Нет цен |
ERR_BROKER_BUSY | 137 | Брокер занят |
ERR_REQUOTE | 138 | Новые цены |
ERR_ORDER_LOCKED | 139 | Ордер заблокирован и уже обрабатывается |
ERR_LONG_POSITIONS_ONLY_ALLOWED | 140 | Разрешена только покупка |
ERR_TOO_MANY_REQUESTS | 141 | Слишком много запросов |
ERR_TRADE_MODIFY_DENIED | 145 | Модификация запрещена, так как ордер слишком близок к рынку |
ERR_TRADE_CONTEXT_BUSY | 146 | Подсистема торговли занята |
ERR_TRADE_EXPIRATION_DENIED | 147 | Использование даты истечения ордера запрещено брокером |
ERR_TRADE_TOO_MANY_ORDERS | 148 | Количество открытых и отложенных ордеров достигло предела, установленного брокером. |
Константа | Значение | Описание |
---|---|---|
ERR_NO_MQLERROR | 4000 | Нет ошибки |
ERR_WRONG_FUNCTION_POINTER | 4001 | Неправильный указатель функции |
ERR_ARRAY_INDEX_OUT_OF_RANGE | 4002 | Индекс массива — вне диапазона |
ERR_NO_MEMORY_FOR_FUNCTION_CALL_STACK | 4003 | Нет памяти для стека функций |
ERR_RECURSIVE_STACK_OVERFLOW | 4004 | Переполнение стека после рекурсивного вызова |
ERR_NOT_ENOUGH_STACK_FOR_PARAMETER | 4005 | На стеке нет памяти для передачи параметров |
ERR_NO_MEMORY_FOR_PARAMETER_STRING | 4006 | Нет памяти для строкового параметра |
ERR_NO_MEMORY_FOR_TEMP_STRING | 4007 | Нет памяти для временной строки |
ERR_NOT_INITIALIZED_STRING | 4008 | Неинициализированная строка |
ERR_NOT_INITIALIZED_ARRAYSTRING | 4009 | Неинициализированная строка в массиве |
ERR_NO_MEMORY_FOR_ARRAYSTRING | 4010 | Нет памяти для строкового массива |
ERR_TOO_LONG_STRING | 4011 | Слишком длинная строка |
ERR_REMAINDER_FROM_ZERO_DIVIDE | 4012 | Остаток от деления на ноль |
ERR_ZERO_DIVIDE | 4013 | Деление на ноль |
ERR_UNKNOWN_COMMAND | 4014 | Неизвестная команда |
ERR_WRONG_JUMP | 4015 | Неправильный переход |
ERR_NOT_INITIALIZED_ARRAY | 4016 | Неинициализированный массив |
ERR_DLL_CALLS_NOT_ALLOWED | 4017 | Вызовы DLL не разрешены |
ERR_CANNOT_LOAD_LIBRARY | 4018 | Невозможно загрузить библиотеку |
ERR_CANNOT_CALL_FUNCTION | 4019 | Невозможно вызвать функцию |
ERR_EXTERNAL_EXPERT_CALLS_NOT_ALLOWED | 4020 | Вызовы внешних библиотечных функций не разрешены |
ERR_NOT_ENOUGH_MEMORY_FOR_RETURNED_STRING | 4021 | Недостаточно памяти для строки, возвращаемой из функции |
ERR_SYSTEM_BUSY | 4022 | Система занята |
ERR_INVALID_FUNCTION_PARAMETERS_COUNT | 4050 | Неправильное количество параметров функции |
ERR_INVALID_FUNCTION_PARAMETER_VALUE | 4051 | Недопустимое значение параметра функции |
ERR_STRING_FUNCTION_INTERNAL_ERROR | 4052 | Внутренняя ошибка строковой функции |
ERR_SOME_ARRAY_ERROR | 4053 | Ошибка массива |
ERR_INCORRECT_SERIES_ARRAY_USING | 4054 | Неправильное использование массива-таймсерии |
ERR_CUSTOM_INDICATOR_ERROR | 4055 | Ошибка пользовательского индикатора |
ERR_INCOMPATIBLE_ARRAYS | 4056 | Массивы несовместимы |
ERR_GLOBAL_VARIABLES_PROCESSING_ERROR | 4057 | Ошибка обработки глобальныех переменных |
ERR_GLOBAL_VARIABLE_NOT_FOUND | 4058 | Глобальная переменная не обнаружена |
ERR_FUNCTION_NOT_ALLOWED_IN_TESTING_MODE | 4059 | Функция не разрешена в тестовом режиме |
ERR_FUNCTION_NOT_CONFIRMED | 4060 | Функция не подтверждена |
ERR_SEND_MAIL_ERROR | 4061 | Ошибка отправки почты |
ERR_STRING_PARAMETER_EXPECTED | 4062 | Ожидается параметр типа string |
ERR_INTEGER_PARAMETER_EXPECTED | 4063 | Ожидается параметр типа integer |
ERR_DOUBLE_PARAMETER_EXPECTED | 4064 | Ожидается параметр типа double |
ERR_ARRAY_AS_PARAMETER_EXPECTED | 4065 | В качестве параметра ожидается массив |
ERR_HISTORY_WILL_UPDATED | 4066 | Запрошенные исторические данные в состоянии обновления |
ERR_TRADE_ERROR | 4067 | Ошибка при выполнении торговой операции |
ERR_END_OF_FILE | 4099 | Конец файла |
ERR_SOME_FILE_ERROR | 4100 | Ошибка при работе с файлом |
ERR_WRONG_FILE_NAME | 4101 | Неправильное имя файла |
ERR_TOO_MANY_OPENED_FILES | 4102 | Слишком много открытых файлов |
ERR_CANNOT_OPEN_FILE | 4103 | Невозможно открыть файл |
ERR_INCOMPATIBLE_ACCESS_TO_FILE | 4104 | Несовместимый режим доступа к файлу |
ERR_NO_ORDER_SELECTED | 4105 | Ни один ордер не выбран |
ERR_UNKNOWN_SYMBOL | 4106 | Неизвестный символ |
ERR_INVALID_PRICE_PARAM | 4107 | Неправильный параметр цены для торговой функции |
ERR_INVALID_TICKET | 4108 | Неверный номер тикета |
ERR_TRADE_NOT_ALLOWED | 4109 | Торговля не разрешена |
ERR_LONGS_NOT_ALLOWED | 4110 | Длинные позиции не разрешены |
ERR_SHORTS_NOT_ALLOWED | 4111 | Короткие позиции не разрешены |
ERR_OBJECT_ALREADY_EXISTS | 4200 | Объект уже существует |
ERR_UNKNOWN_OBJECT_PROPERTY | 4201 | Запрошено неизвестное свойство объекта |
ERR_OBJECT_DOES_NOT_EXIST | 4202 | Объект не существует |
ERR_UNKNOWN_OBJECT_TYPE | 4203 | Неизвестный тип объекта |
ERR_NO_OBJECT_NAME | 4204 | Нет имени объекта |
ERR_OBJECT_COORDINATES_ERROR | 4205 | Ошибка координат объекта |
ERR_NO_SPECIFIED_SUBWINDOW | 4206 | Не найдено указанное подокно |
ERR_SOME_OBJECT_ERROR | 4207 | Ошибка при работе с объектом |
Rosh писал(а) >>
Вы подключились к счету под инвесторским паролем (доступом). Терминал об этом явно сообщает в логе Журнала.
Уважаемый Рашид,
А как объясняется такая ситуация?
20:18:38 iWin USDCHFFXF,H1: open #654083 sell 0.32 USDCHFFXF at 1.0379 ok 20:18:38 stdlib USDCHFFXF,H1: loaded successfully 20:18:38 iWin USDCHFFXF,H1: Trade error: 133 - trade is disabled 20:18:40 stdlib EURUSDFXF,M5: loaded successfully 20:18:40 iWin EURUSDFXF,M5: Trade error: 133 - trade is disabled 20:18:40 iWin EURUSDFXF,M5: Trade error: 133 - trade is disabled 20:18:55 iWin EURUSDFXF,M5: Trade error: 133 - trade is disabled 20:18:57 iWin EURUSDFXF,M5: Trade error: 133 - trade is disabled ................. 21:01:08 iWin GBPUSDFXF,M15: close #648025 buy 0.01 GBPUSDFXF at 1.6364 at price 1.6309 21:02:00 iWin GBPUSDFXF,M15: close #648024 sell 0.04 GBPUSDFXF at 1.6361 at price 1.6312
No need to talk to your Broker
MetaTrader4 Server side has nothing to do with this.
Check your localhost Terminal settings
There might be several reasons, why the EA was working ( «DID work» as you post it )
and still you get an error.
An MT4.Terminal.Profile
change can also cause this to happen.
An MT4.Terminal.LogAnotherUser
change can also cause this to happen.
An MT4.Terminal.Graph
change of { Symbol
| Period
} can also cause this to happen.
Check Tools
> Options
> Expert Advisor
[TAB] for active values in respective check-boxes for all the above.
Check, if you are correctly logged-on to a correct ( not canceled ) trading account.
Check, if your connection is green / working
Check, if your trading Symbol has active market ( open trading hours )
If still in troubles, send a few OrderSend()
-s with PrintScreen
-s and copy responses from Log-File & post here.
The GetLastError() function returns the last error code. The Error code constants are defined in the stderror.mqh file.
To print text messages use the ErrorDescription() function defined in the stdlib.mqh file.
Constant
Value
Description
What is MT4 error 133?
The MT4 error code 133 means your trade copier has failed to locate a currency pair while executing an order through your Metatrader platform. Such OrderSend errors are mostly experienced by traders who use auto-trading features for scalping and intraday trading purposes. The fact is, even if you use the most powerful copy trader in the world, you may still miss profitable trade entries due to such errors.
This problem can occur for one or multiple reasons. It may happen due to bad internet, restrictions from brokers, and a malfunction of the copy trading bot. In this article, we have discussed the possible reasons behind this OrderSend 133 error. Also, we have explained how to fix MT4 error 133.
Why does MT4 error Trade Disabled happen?
Different symbols by account types
If your broker uses a currency suffix and the trade copier is unable to detect it correctly then the MT4 platform shows an OrderSend error 133. Some brokers use currency suffixes for classifying trader’s access to particular trading assets based on their account types.
For example, a broker uses two different symbols for Euro vs Dollar pair such as EURUSD and EURUSDm. First of all, the spreads between EURUSD and EURUSDm will not be the same. EURUSD may use regular spreads for general account users. On the other hand, EURUSDm may offer tighter spreads for the raw spread account holders of the broker. Now, when a trade copier tries to execute a EURUSD buy or sell order in the MT4 platform, it finds two different symbols of the same asset. So, the copier fails to decide which symbol to be picked and shows the MT4 error 133.
Temporary disabled currency pairs
Your trading platform may show the same error code if your broker disables trading a currency pair temporarily or permanently. For instance, a broker might not support trading exotic pairs. In such a case, if the trade copier sends a USDTHB (US dollar vs Thailand Baht) buy or sell order, the order will be automatically rejected.
Enable auto-trading in MT4
Have you enabled the auto-trading feature in your MT4 platform? Well, if you forget to enable auto-trading, your trade copier will fail to execute orders and will keep showing the error code 133. If the auto-trading feature is disabled by the broker, the MT4 platform will still show the same error code.
Slow or unstable internet connection
A poor internet connection can be another cause of an OrderSend error. The MT4 platform shows an error code 133 when a trade copier fails to activate a trade due to a bad internet connection.
How to fix error 133?
Time needed: 5 minutes.
How to fix MT4 Trade Disabled errors
- Check symbol suffix
If your trade copier fails to activate the order due to currency suffix, then check if the copier has an option to turn off auto suffix detection. In such a case, the trade copier will only pick the general/regular symbols and will ignore the symbols with suffix.
- Enable auto-trading
Enable the auto-trading option in your MT4 platform. Simply click on the “Option” menu, then click on “Expert Advisor”, and enable the automated trading option.
- Try to open trades manually to check if the broker enabled/disabled trading on a specific symbol
When a trade copier fails to execute an order and shows MT4 error code 133, try to open the trade manually. If it still shows the same error then your broker might have disabled trading that particular asset either permanently or temporarily. In such a situation, you need to contact the broker and check if they have applied any restriction on trading that desired instrument.
- Check your internet connection
If your broker doesn’t use a currency suffix and doesn’t restrict trading the currency pair then the OrderSend error may happen due to a bad internet connection. So, check your internet connection and make sure your platform is connected well to your broker server.