Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting RTH previous session close & current session open using the ETH session data?

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

    Getting RTH previous session close & current session open using the ETH session data?

    Hi,
    I am using ETH data on my equity chart using the "US Equities ETH" trading hours template. Basically I just need to find the previous close and the current open values for the RTH session. Is there an easy way to get the RTH session start time of the current day without loading the data for the RTH session?
    Regards,
    iq


    #2
    Hello iq200,

    You can get a template by name with TradingHours.Get(string instrumentName).

    There is an example of this in the help guide on the BarsRequest page.


    The sessionIterator would provide the start and end session times.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      HI Chelsea,
      Thank-you for getting back.
      If I want to instead just get the previous RTH data close and the current RTH data open when I have the ETH data in the chart, would it be better to load the RTH data and find the values that way?
      Regards,
      iq

      Comment


        #4
        Hello iq,

        Either approach would likely only need a few lines of code.

        Adding a series and ensuring the logic only evaluates on the primary is likely easier to do, but would require loading data when the script starts. This also is affected by behavior where all series must be within trading hours for OnBarUpdate() to update. (Meaning the script will only update where the trading hours of all series overlap)

        Getting a TradingHours object would be more efficient code and doesn't need a series to be added. This would also not be affected by added series using different trading hours templates.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Many thanks Chelsea.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 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