Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Better Way to access Draw Objects?
Collapse
X
-
Better Way to access Draw Objects?
I have an indicator that is accessing drawing objects on the chart drawn manually or from other indicator. The issue is that if there are a lot of drawn objects on the chart it will take forever to load as I have it coded to currently cycle through each Object in DrawObjects. Is there a better way to access draw objects on a chart? Since I am getting objects from other sources I don't know the tags of the objects so I can't use the function that allows me to access the specific object.
Thanks!Tags: None
-
Hello Vikuno1,
The DrawObjects collection would be the only collection with these objects.
However, how is the script functioning?
Are you waiting for the last historical bar to loop through the collection, or are you looping through the collection on every historical bar?Chelsea B.NinjaTrader Customer Service
-
As of now I am looping through the objects every bar as I want a signal to show based on whether or not a certain bar has a certain condition true. But I guess I could loop once at the end of the historical state. I would just need to create some sort of dictionary to keep track of the objects on each bar and draw the signals historically however many bars away.Originally posted by NinjaTrader_ChelseaB View PostHello Vikuno1,
The DrawObjects collection would be the only collection with these objects.
However, how is the script functioning?
Are you waiting for the last historical bar to loop through the collection, or are you looping through the collection on every historical bar?
Thanks!
Comment
-
Hello Vikuno1,
In historical the DrawingObjects collection is not likely going to change with manually drawn objects. The signal would be the same every historical bar. In real-time the user might be adding or removing drawing objects.
Likely you could wait until the last bar, loop through the collection, and set flags on any historical bars you would like.
Or you could loop through the collection on the first bar, detect the object you are looking for, set a variable, and just reference that variable as each historical bar processes.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment