• 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

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 priceisking, Today, 01:15 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by 2sureshk, Today, 07:29 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by frayrengytrader, Today, 10:58 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_SergeyS  
      Started by levikNT, Today, 11:28 AM
      3 responses
      27 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by ballboy11, Today, 09:35 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X