Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Plots

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

    Custom Plots

    Hello,

    I know how do make custom plots within an indicator but the same code does not seem to work within a strategy. So, can someone point me to a help section/thread that explains customs plots inside a strategy? I am trying to avoid running an indicator and a strategy and put all my plots and such within the strategy.

    The first plot I am trying to achieve is simple...take the closing price, add 10 ticks, and draw a line on the chart. Something like:

    CustomPlotName.Plots[0].Pen.Color = Color Green;
    Add (CustomPlotName(Close[0] + TickSize*10));

    Would I need to declare some sort of variable to do this?

    And, I need to know if I can turn off the plot with a simple if statement since the plots are both defined and added under the Initialize section? As you may know, with an indicator, a plot can be defined under Initialize and added under OnBarUpdate, which gives more control when it is shown on the chart. I am not finding that flexibility with a strategy.

    Thanks Much

    #2
    Yes, sure!



    sorry

    Originally posted by sarasotavince View Post
    Hello,

    I know how do make custom plots within an indicator but the same code does not seem to work within a strategy. So, can someone point me to a help section/thread that explains customs plots inside a strategy? I am trying to avoid running an indicator and a strategy and put all my plots and such within the strategy.

    The first plot I am trying to achieve is simple...take the closing price, add 10 ticks, and draw a line on the chart. Something like:

    CustomPlotName.Plots[0].Pen.Color = Color Green;
    Add (CustomPlotName(Close[0] + TickSize*10));

    Would I need to declare some sort of variable to do this?

    And, I need to know if I can turn off the plot with a simple if statement since the plots are both defined and added under the Initialize section? As you may know, with an indicator, a plot can be defined under Initialize and added under OnBarUpdate, which gives more control when it is shown on the chart. I am not finding that flexibility with a strategy.

    Thanks Much

    Comment


      #3
      sarasotavince, the strategy could not directly plot, but could add indicators for display in and customize their plots. That was the topic of the link that sledge kindly referred you to.

      Another technique using placeholder indicators providing the plots is shown in our reference samples and would be useful for realtime charting - http://www.ninjatrader.com/support/f...ead.php?t=6651

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      591 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      553 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X