How to find the Friday's market closing time? - page 2

 
Miroslav Popov:

Alain,

Please delete this topic. Nothing useful comes here. 

I don't understand why you are so angry, I am also sure you know you have to follow some rules here.

From my experience the SymbolInfoSession API is working fine. Your real problem seems your chart (data) are not in accord with the session, so it should be investigated and understood. But you don't seem interested to do it.

 
If the fx-market opens at Sunday xx:00 it will close at Friday the same time. So take to open time and add the difference (5*24*3600).
 
Alain Verleyen:

...

From my experience the SymbolInfoSession API is working fine. Your real problem seems your chart (data) are not in accord with the session, so it should be investigated and understood. But you don't seem interested to do it.

The start of this article explain how to use the SymbolInfoSession API, with code example.

Here is what I get for EURUSD on Metaquotes-Demo server :


And I do have data until 23:59.


 

And even the code I used :

   datetime from,to;
   uint session=0;

   while(SymbolInfoSessionQuote(_Symbol,FRIDAY,session,from,to))
     {
      printf("Quoting session %i start %02i:%02i to %02i:%02i",session,from/3600,(from%3600)/60,to/3600,(to%3600)/60);
      session++;
     }

   session=0;
   while(SymbolInfoSessionTrade(_Symbol,FRIDAY,session,from,to))
     {
      printf("Trading session %i start %02i:%02i to %02i:%02i",session,from/3600,(from%3600)/60,to/3600,(to%3600)/60);
      session++;
     }
So please don't come here talking about quality, when you have just posted rudeness and self-promoting.
 
Miroslav Popov:

Alain,

Please delete this topic. Nothing useful comes here. 

And you even deleted all your posts, that's a pity. But the topic will remain.
 

Hello,

I think these two functions work most of the time, yes, but unfortunately not always. When there are special trading hours, like on 2nd of January (holidays) these functions currently are of no help, as far as I could find out with strategy tester. Up to now I didn't find a simple way to solve this, so today I posted a suggestion to service desk to consider for example overloading of theses functions with a datetime in place of an ENUM_DAY_OF_WEEK, which could return this datetimes' real trading/quoting time (hours:minutes) in "from, to". I hope they consider something like this, because otherwise I probably would have to check the complete last year of the broker in question to find eventual deviations from official trading hours. I would need to store them for example in a file and load them in an EA, probably differentiated by symbol. I wouldn't want to hardcode something like this, because I might change the broker in the future, so I want to stay flexible. The kind of solution I suggested would solve this problem I am sure others have, too, in a very convenient way I believe.

Greetings‌

Markus Voltin‌

 
Markus Voltin:

Hello,

I think these two functions work most of the time, yes, but unfortunately not always. When there are special trading hours, like on 2nd of January (holidays) these functions currently are of no help, as far as I could find out with strategy tester. Up to now I didn't find a simple way to solve this, so today I posted a suggestion to service desk to consider for example overloading of theses functions with a datetime in place of an ENUM_DAY_OF_WEEK, which could return this datetimes' real trading/quoting time (hours:minutes) in "from, to". I hope they consider something like this, because otherwise I probably would have to check the complete last year of the broker in question to find eventual deviations from official trading hours. I would need to store them for example in a file and load them in an EA, probably differentiated by symbol. I wouldn't want to hardcode something like this, because I might change the broker in the future, so I want to stay flexible. The kind of solution I suggested would solve this problem I am sure others have, too, in a very convenient way I believe.

Greetings‌

Markus Voltin‌

May I ask why you need to know these information ?
Reason: