Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding additional Plots to my indicator

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

    Adding additional Plots to my indicator

    I already have the following plot in my initialize area

    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Trend"));

    and in "OnBarUpdate" I have

    Trend.Set(Trend_flo);


    which works fine


    If I add the following 2 lines to my initialize area and compile it is ok;

    Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "TStopL"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Short_TStop"));

    and then add the following line in my "OnBarUpdate"

    TStopL.Set(Trend_flo);

    I get the following compilation error - The name 'TStopL' does not exist in the current context

    It does! What am I doing wrong here?

    #2
    if comment out "TStopL.Set(Trend_flo);" it compiles!

    Comment


      #3
      But not with TStopL.Set(Trend_flo); i.e removing the comment

      Comment


        #4
        Did you add the new plot in your properties section? If you don't, the plot is just a placeholder and not usable by name. It would still be usable by calling it Values[1].

        ie Values[1].Set(Trend_flo[0])

        or add to Properties section:
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries TStopL
        {
        get { return Values[1]; }
        }

        Then assign it like this:

        TStopL.Set(Trend_flo[0])
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          tried that and it works! Thanks

          Comment


            #6
            Thanks for the contribution, eDanny!
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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