NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-21-2009, 06:17 AM   #1
velocity
Senior Member
 
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
Default Removing Text

I have an indicator that places text below the bar. I have a condition statement that if true it places the word "buy" below the bar. However later in the code if a different condition is true, I want to ERASE the word "buy" and print "major buy" instead. (this indicator is a CalculateOnBarClose false)

Problem: How do I erase the word "buy". Here is my code for the "buy":

DrawText(
"Text11"+ CurrentBar, "buy", 0, Low[0] - 4 * TickSize, Color.Black);

Here is how I am trying to remove it:

RemoveDrawObject(
"Text11");

Is the text an actual DrawObject?

Thanks



Last edited by velocity; 12-21-2009 at 06:46 AM.
velocity is offline  
Reply With Quote
Old 12-21-2009, 06:38 AM   #2
tamas
Senior Member
 
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by velocity View Post
DrawText("Text11"+ CurrentBar, "buy", 0, Low[0] - 4 * TickSize, Color.Black);
Try it:
DrawText ("Text11", "buy", 0, Low [0] - 4 * TickSize, Color.Black);
tamas is offline  
Reply With Quote
Old 12-21-2009, 06:45 AM   #3
velocity
Senior Member
 
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for the suggestion, but that did not do it.

Support, Any other Ideas?

thanks
velocity is offline  
Reply With Quote
Old 12-21-2009, 07:01 AM   #4
tamas
Senior Member
 
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by velocity View Post
Thanks for the suggestion, but that did not do it.
Velocity,

I think that you are using the (example) "Text11288" object, but the "Text11" object you want to remove.

Check:

Print ( "Text11" + CurrentBar);
Last edited by tamas; 12-21-2009 at 07:06 AM.
tamas is offline  
Reply With Quote
Old 12-21-2009, 07:29 AM   #5
velocity
Senior Member
 
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
Default

I don't think that's the problem.
velocity is offline  
Reply With Quote
Old 12-21-2009, 07:38 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

velocity,

That is the problem. Your objects are uniquely named, just use a static name and instead of drawing new objects all the time, it will just modify the preexisting object. Remove the + CurrentBar from your tag name.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not see text in text properties tool - still aslane Version 7 Beta General Questions & Bug Reports 5 12-01-2009 01:52 PM
removing text from screen always4nu Charting 5 10-01-2009 08:20 AM
Can not see text in text properties tool aslane Charting 4 04-02-2009 12:48 PM
Removing Label dwalls Charting 4 05-10-2008 02:03 PM
Removing Fibs JohnG Suggestions And Feedback 4 08-03-2007 08:17 AM


All times are GMT -6. The time now is 12:50 AM.