Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by FishTrade, 05-13-2024, 11:11 PM
      3 responses
      13 views
      0 likes
      Last Post FishTrade  
      Started by Graci117, Yesterday, 09:02 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ETFVoyageur, Yesterday, 07:55 PM
      0 responses
      9 views
      0 likes
      Last Post ETFVoyageur  
      Started by janio973, Yesterday, 07:24 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      252 views
      0 likes
      Last Post john_44573  
      Working...
      X