NinjaTrader Support Forum  

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-15-2008, 01:46 PM   #1
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default Accessing the user defined plot color parameter from within an indicator.

I've modified the MASlopeBox indicator to support multiple instances, and now I'd like to be able to make it clearer which box is for which moving average.

Currently the box color is red or green depending on the slope and to help separate them, I'd like to make the rectangle color be the same as the Plot Color as defined by the user in the indicator dialog (i.e have the rectangle colors be green, blue, yellow, purple red).



This is the current code:

Quote:
graphics.DrawRectangle(new Pen(degreesColor), bounds.X + bounds.Width - 60, bounds.Y + bounds.Height - Boxnumber * 40, 46, 22);
I was hoping there was something like Plot0.Color, which could substitute for the degreesColor variable, but I'm stumped.

I realize this is likely beyond what the NT team provides support for, but if any of the other forum users could give me a hint, I would be very grateful.

Last edited by Elliott Wave; 04-15-2008 at 01:49 PM.
Elliott Wave is offline  
Reply With Quote
Old 04-15-2008, 11:29 PM   #2
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

I figured it out!

graphics.DrawRectangle(new Pen(Plots[0].Pen.Color), bounds.X + bounds.Width - 60, bounds.Y + bounds.Height - Boxnumber * 40, 46, 22);



Now to add TEMA, and I'm all set...
Last edited by Elliott Wave; 04-15-2008 at 11:36 PM.
Elliott Wave 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
user defined class? Folls Strategy Development 4 10-16-2007 06:33 PM
Indicator: Creating a user-defined parameter type (enum) NinjaTrader_Josh Reference Samples 0 09-24-2007 09:12 PM
Use Indicator plot color in DrawLine() MJT Indicator Development 1 06-01-2007 03:13 PM
Maximum number of user defined inputs Folls Indicator Development 1 05-03-2007 07:58 AM
Color Plot Problem on Modified CCI Indicator KBJ Indicator Development 5 04-18-2007 01:21 PM


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