Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line at Pivot Highs

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

    Line at Pivot Highs

    Hello,

    Im trying to figure out the best way to draw a Ray/Line at a pivotal high. With HighestBar(), you would just get a value update every x bars its set to, so that wouldnt work. I didnt see anything else in the reference library related to highest bar.

    Thanks,
    Chris

    Click image for larger version

Name:	image.png
Views:	144
Size:	1.5 KB
ID:	1243846

    #2
    Hello ChrisR,

    If you are trying to find the highest price for a period of time HighestBar would be able to do that. I am not certain I understand what you said about that not working, it would only update the highest bar if a new highest bar was formed, it otherwise keeps reporting the same value as long as the previous high remains unbroken.
    The help guide sample shows getting the highest bar and price for the current trading session.

    If you otherwise are trying to do something like the pivots indicator you can take a look at the logic it uses to draw the pivots at different levels.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello ChrisR,

      If you are trying to find the highest price for a period of time HighestBar would be able to do that. I am not certain I understand what you said about that not working, it would only update the highest bar if a new highest bar was formed, it otherwise keeps reporting the same value as long as the previous high remains unbroken.
      The help guide sample shows getting the highest bar and price for the current trading session.

      If you otherwise are trying to do something like the pivots indicator you can take a look at the logic it uses to draw the pivots at different levels.
      My understanding of HighestBar is that it returns the highest bar for the lookback period. As time progress, the lookback period moves foward in time, thus a new highest bar would be returned. In the picture above with a period of say 5, a new highest bar would than be returned in that dip below. Is this not accurate? I want to be able to draw a line at pivotal high, not every new high reported in a defined forward moving lookback period.

      Comment


        #4
        Ideally I would want to do something like this, while ignoring everything in the blue circle as those are not pivotal highs. With a HighestBar at 5, it would return a high bar in that blue circle when they are not pivotal highs.​

        Click image for larger version

Name:	image.png
Views:	113
Size:	8.7 KB
ID:	1244038

        Comment


          #5
          Why not just use the Swing indicator?

          Comment


            #6
            Hello ChrisR,

            The lookback period would only progress forward if you specify a fixed amount, the sample in the help guide uses the property BarsSinceNewTradingDay so it would always be the full session up to the current bar.

            To do something other than finding the highest bar from the start of the session you would need to use logic. What you pictured is similar to the pivots indicator. If you wanted to make multiple levels of pivotal highs that would be a good place to start by either using the pivots indicator or modifying it for your own uses.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            577 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