SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components



Now that SciChart ver 5.0 has been released with support for the DiscontinuousDateTime axis type, I am evaluating it for use in financial charting. I see the NYSECalendar example on how to create a custom calendar but don’t immediately see how I would use the API to handle trading hours for futures contracts. For example, soybeans at the Chicago Mercantile Exchange open for trading Sunday night at 7 PM. They trade until the next morning until 7:45 AM at which point there is a pause and then trading resumes at 8:30 AM and continues until 1:20 PM (yes, I know a bit convoluted). So I want to skip Saturday, but only part of Sunday, and part of Friday after trading is done for the week. How would I achieve this with the DiscontinousDateTimeCalendar? Thank you.


  • You must to post comments

Hi Lawson,

I just looked at the API for the DiscontinuousDateTimeAxisCalender and while it allows skipping specific days of week (e.g. Saturday, Sunday), or time-ranges (e.g. repeating time ranges outside of 09:30 – 16:00) or even special days (Christmas day, New years day), it doesn’t allow you to skip a time-range on just one day (Sunday, or Monday).

(For reference to other viewers, Im including the NyseCalendar Below)

/// <summary>
/// Example of how to make a Discontinuous DateTime Calender for the New York Stock Exchange
/// If you wish to extend this, ensure that public holidays are set for the year(s) which you wish to show data
/// e.g.
/// </summary>
public class NYSECalendar : DiscontinuousDateTimeCalendarBase
    public NYSECalendar()
        // For intraday data, you can add a skip range like this.
        // For daily data, skip ranges will cause the Daily OHLC bars with timestamp at 0:00:00 to be skipped 
        SkipDayTimeRange.Add(new TimeSpanRange(new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0))); // NYSE is open at 9:30 am EST
        SkipDayTimeRange.Add(new TimeSpanRange(new TimeSpan(16, 0, 0), new TimeSpan(24, 0, 0))); // NYSE is closed at 16:00 pm EST

        // NYSE is closed on weekends

        SkipDates.Add(new DateTime(2015, 12, 25)); // NYSE Closed on Christmas Day 2015
        SkipDates.Add(new DateTime(2016, 1, 1)); // NYSE Closed on New years day 2016
        SkipDates.Add(new DateTime(2016, 1, 15)); // NYSE Clsoed on Martin Luther King Day 2016
        SkipDates.Add(new DateTime(2016, 11, 24)); // NYSE Closed on Thanksgiving  2016

What you may have to do is allow all of sunday to be viewable, as well as all of Monday. This will cause a gap on the chart, which is not ideal.

I can ask my team to look into whether we can extend the discontinuous calendar to allow SkipTimeRangeInDay -> e.g. a specific day with a time-range skip. If its possible, we will do it.

Thank you for your feedback,

Best regards,

  • Lawson McWhorter
    Thank you Andrew. I didn’t want to complicate matters in the original question but one other wrinkle is that normal trading hours have changed through time. So to really properly support historical financial charting the API should probably accept start and end dates over which a skip range is valid. The timespan skip range should probably have a day of week associated with it as well. I’m happy to share an example of historical exchange hours if it would be helpful to you and your team. Regards, Lawson
  • Andrew
    Yeah it would be useful to have this info — can you send it to support [at] scichart [dot] com? I think that we can add a Day, Date or Date Range for the skip times. I’ll need to ask the team though.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.