Announcement

Collapse
No announcement yet.

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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        553 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        100 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        546 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X