Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamically adding Plots/Values

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

    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.


    #2
    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.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      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.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ashwagandhaplus, Today, 12:04 AM
      0 responses
      6 views
      0 likes
      Last Post ashwagandhaplus  
      Started by ashwagandhaplus, Today, 12:02 AM
      0 responses
      7 views
      0 likes
      Last Post ashwagandhaplus  
      Started by truvalastfrnce, Today, 12:01 AM
      0 responses
      4 views
      0 likes
      Last Post truvalastfrnce  
      Started by truvalastfrnce, Today, 12:00 AM
      0 responses
      4 views
      0 likes
      Last Post truvalastfrnce  
      Started by Ericawin, Yesterday, 11:57 PM
      0 responses
      7 views
      0 likes
      Last Post Ericawin  
      Working...
      X