Libraries: YZ_Summer_Time - page 2

 

Yura, I am not against the function, I am against the loud signboard "there is no more reliable option".

We need to call things by their proper names, and the name of this one is the function of determining whether the time belongs to summer/winter for a certain time zone.

Alexey is right - news is clearly associated with a country (hence, with the rules of clock translation), so the function should be different for news.

 

Andrei, Alexei

the news is still released according to the news calendar... The calendar shows the time. which in summer and winter will be shifted according to the time translation.

so it doesn't depend on the country ... in the calendar the news coming out in Japan or Canada will be in the news calendar linked to a specific hour and a minute.

which is actually read by software ... I feed the date to the input of a function that clearly catches the start point of the news.

I tested this algorithm ... of course not on all the dealings of the world.

that's why I asked for an example of a dealing that translates time to other days ...

concerning reliability ... reliability is that the programme clearly catches the transition ... and there is no analogue of the built-in function in the language.

you see ... there is a database... for a couple of three years in it ... there is a time.of news release and if you try to search for the beginning of the news without this function, then in winter or summer there will be an hour of discrepancy.

 

Super!

Way better code than mine (I was approximating very roughly the days in march and october).

Thank you, Yuriy

 

A function like this should be already in metatrader. It's forex, doh.   

 

Error in the code.

You should change the lines


//--- was
 tSeek=StringToTime(IntegerToString(dtf.year)+".10.31 02:00");  // set the last day of October
//--- became
tSeek=StringToTime(IntegerToString(dtf.year)+".10.31 02:00");  // set the last day of October
//--------------------------------------------------------------------------------------------------

//--- was
tSeek=StringToTime(IntegerToString(dtf.day_of_year)+".03.31 03:00");  // set the last day of March
//--- became
tSeek=StringToTime(IntegerToString(dtf.year)+".03.31 03:00");  // set the last day of March


But the function is very useful, thanks to the author. Those who trade session changes and news will appreciate it. For others, it is useless, yes.