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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 02-13-2008, 08:15 PM   #1
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default Reading background color?

Hi,

I'd like to know if it is possible to programaticly determine the "background" color of an indicator display (at the bottom of the screen under the price chart)? For example if something like this is possible:

if(Indicator.BackColor == Green){do something;}

Thanks in advance for any help.
Burga1 is offline  
Reply With Quote
Old 02-13-2008, 10:50 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

- an indicator has no "background" color
- you can access the color of a plot e.g. by "Plots[0].Pen.Color"
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-13-2008, 11:11 PM   #3
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

Hi Burga1,

You can paint the indicator panel a certain color though. Please take a look at these two links:
BackColor
BackColorAll
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-14-2008, 09:58 AM   #4
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi,

Thanks for the replies...yes that's what I mean--if an indicator has had the command for "backcolor" executed to change the color...can this be subsequently "read" as per my example in my first post? I simply want to be able to program a strategy to "read" what the indicator backcolor is...
Burga1 is offline  
Reply With Quote
Old 02-14-2008, 10:09 AM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Yes, it can be accessed as per Josh's post below
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-14-2008, 05:09 PM   #6
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you, so you're saying that this:

if(Indicator.BackColor == Green){do something;}

is acceptable code?
Burga1 is offline  
Reply With Quote
Old 02-14-2008, 10:20 PM   #7
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

No. Just do this:
Code:
if (BackColor == Color.Green)
     // Do something
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-14-2008, 10:52 PM   #8
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for the reply. If I'm writing a strategy to access the backcolor within a seperate indicator, is that not possible? Would I have to write the code that sets the backcolor within the strategy then?
Burga1 is offline  
Reply With Quote
Old 02-14-2008, 11:24 PM   #9
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

Not sure I follow, but maybe you could just expose a property from your indicator that contains values pertaining to the conditions you are searching for and then access those from the strategy.

Here is a reference sample for doing just that: http://www.ninjatrader-support.com/v...ead.php?t=4991
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-15-2008, 10:04 AM   #10
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you.
Burga1 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
DOM Background Color fredjone Suggestions And Feedback 3 02-26-2009 04:06 AM
Background Color BradB Indicator Development 26 11-18-2008 10:57 AM
Data Box background color zq655 Charting 1 01-28-2008 08:12 AM
Change background color trader2be Indicator Development 1 11-13-2007 09:13 PM
Chart Background Color NinjaTrader_Josh General Programming 1 07-15-2007 03:36 PM


All times are GMT -6. The time now is 07:51 AM.