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

How to detect when a chart has changed instruments

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

    How to detect when a chart has changed instruments

    Hi, I'm in the middle of developing an add-on that goes on a chart. Is there a way to detect when the chart switches instruments?
    Jeremytang
    NinjaTrader Ecosystem Vendor - Shark Indicators

    #2
    Hello Jeremytang,

    Thank you for the post.

    In this case, if the addon is specifically an addon and is not something you have added to the chart such as an Indicator you would very likely need to poll for this information. There is nothing specific that I could suggest to determine a chart data series has been updated from an external source. Objects applied to the chart will see this change as they are reloaded but an outside addon would not see this change.

    At this point have you been able to access the charts Instrument objects to tell what series are being used? If so, likely the easiest solution would be to utilize a timer to check that value and compare it to the last time you had checked the value to see if it changed.

    If your addon creates a window specifically and your chart uses the instrument link or interval link, you could also tap into those events but this requires an addon that has a window to be used, this otherwise cannot be used from NinjaScript in other areas without an addon window.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for your help Jesse, and the suggestions. I think the best approach for me will be to poll (was something that I was hoping to find a better alternative for).
      Jeremytang
      NinjaTrader Ecosystem Vendor - Shark Indicators

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,227 views
      0 likes
      Last Post xiinteractive  
      Started by andrewtrades, Today, 04:57 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      7 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      440 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      11 views
      0 likes
      Last Post FAQtrader  
      Working...
      X