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 CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
26 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
182 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
335 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
260 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment