Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get # of bars ago using Swing syntax

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

    How to get # of bars ago using Swing syntax

    The definition of the Swing indicator says that it is possible to determine the number of bars ago a swing point occurred.

    Could you explain how can I use this indicator (what is the syntax) to to do that?

    I don't understand the syntax in the help guide, it says:

    "
    High Bar
    Swing(int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod)
    Swing(IDataSeries inputData, int strength).SwingHighBar(int barsAgo, int instance, int
    lookBackPeriod)
    "

    So, correct me if I am wrong, I think I would need to indicate barsAgo here, so how is it possible to extract it then?

    My goal is to get the number of bars ago using Swing syntax. If it claims that it is doable.

    Thank you

    #2
    Hi ionaz,

    Yes, you can use HighBar method to return the # of bars since a swing high occurred. A suitable barsAgo for the input parameter to this method is 0.

    Please see this recent thread for some ideas on using this method. The thread is about the ZigZag indicator, but swing works much the same way.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks RyanM!

      It worked!

      Comment


        #4
        Back to the old topic, how I can find the 10'th bar from the last swing high? I looking through zigzag thread, but could not find anything helpful.Thank you in advance.

        Originally posted by NinjaTrader_RyanM1 View Post
        Hi ionaz,

        Yes, you can use HighBar method to return the # of bars since a swing high occurred. A suitable barsAgo for the input parameter to this method is 0.

        Please see this recent thread for some ideas on using this method. The thread is about the ZigZag indicator, but swing works much the same way.

        http://www.ninjatrader.com/support/f...ad.php?t=45401

        Comment


          #5
          Ok got it myself. If anyone need it:

          if(Swing(4).SwingHighBar(0, 1, 15) == 10)
          Last edited by meowflying; 02-16-2016, 03:04 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X