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!
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
NinjaTrader
How to detect when a chart has changed instruments
Collapse
X
-
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?Tags: None
-
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
-
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).
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
3 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
Comment