Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detect New Session for OHL Indicator

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

    Detect New Session for OHL Indicator

    I am using a custom session template so that my chart automatically shows 2 sessions for each day. The first session is the overnight session and the second is the pit session.

    I am modifying the CurrentOHL indicator to show additional information. However, the indicator does not recognize the 2 session day. I need the calculations to start from scratch when the new session begins.

    I assume that this is the line that needs to be changed:

    if (currentDate != Bars.GetTradingDayFromLocal(Time[0]) || currentOpen == double.MinValue)

    I need it to look for a session change, not a date change.

    Thanks

    #2
    I changed the line above to

    if (Bars.FirstBarOfSession || currentOpen == double.MinValue)

    and this works perfectly, detecting the session change, not the date change.

    Now, is there any way to stop that ugly vertical line from drawing at the beginning of a new session when all the lines that were plotted in the prior session get re-set to the opening levels of the new session?

    For example, if the previous high was 100 and the new session starts at 90, a vertical line is drawn from the previous high to the current high. I've seen this on indicators before and it is very ugly, especially when you have multiple lines being reset.

    Comment


      #3
      You could have a look at the SessionPivots that can be downloaded here:



      The indicators are designed for use with 2 or 3 sessions per day.

      I personally prefer 3 sessions

      - night session (for ES 5:00 PM CT to 8:30 AM CT)
      - regular session (for ES 8:30 AM CT to 3:15 PM CT)
      - remaining trading time (for ES 3:30 PM to 4:15 PM CT)

      This aligns the session templates to the contractual trading day, which is absolutely necessary for a number of indicators. I have described the session templates in detail. Please follow the link below:

      Reviews, Strategies, Indicators & more | NexusFi community forum


      Attached is a screenshot that displays the regular session high and low with additional information.
      Attached Files

      Comment


        #4
        Hello nedrob519,

        Thank you for your post.

        To disable the Session Break Line, right click in your chart > select Data Series > set Plot Session Break Line to False > OK.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        656 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        371 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        579 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X