Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line Plot

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

    Line Plot

    I am trying to plot a constant line at 3 and -3 on a panel. this is what I have:

    Add(new Plot(Color.Transparent, PlotStyle.Line, "Plot8")); // Plot 8
    Add(new Plot(Color.Transparent, PlotStyle.Line, "Plot9")); // Plot 9
    Plot8.Set(3); // Make Oscillator Scale constant at 3 on average
    Plot9.Set(-3); // Make Oscillator Scale constant at -3 on average

    I keep getting an error that:

    The name Plot8 does not exist in the current context
    The name Plot9 does not exist in the current context

    Where am I going wrong?


    #2
    Hi velocity, are the associated dataseries added in the properties for Plot8 and Plot9?

    Comment


      #3
      i added the following

      [Browsable(false)]
      [XmlIgnore()]
      public DataSeries Plot8
      {
      get { return Values[8]; }
      }

      [Browsable(
      false)]
      [XmlIgnore()]
      public DataSeries Plot9
      {
      get { return Values[9]; }
      }

      But, it does not work. the scale will go to +1/-1 if the oscillator's values are between +1 and -1. However I want the scale to be +3 amd -3 even if the values are between +1 and -1

      Any thoughts as to where I am going wrong?

      Comment


        #4
        Hi velocity, unfortunately changing the scale is not supported at this time - have you tried working with Min and Max as in this tutorial?http://www.ninjatrader-support.com/H...ionLogic3.html

        Comment


          #5
          that is what i thought too. However, if I place a constant value as an idicator and make it transparent, I was trying to fake NT out so the scale would adjust.

          Any thoughts?

          Comment


            #6
            velocity,

            Not supported at this point in time. If you want to "fake" it out, don't use a transparent color.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              OK. I changed everything to the following and now I do not get any plots, what's wrong here?

              Add(new Plot(Color.Black, PlotStyle.Line, "Plot8")); // Plot 8
              Add(new Plot(Color.Black, PlotStyle.Line, "Plot9")); // Plot 9
              Plot8.Set(3); // Make Oscillator Scale constant at 3 on average
              Plot9.Set(-3); // Make Oscillator Scale constant at -3 on average
              Plots[8].Max = 3;
              Plots[
              9].Min =-3;

              Comment


                #8
                Don't set your plots inside Initialize(). Do it inside OnBarUpdate().
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  that did it, thank you

                  Comment


                    #10
                    Hi,

                    A similar question from me:

                    In my strategy Initialize() section, I have included

                    Add(Stochastics(7,14,3))

                    in the code.

                    When running the strategy, the stochastics panel appears as desired; however, it has the "standard" channel lines at 20 and 80. How do I change those values to 30 and 70, for example? Something like

                    Add(Stochastics(7,14,3),UpLine = 70,DownLine = 30) would be great...

                    Thanks for helping!

                    Comment


                      #11
                      Unfortunately this is not possible without custom coding, as you can only Add() full indicators, not specific plots of indicators.

                      Comment

                      Latest Posts

                      Collapse

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