Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

default trading hours

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

    default trading hours

    hi
    In a script for NT8 i need the open trading time and the close trading time ( in terms of my local time zone) of the default session which is attach to the master instrument.
    i.e. regardless of the session of the chart.

    How it can be done ?

    #2
    Hello,

    In order to do this, you can access the Sessions collection within the TradingHours attached to MasterInstrument, like so:

    Code:
    Instrument.MasterInstrument.TradingHours.Sessions[0].BeginTime
    This will pull the BeginTime of a particular session in the instrument's default Trading Hours template, regardless of what is configured on your chart. Note that there are other properties exposed for each session, as well, such as EndTime, BeginDate, etc.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      thx

      How can i convert this to my local time zone ?

      Comment


        #4
        There are a variety of properties available on TradingHours objects related to the timezone of the Trading Hours template, and I recommend using those as a starting point to convert to your local time.

        The Instrument.MasterInstrument.TradingHours.TimeZoneI nfo.BaseUtcOffset property should prove especially useful. This provides a TimeSpan object showing the offset between UTC and the timezone configured in the Trading Hours template. With that information, and knowing the offset between UTC and your own time zone, you should be able to determine the number of hours to add or subtract from the Trading Hours timezone to convert to your local timezone.
        Dave I.NinjaTrader Product Management

        Comment


          #5
          thx , it works fine

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          663 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          376 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X