DrawTextFixed("Target", "", TextPosition.Center, Color.Green, new Font("Arial",16), Color.Transparent, Color.Transparent, 5);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Clear DrawTextFixed
Collapse
X
-
Clear DrawTextFixed
I've been using the following to clear what I previously wrote with DrawTextFixed:
but then as the chart updates, bars that get drawn in the top left, are sort of washed out - I don't think I'm using DrawTextFixed correctly to clear the text that was there. How should it be done?Code:Tags: None
-
Change the areaOpacity to 0?Originally posted by reynoldsn View PostI've been using the following to clear what I previously wrote with DrawTextFixed:
but then as the chart updates, bars that get drawn in the top left, are sort of washed out - I don't think I'm using DrawTextFixed correctly to clear the text that was there. How should it be done?Code:DrawTextFixed("Target", "", TextPosition.Center, Color.Green, new Font("Arial",16), Color.Transparent, Color.Transparent, 5);
-
Assign it to an IText object and you can delete the IText object when you do not need it any more.Originally posted by reynoldsn View PostI've been using the following to clear what I previously wrote with DrawTextFixed:
but then as the chart updates, bars that get drawn in the top left, are sort of washed out - I don't think I'm using DrawTextFixed correctly to clear the text that was there. How should it be done?Code:DrawTextFixed("Target", "", TextPosition.Center, Color.Green, new Font("Arial",16), Color.Transparent, Color.Transparent, 5);
Comment
-
Hello reynoldsn,
Thank you for your post.
You can remove the object when needed using RemoveDrawObject() and call the tag. For information on RemoveDrawObject() please visit the following link: http://ninjatrader.com/support/helpG...drawobject.htm
Please let me know if you have any questions.
Comment
-
OK, good to know about RemoveDrawObject, however, there is still something wrong. Despite calling RemoveDrawObject right before DrawText, I can still see the old text underneath the new label. It appears that RemoveDrawObject isn't always removing the old label.
Comment
-
Hello reynoldsn,
Thanks for your post.
If you use any draw method and use the same object tag name, the first object is automatically removed and then the new applied object is drawn. Repeated calls continue the pattern and at any moment one and only object with the tag name will be on the chart.
If you wanted to keep objects on the chart then you would create a unique tag name for each instance. This can be done by using something line "Tag name" + CurrentBar creating a unique tag as each bar completes.
RemoveDrawObject("tag name") will remove the specified "tag name" object.
RemoveDrawObjects() will remove all draw objects.
Comment
-
I reproduced the problem. Please see image. You can see that despite I'm using only one range name, "Range", there is another label drawn behind. Why is it doing this? And here is the code:
Code:RemoveDrawObject("Range"); DrawTextFixed("Range", string.Format("Strategy range: {0}", Math.Round(hi - lo,2)), TextPosition.BottomLeft, Color.Green, new Font("Arial",16), Color.Blue, Color.DarkGray, 10);
Comment
-
Hello reynoldsn,
Thanks for your post.
I have been unable to replicate the issue you are showing.
As mentioned previously, if you use the same tag name you shouldn't need to remove the prior object using the RemovedDrawObject() method.
So that I can further assist, please share your complete code here or feel free to send in to PlatforSupport[at]Ninjatrader[dot]Com with Atten Paul and this link:http://ninjatrader.com/support/forum...ad.php?t=75542
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
627 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment