NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-01-2009, 09:31 AM   #1
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default DrawText with Text Option in Indicator Window

I'm trying to include a Parameter in the Indicator Window that I can type Text into that will show up on Price Panel.

Code:
DrawText("tag1", "This text was written from Indicator Window", 10, 1000, Color.Black);
duck_CA is offline  
Reply With Quote
Old 04-01-2009, 09:36 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Not sure I follow. What indicator window are you talking about? If you mean where you set indicator parameters, just create yourself a string input and then tell it to DrawText on that string variable.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-01-2009, 10:04 AM   #3
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Draw Text String Variable

Yes. I was refering to Indicator Window via the Chart...

I would assume that some code is needed in the Properties region.

Kinda struggling with it right now...Maybe if I can post some code we can go from there

Thank You Josh
duck_CA is offline  
Reply With Quote
Old 04-01-2009, 10:07 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

duck_CA,

I recommend you just use the Indicator Wizard to see what kind of code it will generate. That is the code you will need in the Properties region.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-01-2009, 10:10 AM   #5
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Sounds Good...Thanks

I will ask the "wizard" or is that you ? lol
duck_CA is offline  
Reply With Quote
Old 04-01-2009, 10:12 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Haha. Tools->New NinjaScript->Indicator.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-01-2009, 11:00 AM   #7
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Draw Text in Indicator Window

I'm trying to be able and use the new "Text" Parameter so that anything that is typed will show up on the chart...

I'm I getting warmer?


Code:
#region Variables
// Wizard generated variables
privatestring text = @"draw text here"; // Default setting for Text
// User defined variables (add any user defined variables below)
#endregion
Code:
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (Low[0] < High[0])
{
DrawText("My text" + CurrentBar, "draw me some text", 0, 0, Color.Red);
}
}
Code:
#region Properties
[Description("this should draw text in indicator window")]
[Category("Parameters")]
publicstring Text
{
get { return text; }
set { text = value; }
}
duck_CA is offline  
Reply With Quote
Old 04-01-2009, 11:04 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

DrawText("My text" + CurrentBar, Text, 0, 0, Color.Red);
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-01-2009, 11:07 AM   #9
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Dang it !!! I knew I was close :)

On to the next item... Thanks Josh !
duck_CA 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
Colored text in output window? heech Strategy Development 1 03-03-2009 10:02 AM
connections option window accudoc Connecting 1 12-24-2008 03:59 AM
Output window text kenzo Strategy Analyzer 3 12-12-2008 10:30 AM
Positioning text using DrawText() higler General Programming 7 07-15-2008 01:36 AM
Drawing Text at the right/left of the chart window? pbastowski Indicator Development 7 06-07-2007 09:47 PM


All times are GMT -6. The time now is 09:23 AM.