Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

cant Add a Plot to my strategy

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

    cant Add a Plot to my strategy

    hi,
    im trying to add a Plot to my strategy which will draw a new indicator (when running the strategy).

    I added a line to initialize():
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line,"MyPlot"));

    and later on in OnBarUpdate() I would like to set my required values (e.g. from an array the I have):
    MyPlot.Set(myArray[i]);

    when im trying to compile im getting this error (related to the Add func):

    The best overloaded method match for The best overloaded method match for 'NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader .Indicator.IndicatorBase)' has some invalid arguments

    Argument '1': cannot convert from 'NinjaTrader.Gui.Chart.Plot' to 'NinjaTrader.Indicator.IndicatorBase'

    would highly appreciate your help.
    BTW - I don't want to create a different 'indicator' for that. i'd like it to be coded within my current strategy

    #2
    Hello Yonimoti,

    Thank you for your post.

    Add(Plot()) is only for Indicators. If you want to have a plot based off of strategy logic then you would need to review the reference sample on plotting from within a strategy -
    http://www.ninjatrader.com/support/f...ead.php?t=6651

    Essentially, you will be adding an indicator to the strategy and have exposed series that you can then assign values to from the strategy to the indicator to plot them.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X