Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Two line in the same window of indicator

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

    Two line in the same window of indicator

    Dear Forum, I made a simple indicator. In the output window all is ok....but if I would plot in a separate window below the graph I can plot only one line but I need 2 or more line.

    The code that I use is:

    Code:
     protected override void Initialize()
            {
                CalculateOnBarClose	= true;
                Overlay				= false;
                PriceTypeSupported	= false;
    			
    			Add(new Plot(Color.Green, "Delta"));
    			Add(new Plot(Color.DarkViolet, "Avg"));
    						
    			Add(new Line(Color.DarkViolet, 0, "Zero line"));
    			
            }
    Code:
    Value.Set(a-b);
    			
    			Avg.Set(a);
    The error is http://clip2net.com/s/67GQkA

    If I Comment the line like this....all work well but with only one line plotted:
    Code:
    Value.Set(a-b);
    			
    			//Avg.Set(a);
    Tnx to all

    #2
    How would your properties section of the script look? Is a public property for the plots as well defined and linked to the needed Values series? It does not look that way from the error message seen.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      How would your properties section of the script look? Is a public property for the plots as well defined and linked to the needed Values series? It does not look that way from the error message seen.
      I have made screen because this region is Empty

      Comment


        #4
        Right, that's exactly what I meant. For the setup needed please have a look at the Stochastics indicator shipped with NT.

        With setting a value to the Value series this would be expected to work nonetheless since that is always present and the main indicator value. However if you want to custom define how those values are visualized you would need Plots and those need to be linked in the properties then to your desired underlying value series like the Stochastics will show.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Right, that's exactly what I meant. For the setup needed please have a look at the Stochastics indicator shipped with NT.

          With setting a value to the Value series this would be expected to work nonetheless since that is always present and the main indicator value. However if you want to custom define how those values are visualized you would need Plots and those need to be linked in the properties then to your desired underlying value series like the Stochastics will show.
          Ok many thanks for Help...I will made test immediatly.

          Tnx for now ....very fast and very best

          Comment


            #6
            I have added that
            Code:
               #region Properties
            		
            		[Browsable(false)]
            		[XmlIgnore()]
            		public DataSeries D
            		{
            			get { return Values[0]; }
            		}
            
            		/// <summary>
            		/// Gets the slow K value.
            		/// </summary>
            		[Browsable(false)]
            		[XmlIgnore()]
            		public DataSeries K
            		{
            			get { return Values[1]; }
            		}
            		
                    #endregion
            and now I have modified also that
            Code:
             protected override void Initialize()
                    {
                        CalculateOnBarClose	= true;
                        Overlay				= false;
                        PriceTypeSupported	= false;
            			
            			Add(new Plot(Color.Green, "Delta"));
            			Add(new Plot(Color.DarkViolet, "D"));
            						
            			Add(new Line(Color.DarkViolet, 0, "Zero line"));
            			
                    }
            and
            Code:
            Value.Set(a-b);
            			
            			K.Set(a);
            but I see nothing on the window BELOW. How is the error in the proprety?

            Comment


              #7
              Please add something like that your Initialize() as well -

              Add(new Plot(Color.DarkViolet, "K"));

              Or replace K.Set(a); with Values[1].Set(a);

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                Please add something like that your Initialize() as well -

                Add(new Plot(Color.DarkViolet, "K"));

                Or replace K.Set(a); with Values[1].Set(a);
                Ok I will test now...many thanks. Now I am understanding something ....tnx.
                I will post results

                Comment


                  #9
                  Sounds good, please keep us updated ketron82.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  602 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
                  560 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  559 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X