• 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 bboyle1234, Today, 01:06 AM
      0 responses
      3 views
      0 likes
      Last Post bboyle1234  
      Started by Sulfred, Today, 12:34 AM
      0 responses
      3 views
      0 likes
      Last Post Sulfred
      by Sulfred
       
      Started by U0000999, Today, 12:27 AM
      0 responses
      3 views
      0 likes
      Last Post U0000999  
      Started by radist, Today, 12:13 AM
      0 responses
      2 views
      0 likes
      Last Post radist
      by radist
       
      Started by mntemel, Yesterday, 10:25 PM
      0 responses
      2 views
      0 likes
      Last Post mntemel
      by mntemel
       
      Working...
      X