Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time of first tick of bar (Open)?

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

    Time of first tick of bar (Open)?

    1. Can I determine the time of the first tick of a bar (the time of bar open) on historical data?

    2. Is there a way to call or reference the Session Opening time (the value that is set in the chart properties)?

    I am trying to find a way to calculate the length of time to complete the first bar of a session on a tick or volume bar without hard coding the session start time. Thanks.

    #2
    Originally posted by higler View Post
    2. Is there a way to call or reference the Session Opening time (the value that is set in the chart properties)?
    I tried using the Bars.SessionBegin. I did Print(Bars.SessionBegin) in my Indicator code and I continuously get todays date and SessionBegin time (even for previous days chart bars). To do the calculation that I want I need the SessionBegin to have the appropriate day's date and SessionBegin time and not today's unless I am looking at todays bars. How do I get previous days' SessionBegin DateTime to be correct?

    Comment


      #3
      1. No.

      2. Not supported at this time.
      RayNinjaTrader Customer Service

      Comment


        #4
        Thanks. I think that I can probably do what I want by monitoring for the first bar of a session and extracting the Date portion of Time[0] when FirstBarOf Session is true and extracting the time portion of Bars.SessionBegin (since it seems to have continuously the current date but the correct SessionBegin time) and combining those date and time components to give me the session opening date/time for each day's session. That should get me close enough to what I want to do. I'll just need to dig a little farther into C#.

        Comment


          #5
          Hi higler,

          If you check out the code for the VWAP indicator you will see some techniques that may interest you in terms of getting dates and times. They may not necessarily be the most efficient method, but it gets the job done.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jonfan45, Today, 06:06 PM
          0 responses
          8 views
          0 likes
          Last Post jonfan45  
          Started by rustyspring, Today, 05:15 PM
          0 responses
          10 views
          0 likes
          Last Post rustyspring  
          Started by xulu13, Today, 05:01 PM
          0 responses
          12 views
          0 likes
          Last Post xulu13
          by xulu13
           
          Started by Pbarrionuevo, Today, 04:30 PM
          0 responses
          9 views
          0 likes
          Last Post Pbarrionuevo  
          Started by vantojo, Today, 01:39 PM
          0 responses
          20 views
          0 likes
          Last Post vantojo
          by vantojo
           
          Working...
          X