Errors, bugs, questions - page 1796

 
What is the point of calling OrderCheck if OrderSend(Async) does the same check?
 
Vladimir Pastushak:

Clean windup, clean kasper, i put terminal in, kasper cut it out like crazy.

No way to add it to exceptions......

Can't reproduce. You can write to ServiceDesk with details. Windows version, terminal version, antivirus version.
 
Aleksey Pak:
Can't reproduce it. You can write a request to ServiceDesk and describe in detail. Windows version, terminal version, antivirus version.

DrWeb finds nothing.

 
Compilation error
#define MACRO  \
  if (true)    \
  {            \
    Print(""); \
//    Print(""); \
  }

void OnStart()
{
  MACRO
}
 
Vladislav Andruschenko:

DrWeb finds nothing.

It always finds nothing ))))
 
Vladimir Pastushak:
It always finds nothing ))))

No, it often finds viruses, but it doesn't find anything in mt.

 

In continuation of the topic. For what reason when making a request for pending orders, theRequest.type_filling field no longer has a value?

Now, no matter how I filled it, OrderGetInteger(ORDER_TYPE_FILLING) == ORDER_FILLING_RETURN.

Script

void OnStart()
{
  MqlTradeRequest Request = {0};
  
  Request.action = TRADE_ACTION_PENDING;

  Request.symbol = _Symbol;
  Request.volume = 1;
  Request.price = SymbolInfoDouble(_Symbol, SYMBOL_BID) - 100 * _Point;

  Request.deviation = 10;
  Request.type = ORDER_TYPE_SELL_STOP;
  
  Request.type_filling = ORDER_FILLING_FOK;
  
  MqlTradeResult Result = {0};
  
  if (OrderSend(Request, Result))
  {
    Sleep(100);
    
    if (OrderSelect(Result.order))    
      Print(EnumToString((ENUM_ORDER_TYPE_FILLING)::OrderGetInteger(ORDER_TYPE_FILLING)));
  }        
}

Result

ORDER_FILLING_RETURN

type_filling must be set for the same ORDER_TYPE_SELL_STOP. ORDER_FILLING_FOK is written in the script - it means that a market request of ORDER_FILLING_FOK-type (all or nothing) should be generated when the stop order is accepted. What is the reason why this is not the case?

Pending Order

A trade order to place a pending order. Requires 11 fields to be specified:

  • action
  • symbol
  • volume
  • price
  • stoplimit
  • sl
  • tp
  • type
  • type_filling
  • type_time
  • expiration
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
#define MACRO  \
  if (true)    \
  {            \
    Print(""); \
/*    Print(""); */ \
  }
This is correct, otherwise the bracket } itself
 
A100:
#define MACRO  \
  if (true)    \
  {            \
    Print(""); \
/*    Print(""); */ \
  }
That's right, otherwise the bracket } acts on its own
Why does the double slash act on the backslash? And why does the macro carry the double slash comments when activated?
 
MetaQuotes-Demo
OrderSend(Symb,OP_BUYLIMIT,1,Ask-100*Point,100,0,0,My Order)
Request.action = TRADE_ACTION_PENDING (5)
Request.magic = 0
Request.order = 0
Request.symbol = CHFRUB_TOM
Request.volume = 1.0
Request.price = 57.9
Request.stoplimit = 0.0
Request.sl = 0.0
Request.tp = 0.0
Request.deviation = 100
Request.type = ORDER_TYPE_BUY_LIMIT (2)
Request.type_filling = ORDER_FILLING_RETURN (2)
Request.type_time = ORDER_TIME_DAY (1)
Request.expiration = 1970.01.01 00:00:00
Request.comment = My Order
Request.position = 0
Request.position_by = 0
Result.retcode = 10018
Result.deal = 0
Result.order = 0
Result.volume = 0.0
Result.price = 0.0
Result.bid = 0.0
Result.ask = 0.0
Result.comment = Market closed 53.327 + 0.000 ms
Result.request_id = 334
Result.retcode_external = 0
CHFRUB_TOM - supposedly closed market. Correct it, please.