Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Implement different Trading Hours

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

    Implement different Trading Hours

    Dear Ninja-Team,

    I code an indicator and want to set up in the indicator settings different Trading Hours Templates. Do you know how I can implement different Templates in my indicator?

    Thanks for your help & Kind regards,
    Harvard

    #2
    Hello Harvard,

    Thanks for your post.

    An indicator will use the Trading Hours of the Data Series that the indicator is applied.

    If you would like to use different Trading Hours templates for calculations in your script, you could add an additional data series with AddDataSeries() and specify the tradingHoursName of the template you would like to use. The AddDataSeries syntaxes that could be used are below and can also be found on the AddDataSeries() help guide page.

    AddDataSeries(string instrumentName, BarsPeriod ba rsPeriod, string tradingHoursName)
    AddDataSeries(string instrumentName, BarsPeriod ba rsPeriod, string tradingHoursName, bool? isResetOn NewTradingDay)
    AddDataSeries(string instrumentName, BarsPeriod ba rsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)


    See this help guide page for more information about AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

    Please thoroughly review this help guide page about working with Multi-timeframe/Multi-instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.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
      Thanks a lot Brandon. Great support!

      Comment


        #4
        Hi Brandon,

        do you know the syntaxes with which I can get access to the information of the start time & end time of a trading hour template?

        Thanks for your time

        Comment


          #5
          Hello Harvard,

          Thanks for your note.

          You could use Bars.TradingHours.Sessions to get the BeginTime and EndTime of a trading hours template.

          See this help guide page for more information about Bars.TradingHours.Sessions as well as sample code: https://ninjatrader.com/support/help...s_sessions.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


            #6
            Great. Thanks

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X