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 > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 03-26-2010, 07:26 PM   #1
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default Plot Colors Not Changing From Input Params

I know it's late, but I can't seem to change colors from an input parameter...

I've attached a simple test case that I think outlines the problem

Once the indicator is added to a chart, go to the parameters and change the color. The indicator color doesn't update.


Thoughts?

Matt
Attached Files
File Type: zip TestColorInputParams.zip (1.9 KB, 4 views)
tazatek is offline  
Old 03-27-2010, 08:08 AM   #2
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default

After some testing, I realize that this is more with my code and not NT 7.

I found this thread on Serializing colors:
http://www.ninjatrader-support2.com/...ead.php?t=4977

But what I'm missing is, can this be applied to plots?

ie, Create a custom input color that can be applied to plots?

why? I have several different plot types (sub-indicators) that can be plotted (only one at a time, and selected at runtime ), and requires their own input values.

Possible? Thoughts?
tazatek is offline  
Old 03-27-2010, 03:56 PM   #3
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

tazatek, I'm not sure if it is possible. I will have someone respond to you on Monday regarding this issue.

As a side note, you may want to search the forums for "serialize plot color" to see if it has been done already.
NinjaTrader_Austin is offline  
Old 03-27-2010, 04:05 PM   #4
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default

After searching through hundreds of indicators, I think you're right, that this isn't possible.

I configured my code to do what others had done, and it will work fine. I just thought I'd seen it used in a different manner.

I found the serialization examples, and it seems to work for everything except plot()

Thanks

Matt
tazatek is offline  
Old 03-29-2010, 08:09 AM   #5
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

Matt,

You could just set a dummy color in the Initialize() method for the plot, but in OnBarUpdate() you set it to the color you selected via the color inputs.
NinjaTrader_Josh is offline  
Old 03-29-2010, 08:27 AM   #6
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Matt,

You could just set a dummy color in the Initialize() method for the plot, but in OnBarUpdate() you set it to the color you selected via the color inputs.
Ahh Yes... that'll work.

Seems I've had a mis-understanding with the Initialize() method... but I think I understand now... just don't use it

Thanks

Matt
tazatek is offline  
Old 03-29-2010, 02:21 PM   #7
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

Matt,

Actually you could do it in the OnStartUp() method which may be a better spot for this.

Code:
protected override void OnStartUp()
{
     Plots[0].Pen.Color = SomeColorVariable;
}
NinjaTrader_Josh is offline  
Old 03-29-2010, 03:07 PM   #8
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default

onStartUp()

That's a good one to know. That's what I was thinking that Initialize() was doing.

So I'm guessing that onStartUp () is guaranteed to only be called once? Until I remove an indicator and add it back?

I'm not seeing this in the NT6.5 docs... is it new to NT7 and is it officially supported?
tazatek is offline  
Old 03-29-2010, 03:31 PM   #9
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

Yes, it runs once and only once on indicator/strategy start. Starting a second time will call it a second time.

It is a new method and is officially supported for NT7.
NinjaTrader_Josh is offline  
 

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
Changing Colors tquinn Indicator Development 5 03-01-2010 06:20 AM
Changing colors of a plot BobTN Indicator Development 3 02-24-2010 01:03 PM
Changing colors of plots added to strategy kegrande Strategy Development 3 05-30-2008 02:27 AM
Changing plot colors inside of a strategy or indicator NinjaTrader_Ray General Programming 5 06-23-2007 11:30 AM
Custom Plot colors & Thresholds & Price marker colors higler General Programming 5 06-22-2007 07:47 AM


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