Questions from a "dummy" - page 59

 
Yedelkin:
Two-dimensional arrays like array[][] won't work?
In theory, they should, and I've even tried... I haven't mastered it. I would like to see a ready implementation, if it is possible in principle. There were a lot of hitches immediately... If we're talking about a two-dimensional array, the first thing that puzzled me was that the buffers are initially undefined, i.e. dynamic. How could they be loaded into the parent array? And then... If each buffer has its own individual length when filled, we'll end up with a cubic array instead of a two-dimensional one, and it won't even be a cube, but some kind of 3D tetris.
 
x100intraday:
In theory they should, I even tried... I couldn't do it. I'd like to see a finished implementation, if it's possible in principle. There were a lot of hitches immediately... If we're talking about a two-dimensional array, the first thing that puzzled me was that the buffers are initially undefined, i.e. dynamic. How could they be loaded into the parent array? And then... If each buffer has its own individual length when filled, we'll end up with a cubic array instead of a 2D one, but it won't even be a cube, but some kind of 3D tetris.
Use the structure as a wrapper for a dynamic buffer. It's been tested - it works.
 

Can you tell me how to find the closing time of a transaction?

I can't find it in the deal properties.

 
masharov:

Can you tell me how to find out the closing time of a transaction?

I can't find it in the deal properties.

The trade (order) has no closing time, as it was in MT4. In order to determine the lifetime of a "single trade", as it was in MT4, we will have to analyse "opening" (IN) trades and "closing" (OUT/INOUT) trades.

The same applies to the position.

 
The Reference Manual says that for thePositionGetSymbol() function "if no position is found, an empty string will be returned". And if it is the return of empty strings that needs to be tracked, what should the value returned by the function be compared to: with NULL or with "" (two quotes)?
 
Yedelkin:
The Reference Manual says that for the PositionGetSymbol() function "if no position is found, an empty string will be returned". And if it is necessary to monitor the return of empty strings, what should the function return value be compared to: NULL or "" (two inverted commas)?
You need to use another function to check if there is a position.
 
Renat:
You need to use another function to check if the position exists.
No, the purpose is not to check if there is a position, but to apply the continue operator when an empty string is returned in the loop. I wrote in a previous post:"it is necessary to monitor the return of empty strings", so who can tell me what to compare?
Документация по MQL5: Основы языка / Операторы / Оператор продолжения continue
Документация по MQL5: Основы языка / Операторы / Оператор продолжения continue
  • www.mql5.com
Основы языка / Операторы / Оператор продолжения continue - Документация по MQL5
 
Yedelkin:
No, the purpose is not to check whether the position exists, but to apply continue operator when an empty string is returned in the loop. I wrote in a previous message:"it is necessary to track the return of empty strings".So what to compare, who will tell?

The help section has a void type and a NULL constant. In fact, you could have checked it a long time ago:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   string a=NULL;
   string b="";
   if(a==b)
      Print("Пустая строка и NULL - одно и то же");
   else
      Print("Пустая строка не равна NULL");
  }
//+--
 
Rosh:

There is a section in help about the void type and the NULL constant.

Well, yes, there is a section. Only this section doesn't say exactly how an empty string is denoted. The example in the section uses the NULL variable only to detect an uninitialized string.

As for self-checking, the question arose after the compiler blurted out the phrase

switch(PositionGetSymbol(i)!=(NULL || ""))

as follows:"implicit conversion from 'number' to 'string'" but comparing the specified string-values separately did not cause the compiler any objections . That's why I asked the question instead of getting aggravated by near-theoretical reasoning about "cast to an older type" and trying to simplify the code.

From your example you can see that at least language developers use double quotes without spaces to denote an empty string. That's what I wanted to know. Thank you.

 
Yedelkin:

Well, yes, there is a section. Only this section doesn't say exactly how an empty string is identified. The example in the section uses the NULL variable only to detect an uninitialized string.

As for self-testing, the question has arisen after the compiler has blurted out the following phrase

What were you expecting to get from this expression?

(NULL || "")
Read Boolean operations
Reason: