Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1307

 
Hello, could you tell me if there is a feature that allows you to movea pending orderto a certain number of pips, not to trawl the order but to move it once to the distance that is set in the settings. Sincerely Alexander.
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Приказы на проведение торговых операций оформляются ордерами. Каждый ордер имеет множество свойств для чтения, информацию по ним можно получать с помощью функций Идентификатор позиции, который ставится на ордере при его исполнении. Каждый исполненный ордер порождает сделку, которая открывает новую или изменяет уже существующую позицию...
 
Hello, could you tell me if there is a feature that allows you to movea pending orderto a certain number of pips, not to trawl the order but to move it once to the distance that is set in the settings. Sincerely Alexander.
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Приказы на проведение торговых операций оформляются ордерами. Каждый ордер имеет множество свойств для чтения, информацию по ним можно получать с помощью функций Идентификатор позиции, который ставится на ордере при его исполнении. Каждый исполненный ордер порождает сделку, которая открывает новую или изменяет уже существующую позицию...
 
Knelson:
Hello, could you tell me if there is a function that would allow me to movea pending orderby a certain number of pips, not to trawl the order but to move it once at a distance that is specified in the settings. Sincerely Alexander.

OrderModify()


https://www.mql5.com/ru/docs/standardlibrary/tradeclasses/ctrade/ctradeordermodify

Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade / OrderModify
Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade / OrderModify
  • www.mql5.com
Успешное окончание работы метода OrderModify(...) не всегда означает успешное совершение торговой операции. Необходимо проверять результат выполнения торгового запроса (код возврата торгового сервера) вызовом метода ResultRetcode().
 
Knelson:
Hello, could you suggest a function that allows you to movea pending orderfor a certain number of pips without trawling the order and move it once at a distance that is set in the options. Sincerely Alexander.

You should be banned for this kind of hustle.

I place pending ordersthere and delete them when one of the pending orders becomes a market order, I hope you understand.

Советник по времени с динамическим трейлингстопом и трейлингпрофитом.
Советник по времени с динамическим трейлингстопом и трейлингпрофитом.
  • www.mql5.com
После преобразования первого отложенного или лимитного ордерав рыночный, оставшиеся отложенные и лимитные ордера удаляются. Для рыночного ордера используется динамический трейлингстоп. модифицируется на расстояние, не больше значения Трейлингстоп от текущей цены , для ордеров , и от цены , для ордеров и уменьшает Трейлингстоп при приближении к...
 

Error 4806 occurs when copying

double Values[2];
//------------------------------------------
ResetLastError();
int hanle = iAC(_Symbol,PERIOD_M1);
CopyBuffer(hanle,0,0,2,Values);
Alert("0 ",DoubleToString(Values[0],7));
Alert("1 ",DoubleToString(Values[1],7));
Alert(GetLastError());

What is the error?

 
Alexandr Sokolov:

Error 4806 occurs when copying

What is the error?

The error is due to copying taking too long - wait a while and try again

 
Alexandr Sokolov:

Error due to copying too long - need to wait a while and try again

... after upgrading to 10windows my PC is slower than ever

 
What does error 10013 mean? (the description just says " Incorrect request", but does not say what it is wrong about)


Here's the code

op = Price[0] - (double)distance * _Point;
Open_Order(ORDER_TYPE_BUY_LIMIT,op,op-(double)sl*_Point,op+(double)tp*_Point);

op = Price[0] + (double)distance * _Point;
Open_Order(ORDER_TYPE_SELL_LIMIT,op,op+(double)sl*_Point,op-(double)tp*_Point);

//-----------------------------------------------------------------------------------

void Open_Order(ENUM_ORDER_TYPE  Type,
                double           price,
                double           sl_price,
                double           tp_price)
  {
   
   MqlTradeRequest  request;
   MqlTradeResult   result;
   
   request.action        = TRADE_ACTION_PENDING;
   request.magic         = id_number;
   request.symbol        = _Symbol;
   request.volume        = volume;
   request.price         = price;
   request.sl            = sl_price;
   request.tp            = tp_price;
   request.deviation     = slippage;
   request.type          = Type;
   request.type_filling  = ORDER_FILLING_FOK;
   request.type_time     = ORDER_TIME_SPECIFIED_DAY;
   request.comment       = "Limiter";
   
   if(!OrderSend(request,result)) Print("Error - ",result.retcode);
   
  }
 
Alexandr Sokolov:
What does error 10013 mean? (the description just says " Incorrect request", but does not say exactly what it is wrong about)


Here's the code

... As it turned out ZeroMemory was missing and remove type_time

 
Where do I find out the order expiry time in the strategy tester? This is not available in the columns tab
Reason: