Questions from Beginners MQL5 MT5 MetaTrader 5 - page 702

 
Kirill Andreev:
What does trailing stop, from the standard library in mt5 return(-1); ?
More specifically: file path and function name...?
 
Vladimir Karputov:
Go to your product settings, then the "Management" tab, then "Moderator comments" and write a request for deletion.
Thank you, got it.
 
Vladimir Karputov:

About number of seconds and timeframes:

PeriodSeconds
PeriodSeconds Returns the number of seconds in a period. int PeriodSeconds ( ENUM_TIMEFRAMES period=PERIOD_CURRENT // graph period ); Parameters period=PERIOD_CURRENT [in] Value of graph period from ENUM_TIMEFRAMES enumeration. If the parameter is not specified, the number of seconds of the current chart period, at which the program is running, is returned. Returned value Number of seconds in the specified period. See also _Period, Graph periods, Date and time, Object visibility

Documentation | 2015.12.03 13:33

You're like an official, if he doesn't know what to answer, he pours water - I've seen the reference. The question is how to calculate how many bars of the upper TF can be built from the bars of the current TF.

 
-Aleks-:

You are like an official, if he does not know what to answer, he pours water - I have seen the reference. The question is how to calculate how many bars of the upper TF can be built from the bars of the current TF.

The question is: why? :). What kind of problem is it when the condition is reversed through the head?
 
Vladimir Karputov:
The question is: why? :). What kind of task is it when the condition is reversed through the head?
The task is to determine the borders of the graphical object. It is necessary to know on the current TF where the beginning and the end (including the future one) of the bar of the upper TF are.
 
-Aleks-:
The task is to determine the boundaries of the graphical object. You need to know where the beginning and the end (including the future one) of the bar of the upper TF is at the current timeframe.

Have you already drawn the graphical object itself on the current timeframe?

 
Vladimir Karputov:

Have you already drawn the graphical object itself on the current timeframe?

Yes. The boundaries can be defined normally if the current timeframe is less than one hour, and then everything moves off...
 
-Aleks-:
Yes. The borders can be well defined if the current timeframe is less than one hour, and then everything moves off...

If you have already drawn a graphical object, that's it. It will be drawn on all timeframes.

In the example of the rectangle - you have set coordinates for two points (time1,price1) and (time2,price2). And based on these coordinates, the rectangle will be drawn at any timeframe.

 
-Aleks-:
The task is to determine the boundaries of a graphical object. It is necessary to know where the beginning and the end (including the future one) of the bar of the upper TF is located in the current TF.
Dmitriy has a solution to your question in this article. (CopyTime() to help).
 
Vladimir Karputov:

If you have already drawn a graphical object, that's it. It will be drawn on all timeframes.

In the example of the rectangle - you have set coordinates for two points (time1,price1) and (time2,price2). And by these coordinates, the rectangle will be drawn at any timeframe.

Maybe I'm not explaining myself very well... I draw the object with time, i.e. the first point is the beginning of the day and the second is the beginning of the next day.

I need to find out for any upper TF:

1. How many objects may be drawn in total on the current TF, taking into account that one object per one bar of the upper TF

2. Where the object starts and ends

Artyom Trishkin:
In this article Dmitry has the solution to your question. (CopyTime() to help)

Yes, I've studied it, but it's too long to use CopyTime() - is there no simpler option?

Analogue of iTime() is needed.