Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Finding out if a time is in a prior session

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

    Finding out if a time is in a prior session

    I want to find out if a bar from a few days ago is in the RTH or ETH session. I made a couple of sessionIterators with the trading hours templates. But it seems that session Iterators will only tell me if a DateTime is in the current session, not if it was in a past session.

    What is the best way to find out if a datetime from a few days ago was in a session?

    #2
    Here's an example of what I'm doing. If you scroll around, it prints out whether the last bar visible on the screen is in the globex session or cash session
    Attached Files

    Comment


      #3
      Hello frantic,
      Thanks for your post.

      NT is only going to be able to check and see if the bar index you are referencing is inside the currently assigned session template. You would need to assign a static variable and store that information if you want to access it later.

      I think it would be easier to simply reference the template that you have(or had) attached to that instrument during that time.

      Please let me know if you have any questions.
      Josh G.NinjaTrader Customer Service

      Comment


        #4
        Hey Josh,

        I added additional Bars Series to the indicator, with the respective templates. It works for the current session, just not previous sessions for some reason.

        Comment


          #5
          Hello frantic,

          This is because that information is not recorded on the bar by NinjaTrader. If you want to have information about what session a specific bar was on than you will need to begin recording it.

          I can submit this as a feature request for you if you like, just let me know.
          Josh G.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          51 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          31 views
          0 likes
          Last Post PaulMohn  
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          165 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          100 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          160 views
          2 likes
          Last Post CaptainJack  
          Working...
          X