Announcement

Collapse
No announcement yet.

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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X