Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing high and low

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

    Swing high and low

    Using the strategy builder I'm trying to mark swing high and swing lows. So I am able to say if the high is greater than the high for the previous 10 bars using the (bars ago) line. But how do I say if the high is greater than the high 10 bars in front of it? It won't use negative numbers to reference bars in front of it. I have created a similar indicator in TOS and it looks like the attached image. You can see how it draws lines at the highs and lows.
    Attached Files

    #2
    Hello Shiner452,

    Thanks for your post.

    If your intent is to create an indication of where the swing is you can use the swing indicator itself on the chart. If you do not like the use of the dots that Swing employs, you can easily change the display from Dots to a line by changing the plots "Plotstyle" in the indicator panel. I've attached a screenshot of what swing indicator looks like when these are set to a line plotstyle instead of the default dots:

    Click image for larger version

Name:	Shiner452-1.PNG
Views:	486
Size:	39.9 KB
ID:	1172193


    Comment


      #3
      So I have done that but I feel i need to make my own because when I try and reference the swinglow or swing high in the swing indicator that comes with NinjaTrader it only uses a recent low and not the actual swing low line.

      Comment


        #4
        Here see this annotation. It only takes trades during RTH which is why I’d didn’t go long on the swing high but it has no reason to go long where it did.
        Attached Files

        Comment


          #5
          Hello Shiner452,

          Thanks for your post.

          You are welcome to create anything that you wish but I will tell you that the Strategy builder will be a limitation in trying to reconstruct the swing indicator if that is your thinking.

          I would suggest instead spending some time with the swing indicator to best understand how it works and testing various "strength" settings to have the indicator perform as you wish.

          The swing indicator is a lagging indicator meaning that it does not confirm a swing until the "strength number of bars have passed provided that price has not exceeded that potential swing. Once the indicator has confirmed the swing, then at that point the dots are drawn back the strength number of bars to identify the swing point, and then on subsequent bars, the dots will continue to be drawn until price exceeds the current swing high indicating that a new potential swing high is occurring.

          From a strategy builder perspective, what I would suggest is to create a double variable to hold the swing high and another to hold the swing low. Then create a set where the condition is (using strength setting of 5 (which is the default) Swing(5).SwingHigh[0] >Swing(5).SwingHigh[6] and the action would be to save the value of Swing(5).SwingHigh[6] into the double variable. The same but opposite in another set for the swing low. Then for trading check that the High data series crosses above the double variable, same but opposite for low.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          56 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          133 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X