Does anyone know how to identify which drawing object is currently selected?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Identify User-Selected Drawing Object
Collapse
X
-
Originally posted by drmartell View Post(I realize this is likely going in to unsupported territory.)
Does anyone know how to identify which drawing object is currently selected?
If there is anything, it should be in the CO object
Hopefully, loop through all objects, and hopefully there is some sort of a 'selected' property to check.
Using the auto fill in when typing should list out what is available. (Sorry, I don't have NT up at the moment to check).
-
I'm not sure how far along you are in your research, I've started at the beginning.Originally posted by drmartell View PostSorry could you further explain what you mean by the CO object. I know there is no documented 'selected' property.
In the link to the other thread, there is a bunch of code that describes how to loop through ChartObjects that are in the chart.
Look at NT_RyanM sample indicator he wrote for a complete sample.
Code:List<ChartObject> ChartObjectArrayList = new List<ChartObject>(); foreach (ChartObject CO in this.ChartControl.ChartObjects) { if ( CO is NinjaTrader.Gui.Chart.ILine ) { ChartObjectArrayList.Add(CO); }
Comment
-
-
Originally posted by drmartell View PostHmmm, I can't find the code you referenced in the LineAlert indicator to which you linked. However the snippet you provided might get me somewhere. . .
This will probably only tell if the ChartObject is selectable.
A far cry from selected.
Comment
-
I could only find this:Originally posted by drmartell View PostHmmm, I can't find the code you referenced in the LineAlert indicator to which you linked. However the snippet you provided might get me somewhere. . .
if (this.ChartControl.ContainsFocus)
This works for the whole chart, but not objects.
I'm not sure it is possible.
Hopefully someone else might have an idea.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
157 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
91 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
143 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
131 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment