Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Question about .SwingHighBar vs. .SwingHigh

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

    Question about .SwingHighBar vs. .SwingHigh

    Hi All,

    I'm here working on my new strategy and I've come across something I can't find any information on.

    I notice when studying code examples of the zig-zag indicator or the swing indicator, and then comparing them to the code generated in the wizard, there is something called the "highbar" (in the examples), and something just called "high" (in the code of the wizard generated output).

    When I use the swing indicator in the wizard conditions sets, and view the code, I only ever see "SwingHigh" as part of the code. I don't see a way to implement the "SwingHighBar" syntax in the wizard. Is this syntax not available in the wizard?

    For example, if I want to do a comparison between the most recent swing high and the previous one, is it possible to do this in the wizard?

    As always, thank you for all your input!

    -V

    #2
    Hello Aurum,

    Thank-you for your post and questions.

    You are correct, the swing bar number is not available in the wizard and without that it is not possible to compare swing highs via the wizard.

    Please let me know if you have any other questions.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      I have a similar question.

      I am trying to compare Current Swing Low to Previous Swing low, but in doing so, Swin(10).SwingLow[0] is returning Bar low value and not the actual swing low value. How can I fix this issue?

      Thanks

      Comment


        #4
        Hello MyFirstMillion,

        Thanks for your post.

        The code you show (not sure if it was a typo) should be: Swing(10).SwingLow[0]. It will return the current value of the current swing low.

        The swing low, with a strength setting of (10) will not show the swing low until 10 bars have passed. Otherwise, the current value (as it processes) would be the previous swing low. To help illustrate this see the attached screenshot that shows the swing indicator with a strength of 10. The swing lows are shown as Orange colors. I added blue dots that show what the code Swing(10).SwingLow[0] would be using as the swing low and this is indicated by the blue dots. This shows that 10 bars must pass before the newest swing low if confirmed and then known to the code.

        To compare the values of swing lows you would need to be able to obtain the bars ago of the previous occurrences of the swingLows. If you are using the wizard, the barsago value is not available and you would need to work directly in Ninjascript using the swing method for obtaining the bars ago value of the current swing low and then the previous swing low. Here is a link to the helpguide: http://ninjatrader.com/support/helpG...nt7/?swing.htm
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          It seems like this indicator will not work for me then.Thank You.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by frankthearm, Yesterday, 09:08 AM
          11 responses
          41 views
          0 likes
          Last Post frankthearm  
          Started by junkone, Today, 11:37 AM
          0 responses
          6 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          35 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          34 views
          0 likes
          Last Post love2code2trade  
          Working...
          X