Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add displacement in AddPlot() in NinjaTrade 8

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

    How to add displacement in AddPlot() in NinjaTrade 8

    Hello,

    I could not find any reference in "How to do Displacement in AddPlot()" in NinjaTrade 8.

    In NinjaTrader 7, this is what I code:

    Add( new Plot( new Pen(Color.Red, 1), "MA1" ));
    Displacement = 26; // Move MA1 forward by 26 bars

    Can someone please help me to convert the above code to NinjaTrader 8?

    Thanks,

    Richard

    #2
    Hello Richard,

    The Displacement property is the same in NinjaTrader 8.


    Are you receiving an error with this?

    (Please note, changes to properties require that you remove and re-add the instance of the script from the chart)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.

      I tried that and it works.

      However, is there a way to selectively specify displacement for some MAs and no displacement for other MAs within the same script?

      Comment


        #4
        Hello Richard168,

        No, the displacement will apply to the indicator not the plot.

        Separate the plots into separate indicators.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hard Time

          I have been trying to develop an 11SMA (high,Low,Close) indicator with a displacement of 6 can someone help. I was able to do it as a strategy but not as an indicator and I am not skilled at this. Thanks

          Comment


            #6
            Hello wealthcig,

            In the Indicators OnStateChange method when State is State.SetDefaults add Displacement = 6;.

            Then remove the instance of the indicator and add a new instance of the indicator to the chart.

            Below is a public link to the help guide on Displacement.


            Unfortunately, Displacement cannot be used with Strategies and only works with Indicators.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              What about the High,Low Close

              Comment


                #8
                Then remove the instance of the indicator and add a new instance of the indicator to the chart.

                What? I don't understand computer language. do you have pictures

                Comment


                  #9
                  Hello wealthcig,

                  Your previous inquiry is how to use the Displacement property to render a plot a set number of bars forward or back in relation to the bars on the chart.

                  What are you asking about the High, Low, and Close?

                  To remove and re-add an instance right-click the chart > select the active instance of the indicator in the Configured list > click the remove button. In the Available list select the original indicator > click the add button below in the Configured area to add a new instance.

                  Below is a short video that demonstrates removing an instance of the ADL indicator and adding a new instance of the ADL indicator to a chart.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    thanks will look at video

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X