Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to delete a GLOBAL drawingtool object via script?
Collapse
X
-
How to delete a GLOBAL drawingtool object via script?
Hi, how to delete a GLOBAL drawingtool object (e.g. HorizontalLine), by its tag and drawn by indicator, via script? RemoveDrawing() does not work if the drawingtool object is global. -
Hi Jesse, yes, you are right. The global drawingobject was expropriated by another method. I reassigned the owner correctly when needed, and it seems to work.
Code:DrawingTool.SetDrawingToolCommonValues(line, (lineas IDrawingTool).Tag, (lineas IDrawingTool).IsAutoScale, this, (lineas IDrawingTool).IsGlobalDrawingTool);
Comment
-
Hi,
Could you please explain a little, what this means:
The global drawingobject was expropriated by another method. I reassigned the owner correctly when needed, and it seems to work.
I've drawn some objects.
I can remove them, unless they are global drawn.
Whe removing them I use the "@" preceeding the tag name.
Thanks
Comment
-
Hi,
Could you help me?
How can I remove Global Objects inside my indicator?
The global objects are drawn inside this same indicator, and after some bars, I want to delete them, but it doesn't work.
I've trieb using the name with and without the "@".
Thanks,
Comment
-
Hello artson,
RemoveDrawObject can be used to remove a global drawing object. The script that originally draws the object also needs to be the script which removes it. If you are trying to remove an object that another script is drawing that won't work using RemoveDrawObject.
Here is a quick test you can use to see that it works, if you comment out the RemoveDrawObject line you will see that the object stays on the chart. If you have it uncommented you should see that it draws and then is removed so nothing appears on the chart.
Code:if (CurrentBar == Count - 5) { Draw.Ray(this, "RayTestGlobal", 50, Low[50], 2, Low[2], true,""); } if (CurrentBar == Count - 2) { RemoveDrawObject("RayTestGlobal"); }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
63 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
92 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
48 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
106 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
63 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment