NinjaTrader Support Forum  

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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 06-21-2011, 11:17 AM   #1
MrOrange
Member
 
Join Date: Oct 2010
Posts: 32
Thanks: 6
Thanked 2 times in 2 posts
Default Simple one, how to get user input colors for DrawText?

Hi There,

I've got everything with my indi working nicely. Thanks to one of the nice users here they guided me on how to toggle between drawing objects on the price chart, and on the indicator chart. i've got a user-selectable font size for my drawtext, but i'd also like a user-selectable color for it, so that it will show up nicely on dark, or light colored backgrounds.

Here's my line of code, which works fine. It prints the price of the lowest low minus one tick, below the lowest low of the last x bars (since crossBelow0BarsAgo, something figured out elsewhere) on the price chart.

DrawText("ShortText",false,(Low[LowestBar(Low, crossBelow0BarsAgo)]-TickSize).ToString(), LowestBar(Low, crossBelow0BarsAgo), Low[LowestBar(Low, crossBelow0BarsAgo)]-3*TickSize,0, Color.Orange, new Font("Arial Bold", fontSize), StringAlignment.Center, Color.Transparent, Color.Transparent, 0 );

I'd just like to have the Color.Orange something that can be changed based on the inputs of the indicator, and i'm not too sure how to do that. I poked around the forum a bit, but couldn't find anything on it.

Hopefully it's an easy question, i'm still learning how to program.

Thanks so much!
Orange.1
MrOrange is offline  
Reply With Quote
Old 06-21-2011, 11:22 AM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Mr. Orange, please take a look at this reference sample that demonstrates how to program/create user definable color inputs.
NinjaTrader_Austin is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Austin for this post:
Old 06-21-2011, 11:52 AM   #3
MrOrange
Member
 
Join Date: Oct 2010
Posts: 32
Thanks: 6
Thanked 2 times in 2 posts
Default

Thanks Austin, that worked like a charm.
MrOrange 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
no user input recognition sosMsos Automated Trading 1 04-26-2011 08:43 AM
User input box UManiac Indicator Development 2 09-21-2010 02:28 PM
Plot Colors Not Changing From Input Params tazatek Version 7 Beta General Questions & Bug Reports 8 03-29-2010 03:31 PM
User Input exception symphys General Programming 1 02-25-2010 07:03 AM
DataSeries as User Input SystemTrading Strategy Development 3 02-03-2009 10:39 AM


All times are GMT -6. The time now is 09:52 PM.