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

Shorten a plot?

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

    Shorten a plot?

    Hi,

    This might be a question for a math wiz, which I'm certainly not. I'm using the following indicator:

    SLOPESCHAFF.Set(Slope(Schaff(23, 50, 9, 9).STR, 4, 0));

    It creates a plot like the one in the attached image. What I'd like to do is "shorten" the plot by 2 periods, for example. I've tried changing the "8" parameter to a lower number but I saw no difference in the plot. Is this possible? I wonder if there's some mathmatical magic to accomplish that? Thanks in advance for any input...
    Attached Files

    #2
    What do you mean shorten? Do you mean that the the most recent plot value is 2 bars behind the current chart bar?
    RayNinjaTrader Customer Service

    Comment


      #3
      Well yes I guess so...but 2 bars before would be preferable...what are potential techniques for manipulating the plot, if any?

      Comment


        #4
        to clarify -

        do you want the indicator value for the current bar to be plotted two bars ago

        or

        do you want the indicator value for the current bar to be plotted on the current bar but make invisible the indicators value for the most recent two bars?
        RayNinjaTrader Customer Service

        Comment


          #5
          Sorry if I was unclear:

          "do you want the indicator value for the current bar to be plotted two bars ago"

          That would be my choice, if possible.

          For example, looking at my attached image, when the plot crosses the "0" line is it possible to manipulate it so that it plots 2 bars before (ago) that? Thank you again for your response(s).

          Comment


            #6
            Try something like:

            if (CurrentBar < 2) return;

            // Your indicator calculations here

            Plot0.Set(2, indicatorValue);

            More info -

            DataSeries.Set(int barsAgo, double value)
            You can also set the value for historical bars by including a "barsAgo" value that represents the number of bars ago that you want the double value to be stored at.
            RayNinjaTrader Customer Service

            Comment


              #7
              I understand. Thank you for your replies.

              Comment


                #8
                Follow up question please.

                Is there a way to "shift" the line plot in "real-time" (vs. historical) in the same manner? With certain indicators I've been able to do this by simply changing the period parameter (the "8" in my example) by increasing/decreasing it...but it is not working for this indicator for some reason.

                Comment


                  #9
                  You can only shift plots forward not backward using displacement setting when adding indicator to chart.
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    OK, thank you.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Brevo, Today, 01:45 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post Brevo
                    by Brevo
                     
                    Started by aussugardefender, Today, 01:07 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post aussugardefender  
                    Started by pvincent, 06-23-2022, 12:53 PM
                    14 responses
                    238 views
                    0 likes
                    Last Post Nyman
                    by Nyman
                     
                    Started by TraderG23, 12-08-2023, 07:56 AM
                    9 responses
                    384 views
                    1 like
                    Last Post Gavini
                    by Gavini
                     
                    Started by oviejo, Today, 12:28 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post oviejo
                    by oviejo
                     
                    Working...
                    X