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 cmoran13, 04-16-2026, 01:02 PM
            0 responses
            43 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            163 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            158 views
            2 likes
            Last Post CaptainJack  
            Working...
            X