Questions from a "dummy" - page 102

 
Alfff:

Hello. I want to run my Expert Advisor on AUD/USD. How do I do that, I only have it working on euro/dollar. I have changed the pair in the Service/Settings/Debug menu. But I got the message"The selected symbol was not found".

Thank you.

Try opening "Market Watch" (Ctrl+M) in the terminal, right-clicking the "Symbols..." option and selecting the desired symbol.
 

Can you tell me how to convert seconds from datetime type to int without yellow warning during compilation.

   datetime DT = 100; 
   int Sec = DT;

Yellow warning: possible loss of data due to type conversion

Both are integer seconds. What should be lost?

 
awkozlov:

Both are whole seconds... What should be lost?

4 bytes

datetime is long in fact

Read about explicit type conversion

Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - Документация по MQL5
 
awkozlov:

Can you tell me how to convert seconds from datetime type to int without yellow warning during compilation.

   datetime DT = 100; 
   int Sec = (int)DT;

Or

   datetime DT = 100; 
   int Sec = int(DT);


Yellow warning: possible loss of data due to type conversion

Both are integer seconds. What should be lost?

datetime == uint, not int. Some are more integer. :)

 
MetaDriver:

or


datetime == uint, not int. There are different kinds of integers. Some are more integer. :)

Thanks.

Then Sleep understands negative milliseconds :)

 
MetaDriver:

or


datetime == uint, not int. Some are more integer. :)

No, it's like that in 4. Here they're already looking to the future.

https://www.mql5.com/ru/docs/basis/types/integer

datetime

8

0 (1970.01.01 0:00:00)

32 535 244 799 (3000.12.31 23:59:59)

__time64_t

Документация по MQL5: Основы языка / Типы данных / Целые типы
Документация по MQL5: Основы языка / Типы данных / Целые типы
  • www.mql5.com
Основы языка / Типы данных / Целые типы - Документация по MQL5
 
awkozlov:

Thank you.

Then Sleep understands negative milliseconds :)

What a pity! Sleep he understands everything... ;)
sergeev:

No, it's like that in 4. Here they're already looking to the future.

https://www.mql5.com/ru/docs/basis/types/integer

datetime

8

0 (1970.01.01 0:00:00)

32 535 244 799 (3000.12.31 23:59:59)

__time64_t

Yeah. Well, it's the same thing. More bloody safe. :-)
 
Can you tell me whether functions such as Sleep() and PlaySound() should be restricted for use in test and optimisation modes, or whether they have already done so?
 
tol64:
Can you advise whether we should restrict functions like Sleep() and PlaySound() for use in test and optimization modes, or have they already implemented it?

Look at this and beyond: https://www.mql5.com/ru/forum/1111/77901#comment_77901

From experience: the tester just scrolls through the history for a specified period of time, if sleep() is involved. I don't remember about the sound discussion.

 
Yedelkin:

Look at this and beyond: https://www.mql5.com/ru/forum/1111/77901#comment_77901

From experience: the tester just scrolls through the history for a specified period of time, if sleep() is involved. I don't remember about the sound discussion.

Thanks. Partly cleared up.

---

The list of objects now has a List All button. I understand correctly, that objects created by Expert Advisor and user are now separated? It means, if the button is not pressed, the list now displays only those objects created by the user. Very handy, thank you. :)

---

I have another question about stack overflow. Sometimes expert won't load. To be more exact, it is loaded and unloaded at once with such a message. The reason is unclear, since it may or may not happen. Who knows what the reason may be?

Reason: