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 SnailHorn, 03-27-2024, 09:54 AM
|
4 responses
16 views
0 likes
|
Last Post
by SnailHorn
Today, 09:19 AM
|
||
Started by ninza33, Today, 07:16 AM
|
3 responses
18 views
0 likes
|
Last Post
by ninza33
Today, 09:01 AM
|
||
Started by foxtrott21, Today, 08:27 AM
|
0 responses
4 views
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
3 views
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
26 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
Comment