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

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 usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    23 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    22 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Working...
    X