Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Name Plot Appearance

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

    Name Plot Appearance

    I am modifying an indicator and would like to modify the AddPlot line of code to include a different Name for the Plot as it appears in the parameters when you apply the indicator to a change

    Example: AddPlot(new Stroke(Brushes.Goldenrod, DashStyleHelper.Dash, 2), PlotStyle.Square, NinjaTrader.Custom.Resource.CurrentDayOHLOpen);

    if where would I input code to change the name as it appears, right now this appears a "Current Open"

    #2
    Hello DTSSTS,
    You can use as below:-
    Code:
    AddPlot(new Stroke(Brushes.Goldenrod, DashStyleHelper.Dash, 2), PlotStyle.Square, "New Name");
    Hope it helps!

    Comment


      #3
      Hello DTSSTS,

      Thank you for the post.

      With that syntax you would replace the resource at the end with a string:

      Code:
      AddPlot(new Stroke(Brushes.Goldenrod, DashStyleHelper.Dash, 2), PlotStyle.Square, "MyPlot");
      Your script may also have a public property for the plot near the bottom of the file. If so you can change that if you also wanted the plot name changed for when you are accessing the indicator from other indicators or strategies.

      Please let me know if I may be of additional assistance.

      Comment


        #4
        I am actually modifying the BOP so I do not see any Public property at the bottom that was my first place to look. But I do not understand if I add the "MyPlot" at the end we have removed the formula par i.e. NinjaTrader.Custom.Resource.CurrentDayOHLOpen so how does the indicator know we are plotting the Current Open

        the actual original line of code for the AddPlot on the BOP is as below: I had already tried to place "MyPlot" just after the PlotStyle and at the end without success

        AddPlot(new Stroke(Brushes.DodgerBlue, 2), PlotStyle.Bar, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meBOP);

        thanks again



        Comment


          #5
          Hello DTSSTS,
          If there is no public double series defined in properties at bottom, compiler will take plot with Values[0][0] assigned in onbarupdate. Refer Post # 2 & 3 for correct way to use plot names. Hope it helps!

          Comment


            #6
            Hello DTSSTS,

            The NinjaTrader.Custom.Resource.in the code you provided is just used by NinjaTrader for regionalization, its just a name string but does not define what the plot does.

            how does the indicator know we are plotting the Current Open
            The code which sets the plot determines what the plots value is, the name of the plot is irrelevant and is just something for the user interface so it can be tracked.

            As s.kinra mentioned if there is not any public property that is fine, the Value[0] or Values[0][0] will be used in the code instead to set the plot.



            Please let me know if I may be of additional assistance.

            Comment

            Latest Posts

            Collapse

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