Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Holidays before DataSeries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Holidays before DataSeries

    TradingHours.Holidays only contains Holidays of the data series.
    How do I check if a DateTime before the start of the data series was a holiday?
    I know that I could AddDataSeries but this is an extreme boilerplate for such a simple task.

    #2
    Hello Bobin,

    Thanks for your post.

    SessionIterator could be used to get various trading hours data elements that apply to a segment of bars.

    You can use the SessionIterator to test if a specific date is a defined trading day.

    See the help guide page below for more information and example code.
    SessionIterator: https://ninjatrader.com/support/help...oniterator.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Brandon,
      thank you.

      So I would have to create a new SessionIterator.
      But how do I do that?
      I have no Bars object to pass, because I try to get holidays before the beginning of the data series.

      Comment


        #4
        Hello Bobin,

        Thanks for your note.

        It would not be possible to get information about a data series before that series is processed.

        You would need to store the sessions once bars are ready, but before OnBarUpdate is called similar to the example code in the SessionIterator help guide.

        Note that you would be able to do something in the script as early as Bar 0 from OnBarUpdate().

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ETFVoyageur, Today, 02:10 AM
        0 responses
        8 views
        0 likes
        Last Post ETFVoyageur  
        Started by rayyyu12, Today, 12:47 AM
        0 responses
        8 views
        0 likes
        Last Post rayyyu12  
        Started by ETFVoyageur, 05-07-2024, 07:05 PM
        17 responses
        137 views
        0 likes
        Last Post ETFVoyageur  
        Started by ETFVoyageur, Yesterday, 10:13 PM
        1 response
        11 views
        0 likes
        Last Post ETFVoyageur  
        Started by somethingcomplex, Yesterday, 10:36 PM
        0 responses
        10 views
        0 likes
        Last Post somethingcomplex  
        Working...
        X