Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line in StrategyPlot

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

    Line in StrategyPlot

    Hello!
    I want to add a line to my StrategyPlot that panits in the same panel. How can I do this? The first part of the code below works fine. But when I add the seccond part, an extra blank panel is displayed in the chart without any line or plot.

    Code:
      
                Add(StrategyPlot(0));
                StrategyPlot(0).Plots[0].Pen.Color = Color.Green;
                StrategyPlot(0).PanelUI = 5;
                
                Add(StrategyPlot(1));
                StrategyPlot(1).Lines[0].Value = maxATR;
                StrategyPlot(1).Lines[0].Pen.Color = Color.LightGray;
                StrategyPlot(1).PanelUI = 5;

    #2
    Hello poseidon_sthlm,

    Thank you for your post. Issue seems to be with the use of Lines versus Plots. Change your line below to:

    Code:
    [SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New]StrategyPlot([/FONT][/SIZE][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]).Plots[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]].Pen.Color = Color.LightGray;[/SIZE][/FONT]
    [/SIZE][/FONT]

    Then set your value in the OnBarUpdate() method.

    Code:
    StrategyPlot(1).Value.Set(maxATR);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks! Works perfectly.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      637 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X