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 geddyisodin, Today, 05:20 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by Max238, Today, 01:28 AM
                    3 responses
                    32 views
                    0 likes
                    Last Post Max238
                    by Max238
                     
                    Started by timko, Today, 06:45 AM
                    2 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_ChristopherJ  
                    Started by habeebft, Today, 07:27 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post habeebft  
                    Started by Tim-c, Today, 03:54 AM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Working...
                    X