Questions from a "dummy" - page 79

 
Rosh:
Yes, by myself. In principle, I could post the code in MQL5 for the calculation.
It would be appreciated. It would simplify some of the tasks.
 

Please tell me how to correctly compare Double ( == < > ). Does it need to be normalised? For example, there was such a function in MT4:

CompareDoubles(double number1,double number2)
{
if(NormalizeDouble(number1-number2,8)==0) return(true);
else return(false);
}

And in general, what is the approximate algorithm of NormalizeDouble() function?

Документация по MQL5: Преобразование данных / NormalizeDouble
Документация по MQL5: Преобразование данных / NormalizeDouble
  • www.mql5.com
Преобразование данных / NormalizeDouble - Документация по MQL5
 
220Volt:

Please tell me how to correctly compare Double ( == < > ). Does it need to be normalised? For example, in MT4 there was such a function:

CompareDoubles(double number1,double number2)
{
if(NormalizeDouble(number1-number2,8)==0) return(true);
else return(false);
}

You can find the recommendations in the Handbook. Have a look.
 
220Volt:

Please tell me how to correctly compare Double ( == < > ). Does it need to be normalised? For example, there was such a function in MT4:

CompareDoubles(double number1,double number2)
{
if(NormalizeDouble(number1-number2,8)==0) return(true);
else return(false);
}

And in general, what is the approximate algorithm of NormalizeDouble() function?

Generally, when comparing two numbers of double type, it is recommended to take their difference and compare with permissible threshold value. But I usually compare directly - I've never had any problems.
 

It is known that at the beginning of the chart the history is incorrect, the question "why is it incorrect" does not arise.

Another question arises: how can we programmatically determine the boundary beyond which the incorrect history data follows?

The red vertical line shows the boundary.

 
joo:

It is known that at the beginning of the chart the history is incorrect, the question "why is it incorrect" does not arise.

Another question arises: how can we programmatically determine the boundary beyond which the incorrect history data follows?

The red vertical line shows the boundary.


Is there any way to try and tell from the frequency of the gaps? Count the gaps over a certain period.
 
tol64:
Maybe one can try to determine somehow by the frequency of gaps? Count gaps for a certain period.

There are a lot of ways to get twisted. But I don't see any that are really reliable. Because there is no real criterion for judging the "authenticity" of the data of each individual bar.

All charts are based on minute bars. It could be calculated programmatically up to the date when the correct creation of an older required timeframe is possible. But there is a "however" here, too. However, the minute TFs are not correct to the whole history depth either:

I don't know, IMHO, we need a standard mechanism for identification of such limits, something like this

int Correct_Boundary_of_Timeframe
(
string symbol_name,       // имя символа
ENUM_TIMEFRAMES timeframe  // период
);

-returns the index of the last valid bar of the requested symbol of the required TF.

 
joo:

I don't know, IMHO, we need an in-house mechanism for defining such limits, something like

-returns the index of the last valid bar of the requested instrument of the required TF.

It would be ideal. What for are these broken data provided anyway?
 
joo:

-returns the index of the last valid bar of the requested instrument of the required TF.

I want one of these as well.
 
joo:

There are a lot of ways to get twisted. But I don't see any that are really reliable. Because there is no real criterion for judging the "authenticity" of the data of each individual bar.

All charts are based on minute bars. It could be calculated programmatically up to the date when the correct creation of an older required timeframe is possible. But there is a "however" here, too. However, the minute TFs are not correct to the full depth of history either:

I don't know, I think we need a special mechanism for defining such limits, something like

-returns the index of the last correct bar of the requested symbol of the required TF.

So, if you do not mind to read all history to the past, then I do not see a problem. Find out the time of opening and closing of each bar and look at the number of seconds in these intra-bar ranges. If less than expected, write a "fake" bar. This will be the tipping point, after which all other bars will be incomplete. There is no point in scouring further.