• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 webus, Today, 02:03 AM
      0 responses
      7 views
      0 likes
      Last Post webus
      by webus
       
      Started by momchi, Yesterday, 07:12 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by DieSlower, Yesterday, 11:02 PM
      0 responses
      5 views
      0 likes
      Last Post DieSlower  
      Started by gujungg, Yesterday, 10:59 PM
      0 responses
      13 views
      0 likes
      Last Post gujungg
      by gujungg
       
      Started by DieSlower, Yesterday, 09:46 PM
      0 responses
      13 views
      0 likes
      Last Post DieSlower  
      Working...
      X