Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamically adding Plots/Values

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

  • NinjaTrader_BrandonH
    replied
    Hello bukowa,

    Thanks for your notes.

    Yes, NinjaTrader_Jim's advice is correct and still relevant for NinjaTrader 8.1.2.0.

    From the AddPlot() help guide: This method should ONLY be called within the OnStateChange() method during State.SetDefaults or State.Configure

    Note that some properties based on loaded data or user input may not be available in State.Configure (I.E. Bars, Instrument, User Defined Inputs) so that may be a road block for what you are trying to add dynamically.

    AddPlot(): https://ninjatrader.com/support/help...lot.htm​

    Leave a comment:


  • bukowa
    replied
    Originally posted by NinjaTrader_Jim View Post
    Hello NickyD,

    Thanks for your question.

    Plots can be added as late as State.Configure, so depending on what you are accessing, you could dynamically add plots there. We should note that some properties based on loaded data or user input may not be available in State.Configure (I.E. Bars, Instrument, User Defined Inputs) so that may be a road block for what you are trying to add dynamically.

    AddPlot() - https://ninjatrader.com/support/help...8/?addplot.htm

    If what you are doping requires User Defined Inputs and/or data loaded, State.DataLoaded would need to be used and you will need to use custom rendering to draw your plots. Plots can be drawn with Geometry. I have attached an example that can demonstrate. You should be familiar with SharpDX rendering, so I recommend following our SampleCustomRender example indicator that comes with NinjaTrader and the documentation below to get acquainted.

    https://ninjatrader.com/support/help..._rendering.htm

    We look forward to assisting.
    Hey your reply is 3 years old and in docs it states
    Configure User the presses the OK or Apply button.

    So can we rely on user input with AddPlot in current version 8.1.2.0 ?

    Leave a comment:


  • NickyD
    replied
    That code sample looks like I can adapt it for this purpose, thanks. I guess I will have dive into SharpDX finally, I've been avoiding it for a few years.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello NickyD,

    Thanks for your question.

    Plots can be added as late as State.Configure, so depending on what you are accessing, you could dynamically add plots there. We should note that some properties based on loaded data or user input may not be available in State.Configure (I.E. Bars, Instrument, User Defined Inputs) so that may be a road block for what you are trying to add dynamically.

    AddPlot() - https://ninjatrader.com/support/help...8/?addplot.htm

    If what you are doping requires User Defined Inputs and/or data loaded, State.DataLoaded would need to be used and you will need to use custom rendering to draw your plots. Plots can be drawn with Geometry. I have attached an example that can demonstrate. You should be familiar with SharpDX rendering, so I recommend following our SampleCustomRender example indicator that comes with NinjaTrader and the documentation below to get acquainted.



    We look forward to assisting.
    Attached Files

    Leave a comment:


  • NickyD
    started a topic Dynamically adding Plots/Values

    Dynamically adding Plots/Values

    I am fetching values from a URL to overlay on my chart. There will always be 2 but up to (N) number of values to display.

    In other words, I will be fetching a dictionary that has an unknown number of keys in it, I want to display all of them, but it might have 5 today and then 4 tomorrow when the new data is fetched. Is there a way I can dynamically add/remove Values/Plots? Any examples you can point me to?

    At the moment I think this is not possible and I'll have to draw my own custom lines... which I am not super familiar with. Any alternative approaches appreciated.

Latest Posts

Collapse

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