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

Customize Swing Indicator

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

    Customize Swing Indicator

    Hi everyone,

    I am a new user of NT, and I have a 'stupid' question.

    The default Swing Indicator draws short lines of dots for the high and low swings.
    How can I customize this into drawing single dots instead of lines of dots? (see attached pictures, AS-IS and TO-BE)

    Thanks for your help in advanced.

    Qosimo
    Attached Files

    #2
    Hello Qosmio,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    This would involve modifying the indicator's code to change how the indicator plots.

    As the Swing indicator starts from a point and then plots backwards, we just want to plot the last dot (the last dot being the dot you want to show as seen in screenshot TO-BE) rather than the first dot on the chart.

    As you won't be able to modify the default Swing indicator, follow these instructions to create a copy:
    • Click New -> NinjaScript Editor in the Control Center
    • Double-click the Indicators folder in the right panel
    • Scroll down until you find the Swing indicator. Double-click on it.
    • Right-click within the code and select Save As


    Once you have saved the copy, you'll want to select it and then modify it.
    1. Comment out line 125
    2. Below this line, you'll want to change SwingHighPlot's index from i to Strength
    3. Comment out lines 133 and 134
    4. Comment out line 166
    5. Below this line, you'll want to change SwingLowPlot's index from i to Strength
    6. Comment out lines 174 and 175
    7. Comment out lines 204 and 205
    8. Comment out lines 219 and 220


    Once these changes have been made, ensure to compile the code.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Team I need to customize swing indicator. When defining strenth i need to add one more condition. Apart for bar looking for higher high or lower low, it should also satify higher close or lower close. So basically need to add close conditions also apart from higher high, lower low (swing high and Swing low). let me know how can one develop this

      Comment


        #4
        Welcome to the forums Manojs1310!

        I suggest carefully reviewing the Swing indicator's source code to understand how it works before making modifications.

        If you are new to indicators, please see the resources below for accessing Price Series, and how plots are added and values are assigned to plots. It can also help to review the other indicator to see how those are written and how they work.

        Working with Price Series - https://ninjatrader.com/support/help...ice_series.htm

        AddPlot (creating plots and assigning values) - https://ninjatrader.com/support/help...8/?addplot.htm

        You can then see how the Swing indicator works with High/Low and then implement new code for Close.

        Also to consider, if you interested in services to have these modifications done for you, we can have a representative of our EcoSystem reach back with more information on NinjaScript Consultants who would be happy to do so at your request.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,406 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        98 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        160 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        9 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X