Time zone, trading session hours, and holiday schedule

Questions about MultiCharts .NET and user contributed studies.
HPF
Posts: 47
Joined: 02 Apr 2013
Has thanked: 11 times
Been thanked: 7 times

Time zone, trading session hours, and holiday schedule

Postby HPF » 04 Apr 2013

Hi,

I'd be most grateful for help with the following question.

In QuoteManager, I can specify for each symbol the exchange, time zone, hours of the trading session for each day of the week, and a holiday schedule. When I draw a chart in MultiCharts, ticks outside the trading hours or on holidays are not shown and they are not passed on to my indicators and studies either, even if the data feed sends ticks outside the configured trading session. (In order to confirm this behaviour, you can take an existing symbol and manually shorten the trading session. The charts then show only the new, shorter trading session. I agree that this behaviour is useful.)

My question is whether I can get access to the session and holiday data for the current symbol from C#. Possible applications of this function are the following:

1. If there are no ticks on a given Monday, I want to determine whether that Monday was a holiday or whether there was simply no volume.

2. I want to implement an indicator that depends on the time since the most recent holiday or a signal that is suppressed if it is too close to a holiday. For example, I don't want to trade if I cannot keep the position for at least 3 consecutive non-holiday days. For this, I need to know future holidays from the QuoteManager configuration.

3. My data feed might have been down for 10 minutes, and so a few minute bars are missing. If I can retrieve the session hours and holiday schedule from C#, I can determine whether this gap between my minute bars was due to a lost internet connection or due to a regular session break (for example S&P 500 future combined day and globex session, between 3.15pm and 3.30pm CST).

A related question is whether I can call a C# function in order to reaload the most recent n bars of the current chart, i.e. whether I can access the same function as the menu

View -> Reload -> n bars/days back

Thank you for your help. Kind regards,

HPF

HPF
Posts: 47
Joined: 02 Apr 2013
Has thanked: 11 times
Been thanked: 7 times

Re: Time zone, trading session hours, and holiday schedule

Postby HPF » 05 Apr 2013

Here is a partial answer:

Code: Select all

Bars.Sessions.Count
is the number of trading sessions per week as specified in QuoteManager.

Code: Select all

Bars.Sessions[i].StartDay
Bars.Sessions[i].EndDay
are

Code: Select all

DateTime.DayOfWeek
variables indicating on which day, each sessions starts and ends, and

Code: Select all

Bars.Sessions[i].StartTime
Bars.Sessions[i].EndTime
are

Code: Select all

DateTime.TimeSpan
variables apparently corresponding to the start and end time of the session. I have selected local time for my chart, and it seems that all session times I get are in local time as well and all time spans are since midnight local time.

It would be nice to have an official confirmation that this is the promised behaviour of these functions. From the API documentation, I can see that these methods exist, but not how they are supposed to behave. Am I missing anything?

The next step is how to access the configured holidays.

HPF

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Time zone, trading session hours, and holiday schedule

Postby Henry MultiСharts » 05 Apr 2013

Hello HPF,

1) The information you have posted is correct. Session time is in the time zone of the main data series.
2) Unfortunately there is no access to the holiday list from the code at the moment.
You may want to submit a feature request to the Project Management of our web site so other users can vote for it: https://www.multicharts.com/pm/
3) This feature has not been implemented yet. Please vote for the corresponding feature request in our Project Management section.

HPF
Posts: 47
Joined: 02 Apr 2013
Has thanked: 11 times
Been thanked: 7 times

Re: Time zone, trading session hours, and holiday schedule

Postby HPF » 22 Sep 2015

Can I come back to this issue and ask for an update on the status?

Let's say I have a signal that works on daily bars, and the current bar is a Thursday, then how can I find out whether tomorrow, Friday, is a holiday at the relevant exchange or not?

Thanks for your help,

HPF
PS: How is the situation with PowerLanguage? Can I solve it there?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Time zone, trading session hours, and holiday schedule

Postby Henry MultiСharts » 06 Oct 2015

Can I come back to this issue and ask for an update on the status?

Let's say I have a signal that works on daily bars, and the current bar is a Thursday, then how can I find out whether tomorrow, Friday, is a holiday at the relevant exchange or not?

Thanks for your help,

HPF
PS: How is the situation with PowerLanguage? Can I solve it there?
Hello HPF,

There is no way to access holiday list from code. You can hardcode the dates to implement the logic you need.

Barbo
Posts: 7
Joined: 03 Nov 2021
Has thanked: 4 times
Been thanked: 1 time

Re: Time zone, trading session hours, and holiday schedule

Postby Barbo » 18 Feb 2022

Hi all, so am i right that there is still no possibility to access holidays' date from the signals?
Thanks!

User avatar
Kate MultiCharts
Posts: 561
Joined: 21 Oct 2020
Has thanked: 7 times
Been thanked: 139 times

Re: Time zone, trading session hours, and holiday schedule

Postby Kate MultiCharts » 23 Feb 2022

Hi all, so am i right that there is still no possibility to access holidays' date from the signals?
Thanks!
Hello Barbo,

You are correct, at the moment there's no such possibility.
As a workaround it's possible to create a file to read holiday dates from.

Barbo
Posts: 7
Joined: 03 Nov 2021
Has thanked: 4 times
Been thanked: 1 time

Re: Time zone, trading session hours, and holiday schedule

Postby Barbo » 23 Feb 2022

Thank you Kate!
Thi is the way i took.

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Time zone, trading session hours, and holiday schedule

Postby ABC » 24 Feb 2022

Barbo,

most holidays follow a pattern that can be coded. You might even be able to find C# code in the net that does what you need. However, there will still be special events, that do not follow a pattern, that lead to an exchange being closed. So you would end up with a mix of code and list, too.

Regards,

ABC


Return to “MultiCharts .NET”