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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hello,

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.

Regards,
Lawson

Version
5.0
  • You must to post comments
0
0

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. https://www.redcort.com/us-federal-bank-holidays/
/// </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
        SkipDaysInWeek.Add(DayOfWeek.Saturday);
        SkipDaysInWeek.Add(DayOfWeek.Sunday);

        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,
Andrew

  • 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.
  • Robert Murchison
    Has this been considered for addition? I am plotting historical and real-time process data and being able to SkipTimeRangeInDay would be huge. I have been using CategoryDateTimeAxis but this handles uneven datasets poorly as it plots the data by index forcing me to insert a bunch of NaN data to ensure the indexes match up. For my purposes, being able to skip time ranges unique to each date would be ideal.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.