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

Cracking the Swing Code

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

    Cracking the Swing Code

    As I try to learn to code indicators I am examining the code of the standard "Swing" indicator - which marks lines at high and low price pivots. I can't figure out where in the code the values are plotted.

    Ultimately, I hope to be able to add a diamond above or below the actual pivot point ( and still leave the trail of dots as is).

    Any guidance would be appreciated.

    #2
    Hi Richard,

    The Swing indicator is one of the more advanced indicators in terms of programming code.

    What I can tell you is that plot values are stored in the SwingHighPlot and SwingLowPlot DataSeries objects. Wherever you see a .Set() method called is where a value is being stored to the DataSeries and wherever you see a .Reset() is where a value that may have been previously stored is being removed resulting in "no plot" at that bar visually.
    RayNinjaTrader Customer Service

    Comment


      #3
      I think that its quite similar to the to the Scalper indicator in the shared section, in that it doesn't know the swing bar until a couple of bars later, so it overrides the Plot class to add them after the fact.

      Also interesting adding them both on the same chart as they agree half the time.

      Comment


        #4
        Hi Richard did you ever succeed in figuring out this indicator of yours that you described? I'm very interested in it. Please let me know because I've been trying to build one myself as well.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by habeebft, Today, 07:27 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by AveryFlynn, Today, 04:57 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Max238, Today, 01:28 AM
        4 responses
        38 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by r68cervera, Today, 05:29 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X