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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            44 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            58 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            35 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            95 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            59 views
            0 likes
            Last Post PaulMohn  
            Working...
            X