Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawLine DateTime begin DateTime End question

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

    DrawLine DateTime begin DateTime End question

    I want to draw a line at a certain Y value with a StartTime at the beginning of the session and ending on the current bar.

    In DateTIme format, how would I characterize the start of Oil futures at the beginning of the session and the end time on the current bar? It seems tricky as after the session passes through midnight, the BeginTIme will be yesterday????

    Also, I think this means that the DrawLine tag will have to have a unique string which relates to the session number and not "CurrentBar". Is there a way to do that?

    regards,
    taddypole...

    #2
    Hello taddypole,

    You may want to use the "GetNextBeginEnd" to be able to get the beginning and end times of a Session so that you may draw your line.



    As for the tag, if you are only going to be drawing one line per session you may want to use the "Date" or "DateTime" of the beginning or end to help with a unique identifier.
    JCNinjaTrader Customer Service

    Comment


      #3
      thank you JC...

      I looked at this method, but it seems that at a given time if I use this method I get the "next" begin/end time. It seems I need the "Current" begin time of the current session to start my DrawLine.

      Am I reading this correctly? If oil starts at 5:00 PM and I read a bar at 9:00 PM, is the "next" begin time 5:00 PM the next day or is it 5:00 PM of the current day?

      Comment


        #4
        Hello Taddypole,

        It would be the Current Day still. So if you checked it after the start of the Session template the Session start will be the current Session.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        173 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        91 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        129 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        209 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        186 views
        0 likes
        Last Post CarlTrading  
        Working...
        X