![]() |
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
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
|
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 |
|
|
|
|
|
#2 |
|
Senior Member
|
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? |
|
|
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
|
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 |
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#6 | |
|
Senior Member
|
Quote:
Seems I've had a mis-understanding with the Initialize() method... but I think I understand now... just don't use it ![]() Thanks Matt |
|
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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;
}
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
|
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? |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
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 |