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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X