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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      67 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X