What is MT4 error 138?
OrderSend Error 138 (or ERR_REQUOTE
) may appear during the execution (but not backtesting) of MetaTrader expert advisors. This error appears only in MT4 as the MetaTrader 5 platform uses a different system of OrderSend error codes. Error 138 means that the broker replied with a «Requote» signal to your expert advisor’s OrderSend()
function call. In other words, the price used in the order is outdated compared to the current market price.
Also, error 138 can appear as a result of the OrderClose()
function call if it is performed with an outdated or wrong price.
Why does MT4 error 138 appear?
There are two main reasons for this error to appear:
- The order price is completely outdated and is not present in the recent quotes. The order will not be executed (and the error 138 will be generated) even if the current market price is within the given Slippage from the order price.
- The order price is present in the recent quotes but differs from the current market price by more than the given Slippage parameter.
How to fix OrderSend error 138 in MT4?
To avoid getting OrderSend Error 138 from your expert advisors, you have to use RefreshRates()
function call immediately before calling OrderSend()
function and before you use the Ask/Bid to calculate parameter values for OrderSend()
function. This will save you from the first of the above-listed cases. However, if your broker is experiencing some technical problems, this won’t help and the error may still appear — there is little you can do in that case.
Here is an MQL4 example of how this is handled in the Chart Pattern Helper EA’s code:
// Get current market prices. RefreshRates(); // Calculate volume based on the current Bid. NewVolume = GetPositionSize(Bid, LowerSL); // Send a Sell order at the current Bid price. LowerTicket = OrderSend(Symbol(), OP_SELL, NewVolume, Bid, Slippage, LowerSL, LowerTP, "ChartPatternHelper", Magic);
Additionally, you should specify a rather large slippage in the parameters of the OrderSend()
function to prevent error 138 from appearing during very volatile conditions. Even if you use the RefreshRates()
function, there is a possibility that prices will change between the call of RefreshRates()
and the execution of OrderSend()
. Setting a tolerable slippage of 5&ndas;10 pips (normal ones, not fractional) will allow your expert advisors to execute orders without requote errors. Of course, if you are scalping or otherwise aiming for small profit targets, you should set a much smaller slippage parameter and bear with the error 138 and failed orders. As an alternative solution, you can always switch your Forex broker to one with less slippage and fewer requotes.
How to fix OrderClose error 138 in MT4?
With OrderClose()
, it is usually much simpler — you just have to make sure that you are closing Buy orders using the current Bid
price, and Sell orders using the current Ask
price. If you encounter MQL4 error 138 with OrderClose()
, check if you are sending the correct variable for a price parameter.
Here is an example of a correctly set up OrderClose()
call to close out a trade from our News Trader EA:
If you have any thoughts, comments, or questions regarding MT4 OrderSend Error 138 and the ways to fix it, feel free to discuss it on our forum with other traders and MQL4 developers.
Hi everyone, im new at coding and still have not managed to get many things right. I keep receiving the error code 138 and ive heard a refreshrates() would fix it but im assuming there is something wrong with my brackets or maybe something else. Here is my code can anyone find why the strategy tester is giving me this error?
extern double Lots=0.1; extern int Period_MA1=35; extern int Period_MA2=5; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } int Work(double ma1_1,double ma2_1, double ma1_0, double ma2_0) { static int last_direction=0; static int current_direction=0; if(ma1_1 > ma2_1 && ma1_0 < ma2_0) current_direction=1; if(ma1_1 < ma2_1 && ma1_0 > ma2_0) current_direction=2; if(current_direction!=last_direction) { last_direction=current_direction; return(last_direction); } else return(0); } int CloseAllSells() // { while(OrdersTotal()>0) { OrderSelect(0, SELECT_BY_POS, MODE_TRADES); switch (OrderType()) { case OP_SELL: OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_ASK), 4, Purple); break; case OP_SELLSTOP:OrderDelete(OrderTicket()); case OP_SELLLIMIT: OrderDelete(OrderTicket()); } } Sleep(10000); RefreshRates(); return(OrderType()==0); } int CloseAllBuys() { while(OrdersTotal()>0) { OrderSelect(0, SELECT_BY_POS, MODE_TRADES); switch (OrderType()) { case OP_BUY: OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_BID), 4, Purple); break; case OP_BUYSTOP:OrderDelete(OrderTicket()); case OP_BUYLIMIT:OrderDelete(OrderTicket()); } } Sleep(10000); RefreshRates(); return(OrderType()==0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double ma1_0, ma1_1, ma2_0, ma2_1, bbg_0, bbg_1, bbp_0, bbp_1; int cnt,Ticket,total; ma1_0=iMA(NULL,0,Period_MA1,0,MODE_EMA,PRICE_CLOSE,0); ma1_1=iMA(NULL,0,Period_MA1,0,MODE_EMA,PRICE_CLOSE,2); ma2_0=iMA(NULL,0,Period_MA2,0,MODE_EMA,PRICE_CLOSE,0); ma2_1=iMA(NULL,0,Period_MA2,0,MODE_EMA,PRICE_CLOSE,2); bbg_1=iCustom(NULL,0,"BB_MACD",12,26,10,2.5,1,2); bbg_0=iCustom(NULL,0,"BB_MACD",12,26,10,2.5,1,0); bbp_1=iCustom(NULL,0,"BB_MACD",12,26,10,2.5,2,2); bbp_0=iCustom(NULL,0,"BB_MACD",12,26,10,2.5,2,0); int order=Work(ma1_1,ma2_1,ma1_0,ma2_0); total=OrdersTotal(); if(total<1) { if(order==1) { while(true) { Ticket = OrderSend(Symbol(),OP_BUY,Lots,Bid,30,Bid-1500*Point,Bid+1500*Point); if(Ticket<0) { RefreshRates(); continue; } else { Sleep(20000); return(Ticket==OrderTicket()); break; } } } if(order==2) { while(true) { Ticket = OrderSend(Symbol(),OP_BUY,Lots,Ask,30,Ask-1500*Point,Ask+1500*Point); if(Ticket<0) { RefreshRates(); continue; } else { Sleep(20000); return(Ticket==OrderTicket()); break; } } } } for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) //will only work for { if(bbg_1 <= bbp_1 && bbg_0 >= bbp_0) { CloseAllBuys(); return; } else { if(bbg_1 >= bbp_1 && bbg_0 <= bbp_0) { CloseAllSells(); return; } } } } } return(0); }
Содержание
- как боротся с ошибкой 138 неверные цены
- OrderSend Error 138 (Requote)
- What is MT4 error 138?
- Why does MT4 error 138 appear?
- How to fix OrderSend error 138 in MT4?
- How to fix OrderClose error 138 in MT4?
- OrderSend error #138
- Ordersend error 138
- Error 138
как боротся с ошибкой 138 неверные цены
Обычно возникает на быстрых рынках
ага так оно и есть, вот я испрашиваю как сделать что бы он все равно пытался сделать ордер пока не сделает ?
ага так оно и есть, вот я испрашиваю как сделать что бы он все равно пытался сделать ордер пока не сделает ?
вообще может пригодится 🙂
if(type == OP_BUY || type == OP_SELLLIMIT || type == OP_BUYSTOP)
res = 1;
if(type == OP_SELL || type == OP_BUYLIMIT || type == OP_SELLSTOP)
res = -1;
//если реверс = 1, то это для выставления ордера, если = -1 то для
//расчета стопов и тейков
if(type == OP_BUYLIMIT || type == OP_SELLLIMIT)
res = res * revers;
//return( 1 — 2 * ( OrderType() % 2 ) );
return(res);
>
//+——————————————————————-+
//выставляет ордер
//на входе: переменные для открытия ордера
//на выходе — тикет открытого ордера или -1 если ордер
//не может быть открыт
//+——————————————————————-+
int OpenOrder(string _symbol,int _cmd, double _volume, double _price, int _sleepage, double _stoploss, double _takeprofit, string _comment, int _magic, int _exp, string fn = «»)
<
/*
symbol — Наименование финансового инструмента, с которым проводится торговая операция.
cmd — Торговая операция. Может быть любым из значений торговых операций.
volume — Количество лотов.
price — Цена открытия.
slippage — Максимально допустимое отклонение цены для рыночных ордеров (ордеров на покупку или продажу).
stoploss — Цена закрытия позиции при достижении уровня убыточности (0 в случае отсутствия уровня убыточности).
takeprofit — Цена закрытия позиции при достижении уровня прибыльности (0 в случае отсутствия уровня прибыльности).
comment — Текст комментария ордера. Последняя часть комментария может быть изменена торговым сервером.
magic — Магическое число ордера. Может использоваться как определяемый пользователем идентификатор.
expiration — Срок истечения отложенного ордера.
arrow_color — Цвет открывающей стрелки на графике. Если параметр отсутствует или его значение равно CLR_NONE, то открывающая стрелка не отображается на графике.
если price == 0 тогда открываем по текущей цене
*/
int res = -1;
int countOfTry = 5;
int nTry = 0;
int sltpLevel = MarketInfo(Symbol(),MODE_STOPLEVEL);
if(_price > 0 ) <
if(_cmd == OP_BUYSTOP || _cmd == OP_SELLLIMIT) <
if(_price (MarketInfo(Symbol(),MODE_BID) — sltpLevel * Point)) <
Print(«================== cant open «, «ot = «,_cmd, » op = «,_price);
return(-1);
>
>
>
//нормализуем все переменные зависящие от цены
_price = NormalizeDouble(_price, Digits);
_stoploss = NormalizeDouble(_stoploss, Digits);
_takeprofit = NormalizeDouble(_takeprofit, Digits);
if(err == 4051)
break;
//logInfo(_price);
if(err == 148) <
Print(«BROCKER MAX ORDERS. «);
return(-1);
>
if(err == 130) <
Print(StringConcatenate(«sl = «,_stoploss,» tp = «,_takeprofit));
return(-1);
>
Print(«OpenOrder»,StringConcatenate(«OrderSendError, fn = «,fn),err);
Print(StringConcatenate(«Price = «,_price,» cmd = «,_cmd, » bid = «, Bid, » ask = «, Ask));
>
Источник
OrderSend Error 138 (Requote)
What is MT4 error 138?
OrderSend Error 138 (or ERR_REQUOTE ) may appear during the execution (but not backtesting) of MetaTrader expert advisors. This error appears only in MT4 as the MetaTrader 5 platform uses a different system of OrderSend error codes. Error 138 means that the broker replied with a «Requote» signal to your expert advisor’s OrderSend() function call. In other words, the price used in the order is outdated compared to the current market price.
Also, error 138 can appear as a result of the OrderClose() function call if it is performed with an outdated or wrong price.
Why does MT4 error 138 appear?
There are two main reasons for this error to appear:
- The order price is completely outdated and is not present in the recent quotes. The order will not be executed (and the error 138 will be generated) even if the current market price is within the given Slippage from the order price.
- The order price is present in the recent quotes but differs from the current market price by more than the given Slippage parameter.
How to fix OrderSend error 138 in MT4?
To avoid getting OrderSend Error 138 from your expert advisors, you have to use RefreshRates() function call immediately before calling OrderSend() function and before you use the Ask/Bid to calculate parameter values for OrderSend() function. This will save you from the first of the above-listed cases. However, if your broker is experiencing some technical problems, this won’t help and the error may still appear — there is little you can do in that case.
Here is an MQL4 example of how this is handled in the Chart Pattern Helper EA’s code:
Additionally, you should specify a rather large slippage in the parameters of the OrderSend() function to prevent error 138 from appearing during very volatile conditions. Even if you use the RefreshRates() function, there is a possibility that prices will change between the call of RefreshRates() and the execution of OrderSend() . Setting a tolerable slippage of 5&ndas;10 pips (normal ones, not fractional) will allow your expert advisors to execute orders without requote errors. Of course, if you are scalping or otherwise aiming for small profit targets, you should set a much smaller slippage parameter and bear with the error 138 and failed orders. As an alternative solution, you can always switch your Forex broker to one with less slippage and fewer requotes.
How to fix OrderClose error 138 in MT4?
With OrderClose() , it is usually much simpler — you just have to make sure that you are closing Buy orders using the current Bid price, and Sell orders using the current Ask price. If you encounter MQL4 error 138 with OrderClose() , check if you are sending the correct variable for a price parameter.
Here is an example of a correctly set up OrderClose() call to close out a trade from our News Trader EA:
If you have any thoughts, comments, or questions regarding MT4 OrderSend Error 138 and the ways to fix it, feel free to discuss it on our forum with other traders and MQL4 developers.
If you want to get news of the most recent updates to our guides or anything else related to Forex trading, you can subscribe to our monthly newsletter.
Источник
OrderSend error #138
in backtest i get this order error 138 .
This is my code.
RefreshRates ();
MqlTick tick;
if ( SymbolInfoTick ( _Symbol ,tick) == true )
<
double xbid = tick.bid;
double xask = tick.ask;
double point= SymbolInfoDouble ( _Symbol , SYMBOL_POINT );
int operation= OP_BUY ;
double price=xask;
double target=price + 100 * point;
double stop=price — 100 * point;
double lots= 0.01 ;
int ticket= OrderSend ( _Symbol ,operation,lots,price, 50 ,stop,target,»», 0 , 0 , clrRed );
if (ticket 0 )
<
PrintFormat («FAILED %s %. 2 f price=%. 8 f stop=%. 8 f target=%. 8 f»,(operation == OP_SELL ? «SELL» : «BUY»),lots,price,stop,target);
>
else
Print («HURRA»);
>
else
<
Print («#ERROR SymbolInfoTick «);
>
What is wrong ? Thank you.
in backtest i get this order error 138 .
What is wrong ? Thank you.
Print your error code when ticket if (ticket 0 )
<
PrintFormat ( «FAILED %s %.2f price=%.8f stop=%.8f target=%.8f ERROR:%i » ,(operation == OP_SELL ? «SELL» : «BUY» ),lots,price,stop,target, GetLastError () );
>
Your 138 might be arising somewhere else.
[ Moved to MQL4 section ]
Print your error code when ticket if (ticket 0 )
<
PrintFormat ( «FAILED %s %.2f price=%.8f stop=%.8f target=%.8f ERROR:%i » ,(operation == OP_SELL ? «SELL» : «BUY» ),lots,price,stop,target, GetLastError () );
>
Your 138 might be arising somewhere else.
[ Moved to MQL4 section ]
how do you mean, please ? The order has not been placed.
What is the secret to get information why it has not been placed.
Do you know the secret undocumented hidden path that could save my time in order to get something run that simply should run ?
how do you mean, please ? The order has not been placed.
What is the secret to get information why it has not been placed.
Do you know the secret undocumented hidden path that could save my time in order to get something run that simply should run ?
From the OrderSend() documentation:
Returns number of the ticket assigned to the order by the trade server or -1 if it fails. To get additional error information, one has to call the GetLastError() function .
So, you attempt to send the order.
If you get -1, the OrderSend() failed. Checking GetLastError() will tell you why it failed.
PS I’ve never actually seen a ticket #0, but in theory it could happen. Your code should read:
Источник
Ordersend error 138
Hi everyone, im new at coding and still have not managed to get many things right. I keep receiving the error code 138 and ive heard a refreshrates() would fix it but im assuming there is something wrong with my brackets or maybe something else. Here is my code can anyone find why the strategy tester is giving me this error?
Buy at Ask, Sell at bid . . .
Buy at Ask, Sell at bid . . .
- OrdersTotal()>0 and OrderSelect(0. ) Makes the EA incompatible with every other including manual trading.
- If the OrderSelect fails so does everything else. Always test return codes
- If the OrderClose/OrderDelete fails you have an infinite loop. Always test return codes and print errors.
- Why use the MarketInfo function call instead of just Ask or the simpler OrderClosePrice()
Once the last order is deleted, what is OrderType() What is OrderTicket, you haven’t selected anything.
What are these supposed to be doing . . .
. . . they are called from Functions that return int yet this will return true or false . . . . and you don’t even use the return value anyway ? so what is the point ?
Источник
Error 138
Здравствуйте. Подскажите пожалуйста разницу при открытии ордера по приведенному ниже алгоритму на тайм фреймах М1 и М30 так как на М1 все хорошо, в то время как в тот же момент на М30 ошибка 138 .
Ну разве что на разных счетах. На одном и том счёте без разницы, в двух терминалах или в том же терминале но в разных окнах. Хотя по логичней было бы видеть ошибку 146 (Подсистема торговли занята).
А нету ли в коде проверки на открытие нового бара?
Здравствуйте. Подскажите пожалуйста разницу при открытии ордера по приведенному ниже алгоритму на тайм фреймах М1 и М30 так как на М1 все хорошо, в то время как в тот же момент на М30 ошибка 138.
Реквоты обрабатывать нужно, чего их пугаться. Простейший алгоритм может быть такой: встретили 138 ошибку — перепроверили условие входа — если все хорошо, делаем новую попытку открыться, в противном случае выходим.
Еще добавлю, что количество реквотов сильно зависит от пинга сервера, рыночных условий и выставленного параметра slippage.
Источник
The MT4 error 138 indicates a price requote issue of the MetaTrader4 platform. This error code may appear when you attempt to execute an order during a highly volatile market.
An error code 138 means the MT4 platform has missed your quoted price for executing an order. In such a situation, your trading platform cancels the current order and requotes another price as an option for re-executing the order. When you visit the platform’s journal at its terminal, you will see the software showing the message “OrderSend error 138”.
Why does MT4 error 138 happen?
Your MT4 platform may show an error code 138 for several reasons:
Slippage
A slippage refers to the difference between the current price and the execution price of a particular trade. A slippage occurs mostly in a highly volatile market when the price rapidly changes every second. For example, you place a buy order (instant execution) of EURUSD on 1.2019. By the time you click on “buy” the price already reaches 1.2021. When the MT4 platform finds such a difference between the execution and actual price, it withdraws the order and shows the error code 138.
Connection dropouts
For any reason, your internet connection dropouts during the execution of an order will also show an error code 138. It happens when your platform gets disconnected from the internet right after you place an order. As a result, your MT4 platform fails to find the price you have quoted due to the connection dropout and shows the OrderSend error signal.
How to fix MT4 requotes?
Time needed: 5 minutes.
How to fix MT4 error 138
Use the RefreshRates function in your EA
- If you wish to remove the OrderSend error138 from your EA, you need to place a RefreshRates function before the OrderSend and Ask/Bid function. Here is an example:
- Handle slippage when closing orders with your EA
Slippage can occur during an attempt to close an order. When MT4 fails to close an order within your quoted price it sends “OrderClose error 138”. To fix such order close issue you need to edit your MT4 EA as follows:
- Add slippage limit to your EA
Please note that even if you place RefreshRates in your EA, there might still be slippage in between the execution of OrderSend and RefreshRates. So, setting a slippage limit in the EA can help you in executing the orders without requotes. When you set a slippage limit in your EA, the platform finds the best price within the slippage limit, executes the trade, and prevents showing MT4 error 138 requote.
- Enable the Deviation feature in MT4
You will find the deviation feature at the bottom of the order execution window of the MT4 platform. Enable the feature and set a value at the maximum deviation box. If you set the maximum deviation as 30, it means the platform will execute an order within 3 pips closer to the originally quoted price. For example, if you place a EURUSD buy order at 1.2023 but the price slips to 1.2026 during the execution process. In such a case the platform will accept the new price and will execute the order at 1.2026 without requoting.
- Select a broker that offers ECN or DMA (Direct Market Access) accounts
If you are trading with a market maker broker, there is a higher chance of facing the error code 138. Because a market maker broker manipulates the price and often fails to match the exact order price provided by the user. On the other hand, a broker that offers ECN or DMA accounts will provide an instant order execution facility. So, trading on an ECN account significantly reduces the risk of slippage.
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 | Ошибка при работе с объектом |
Возможно, вы столкнулись с отличным кодом ошибки, указывающим на ошибку, уменьшающую команду mt4 138. Что ж, обычно есть несколько способов исправить этот тип, поэтому давайте посмотрим, что это сейчас.
Рекомендуется: ASR Pro
Загрузите это программное обеспечение и почините свой компьютер за считанные минуты. г.
Что такое ошибка MT4 138?
Ошибка
OrderSend 138 (или ERR_REQUOTE
) может возникнуть во время выполнения (но не во время тестирования на истории) профессиональными советниками MetaTrader. Эта ошибка возникает только в MT4, поскольку MetaTrader 5 в основном использует другую систему кодов ошибок OrderSend. Ошибка 138 влечет за собой то, что брокер ответил на весь вызов вашего советника OrderSend ()
подпрограммой «переквотирования». Другими словами, цена, потребляемая в заказе, не соответствует дате по сравнению с текущей текущей ценой предложения.
Кроме того, ошибка 138 может возникнуть в результате нашего вызова OrderClose ()
, если элемент выполняется с неправильной или может быть устаревшей ценой.
Почему появляется ошибка 138 в MT4?
- Установленная цена полностью не назначена и не фигурирует в текущих предложениях. Если ордер не удален (и возникла ошибка 138), особенно если текущая рыночная денежная стоимость меньше указанного отклонения от цены ордера.
- Ордер – это цена, доступная вместе с последними ценами, но разница, вызванная текущей рыночной ценой, все больше и больше, чем указанный скользящий параметр.
Как исправить ошибку OrderSend 138 MT4?
Что делать, если ваши любимые советники не получали ошибку OrderSend 138, вы должны выбрать аспект RefreshRates ()
мобильного телефона непосредственно перед вызовом OrderSend ()
в сочетании с перед использованием его на рынке для расчета параметра отражения из-за предложения OrderSend ()
. Спасет ли это ваши потребности в первом из перечисленных выше вещей? Однако, если у брокера есть реальная проблема с бизнесом, это не поможет, и все ошибки могут произойти – и в этом случае внутри все еще мало, что вы можете.
Вот MQL4, чтобы проиллюстрировать, как это решается в коде советника Chart Pattern Helper:
Кроме того, ваше бюро должно указать достаточно большое смещение для всех OrderSend ()
, находящихся в функции параметра, чтобы уменьшить ошибку 138 от возникновения в условиях высоких перемещений. Даже если вы когда-нибудь заберете RefreshRates . используйте функцию ()
, конечно, существует полная вероятность того, что цены будут близки к между вызовом RefreshRates ()
и выполнением, аналогичным OrderSend () . Установка очень допустимого проскальзывания на 5-10 товаров (нормальные люди, без дробей) позволяет вашему информированному потребителю. Мы можем выполнять заказы, не имея ошибок переоценки. Конечно, если покупатели скальпируют или беспокоятся о незначительных целях прибыли, вы создаете отличный меньший параметр скольжения и получаете ошибку 138 и неудавшиеся заказы. В качестве альтернативы владельцы могут сменить соответствующую брокерскую фирму Forex на брокера с меньшим скольжением и меньшим количеством новых котировок.
Как исправить ошибку OrderClose 138 в MT4?
OrderClose ()
обычно очень сложен - все, что вам нужно сделать, это убедиться, что вы можете закрыть инвестиционные заказы с помощью уже имеющегося разместить ставку
. и где текущий ценник Ask
используется в заказах на продажу. Когда MQL4 обнаруживает ошибку 138, относящуюся к OrderClose ()
, убедитесь, что вы отправляете наш собственный правильный аспект для параметра ценника.
Вот пример успешно настроенного
OrderClose ()
для завершения сделки из нашего собственного EA News Trader:
Если у вас есть какие-либо мечты, комментарии или девинетты по поводу ошибки MT4 OrderSend 138, но как ее исправить, вы обязательно обсудите ее с другими трейдерами, а также с разработчиками MQL4 на своем форуме.
Если человек хочет получать каждую из наших последних новостей в сегодняшних руководствах или это могут быть другие темы, связанные с валютной торговлей Forex, он может подписаться на нашу подписку на информационный бюллетень.
Воля
Рекомендуется: ASR Pro
Вы устали от медленной работы компьютера? Он пронизан вирусами и вредоносными программами? Не бойся, друг мой, ASR Pro здесь, чтобы спасти положение! Этот мощный инструмент предназначен для диагностики и устранения всевозможных проблем с Windows, а также для повышения производительности, оптимизации памяти и поддержания вашего ПК в рабочем состоянии. Так что не ждите больше - скачайте ASR Pro сегодня!
1. Скачайте и установите ASR Pro
2. Откройте программу и нажмите "Сканировать"
3. Нажмите "Восстановить", чтобы начать процесс восстановления.
// новейшие рыночные цены.Частота обновления ();// Рассчитываем объем, размещенный на обновленном аукционе. знак равноnewvolume GetPositionSize (Bid, LowerSL);// Отправляем заявку на продажу по цене предложения.LowerTicket = OrderSend (Symbol (), OP_SELL, Bid, newvolume, Slippage, LowerSL, LowerTP, «ChartPatternHelper», Magic);
Торговля на Форексе сопряжена с риском потери. Вы должны абсолютно понимать, что, хотя торговлю на Форекс можно охарактеризовать как потенциально прибыльную, она может привести к потере ваших денег. Никогда не торгуйте деньгами, которые вы не можете позволить себе потерять! Торговля с кредитным плечом может быстрее разрушить ваши мысли.
Контракты на разницу цен представляют собой продукты с кредитным плечом, и в них может обсуждаться капитал, вложенный в такие финансовые обязательства. Торговля CFD сопряжена с высокой степенью риска и поэтому, несомненно, может автоматически подходить для всех трейдеров FX.
Загрузите это программное обеспечение и почините свой компьютер за считанные минуты. г.
Mt4 Orderclose Error 138
Mt4 Bestellingsluit Fout 138
Mt4 Orderclose Fehler 138
Mt4 Orderclose Errore 138
Erreur De Fermeture De Commande Mt4 138
Mt4 주문 닫기 오류 138
Mt4 Orderclose Fel 138
Mt4 Ou Erro De Fechamento 138
Blad Zamkniecia Zamowienia Mt4 138
Error De Cierre De Orden Mt4 138
г.
Sean Fry
Related posts:
Советы по устранению неполадок Устранение неполадок дисплея Vista
Помогите исправить ошибки Super Taskbar XP
Как я могу скачать Stiahnut Zadarmo Antivirus Avast. ремонтировать?
Как исправить различия в ядре Linux?