Questions from Beginners MQL5 MT5 MetaTrader 5 - page 46

 

I am facing a problem. I want to close a position if 3 hours have passed since it was opened.

I put the following code in the condition:

TimeCurrent()-PositionGetInteger(POSITION_TIME)>1080

=it doesn't work=

Checking, in the comment

Comment("current time ",TimeCurrent()," positionGetInteger (POSITION_TIME))

=will show

current time 2011.10.17 23.59.59 position open time 1350475200

The tutorial says that both TimeCurrent and POSITION_TIME have datetime type (number of seconds).

Please advise how to correct it.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций - Документация по MQL5
 
udhit: I have encountered a problem. I want to close a position, if 3 hours have passed since its opening. I put the following code in the condition:

TimeCurrent()-PositionGetInteger(POSITION_TIME)>1080

The tutorial says that both TimeCurrent and POSITION_TIME are of datetime type (number of seconds). Please advise how to fix it.

3 hours = 3 x 60 min. x 60 sec.
 
udhit:

I am facing a problem. I want to close a position if 3 hours have passed since it was opened.


Check this in the comments:

Comment("текущее время ",TimeCurrent()," время открытия позиции ",(datetime)PositionGetInteger(POSITION_TIME));
 
uncleVic: Check, in the comments so:
What's there to check:) He put 18 minutes instead of three hours. Changing the "comments" won't help.
 

Good evening!!! I understood correctly that here I have these, remote agents are included? I study them. I have doubts. 50 minutes of testing, I'm optimising, even without the zilch...

Turned it off, because the computer can't write a letter for five minutes... Especially not inserting a screenshot into point.

Apparently, yes, they are. The log says either connection or no connection.

 

Loading your own fonts into MQL5.

Can I upload my font directly to the compiled version of the indicator?

Документация по MQL5: Программы MQL5
Документация по MQL5: Программы MQL5
  • www.mql5.com
Программы MQL5 - Документация по MQL5
 
We are thinking of giving access to standard Windows fonts when drawing in Canvas.

Or is it about changing fonts in standard graphical objects?
 
Renat:
We are thinking about giving access to standard Windows fonts when drawing in Canvas.

Or are we talking about changing fonts in standard graphical objects?
For the clock we would like to use a non-standard font if it were possible to store it directly in resources for example.
 
Renat:

Or are we talking about changing fonts in standard graphical objects?
The text means not to carry around a separate ttf file, but to embed it directly in ex5 as a resource.
 
sergeev:
the text means not to carry around a separate ttf file, but to embed it directly in ex5 as a resource.
exactly :-)