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

 
Яна Шульга:

Thank you, it worked.
Do you know if it is possible to place orders in the Strategy Tester on MT5? I would like to test one of the standard indicators

Not manually - but I assume it can be done with the trading panels that can be found in CodeBase

... Then you need to save the chart template together with the panel and indicator, and after starting the tester, load this template (the tester does not provide testing of two indicators/advisors at the same time by default)

 

Hello.

Can you tell me something? How do I convert int type to datetime?

It doesn't work like this:

int m = 8;

datetime n = StrToTime(IntegerToString(m));

I can't find anything on the forum for a long time.


 
sdv151079:

Hello.

Can you tell me something? How do I convert int type to datetime?

It doesn't work like this:

int m = 8;

datetime n = StrToTime(IntegerToString(m));

I cannot find anything on the forum for a long time.


The datetime type as well as int is integer, so there is no special need for transformation. It may be just for easiest viewing. But 8 is time 1970.01.01 00:00:08, i.e. 8 seconds passed from the start of 1970.

So in order to see this time

int      m = 8;
Print((datetime)m); // 1970.01.01 00:00 08
 
Alexey Viktorov:

The datetime type is also integer, so there is no need for conversion. It is only for easy viewing. But 8 is time 1970.01.01 00:00:08, i.e. 8 seconds passed from the start of the 1970s.

So in order to see that time.

That's understandable. But I have the following situation.

int m = 8; // This is the clock (i.e., eight in the morning)

Thank you for your reply. You have guided me in the right direction.

Solution:

int m =8;

datetime n = m*60*60;

 
Madmas:

This is understandable. But I have the following situation.

int m = 8; // This is the clock (i.e. Eight o'clock in the morning)

So? What should be done with that time?

 

Hello.

How can I disallow changing/cancelling a stop loss once it has been set? For example, if you try to change the stop, it will revert back to its original value.

 
Alexey Viktorov:

So? What should be done with that time?

The time in the input parameters of the EA is specified in int, since the string type does not loop through the values during optimization of the EA
 
Madmas:
I have specified time in the input parameters as int because the string type does not enumerate values during optimization
 

Function

MQLInfoInteger(MQL_MEMORY_LIMIT)

... returned this value


The reference says that this value is in MB - that's not realistic, where have you seen a RAM of that size?

 
Alexandr Sokolov:

Function

... returned this value


The reference says that this value is in MB - that's not realistic, where have you seen a RAM of that size?

Process address space, virtual memory and related stuff. In general, study it if you want to get out of the sandbox, but if not, consider it magic from Microsoft and use it))).

Reason: