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
Time zone, trading session hours, and holiday schedule
Re: Time zone, trading session hours, and holiday schedule
Here is a partial answer:
is the number of trading sessions per week as specified in QuoteManager. are variables indicating on which day, each sessions starts and ends, and are 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
Code: Select all
Bars.Sessions.Count
Code: Select all
Bars.Sessions[i].StartDay
Bars.Sessions[i].EndDay
Code: Select all
DateTime.DayOfWeek
Code: Select all
Bars.Sessions[i].StartTime
Bars.Sessions[i].EndTime
Code: Select all
DateTime.TimeSpan
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
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Time zone, trading session hours, and holiday schedule
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.
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.
Re: Time zone, trading session hours, and holiday schedule
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?
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Time zone, trading session hours, and holiday schedule
Hello HPF,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?
There is no way to access holiday list from code. You can hardcode the dates to implement the logic you need.
- Kate MultiCharts
- Posts: 614
- Joined: 21 Oct 2020
- Has thanked: 12 times
- Been thanked: 155 times
Re: Time zone, trading session hours, and holiday schedule
Hello Barbo,Hi all, so am i right that there is still no possibility to access holidays' date from the signals?
Thanks!
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.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Time zone, trading session hours, and holiday schedule
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
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