Questions from a "dummy" - page 67

 
sergeev:

the number of elements is specified by a constant

If the number of 'elements is not known beforehand, use ArrayResize.

These are the basics of c++

const int elements=4;
If so, it didn't help.
 
x100intraday:
If so, it didn't help.

#define  elements 4
 
sergeev:

Thank you.
 

Hello.

Can you please tell me how to set up a highlighted area in MetaTrader 5 to be able to track current orders?

See attached screenshot.

Thank you in advance.

Files:
uf2mcfxvni.JPG  285 kb
 
Dimm-ua:

Hello.

Can you please tell me how to set up a highlighted area in MetaTrader 5 to be able to track current orders?

See attached screenshot.

Thank you in advance.


The "Toolbox" window, "Trade" tab.
 
Karlson:
Tools window.Trade tab.
I must be a complete dummy, but there is no such thing
 
 
Karlson:

OK, thank you very much - sorted
 

Question to the developers - does a position reversal change the opening time of a position? If not, how do we get the position rollover time?

It turns out that a position can only be reversed in two requests - to close the current position and open a new one in the opposite direction, then the position open time will be equal to the reversal time. And if we flip by one request, then we cannot get the position rollover time using the PositionGetInteger function...?

 

Took the simplest example of an in-house indicator - Fractals: https://www.mql5.com/ru/code/viewcode/30/5540/fractals.mq5. There are such code stacks there:

ExtUpperBuffer[i]=High[i];
ExtLowerBuffer[i]=Low[i];

These buffers are dynamic of double type.

Further on the need to store not only the price data - High and Low - but also the specified HighTime and LowTime of the extreme bars (as you know, all TFs, except for M1, have approximate time values, therefore I had to calculate the exact time for myself to add it into the time buffers for further use). Captain Hindsight suggests that we need to declare appropriate arrays of datetime type, then fill similarly:

ExtUpperTimeBuffer[i]=exactTime[0]; // правая часть - элемент массива, вычисленный заранее
ExtLowerTimeBuffer[i]=exactTime[0]; // правая часть - элемент массива, вычисленный заранее

and else:

ExtUpperTimeBuffer[i]=EMPTY_VALUE;
ExtLowerTimeBuffer[i]=EMPTY_VALUE;

but before that, go to datetime help and discover:

"Date and timeconstants... " and "...can be represented as a literal string". In addition, we cannot associate arrays of this type with indicator buffers (and we don't need to?), we cannot apply SetIndexBuffer to arrays of this data type for well-known reasons. And we do not. We reflect upon it for a long time and come to the conclusion that it is OK. We compile the resulting code. We get a warning"truncation of constant value" regarding strings with =EMPTY_VALUE(we feel sad) and an error in the Expert Advisor's report: "Array out of range " regarding the same strings (we feel sad at the end). It seems thatEMPTY_VALUE does not wantto fit into datetime type , while the array's size remains zero. ChangingEMPTY_VALUE to 0, the error disappears but the array's size is still zero. Another strange thing is also strange: the sizes of buffers Ext UpperBuffer and ExtLowerBuffer are non-zero, which means that they are filled nevertheless the fractals don't appear. Why is this suddenly the case?

The main thing I'm interested in: is it possible to fill time buffers directly like price buffers (without resorting to CopyTime and other regular functions of copying to array) and how, and if not, why? Really, for this purpose I should make another pair of buffers for storing seconds from beginning of 1970, but with type not datetime, but some double or long, for example, and at necessary moments to convert through TimeToString to time format as literal string?

P.S.: who is too lazy to reproduce the completed code of Fractals.mq5, just tell me, how do you store the calculated time-specific data (without calling handles of built-in indicators and working with them)?

Thank you.