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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment