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 12-30-2009, 01:02 PM   #1
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default Adding additional Plots to my indicator

I already have the following plot in my initialize area

Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Trend"));

and in "OnBarUpdate" I have

Trend.Set(Trend_flo);


which works fine


If I add the following 2 lines to my initialize area and compile it is ok;

Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "TStopL"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Short_TStop"));

and then add the following line in my "OnBarUpdate"

TStopL.Set(Trend_flo);

I get the following compilation error - The name 'TStopL' does not exist in the current context

It does! What am I doing wrong here?
mefTrader is offline  
Reply With Quote
Old 12-30-2009, 01:13 PM   #2
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default

if comment out "TStopL.Set(Trend_flo);" it compiles!
mefTrader is offline  
Reply With Quote
Old 12-30-2009, 01:14 PM   #3
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default

But not with TStopL.Set(Trend_flo); i.e removing the comment
mefTrader is offline  
Reply With Quote
Old 12-30-2009, 01:39 PM   #4
eDanny
Senior Member
 
eDanny's Avatar
 
Join Date: Jul 2008
Location: East Rochester, NY
Posts: 899
Thanks: 0
Thanked 19 times in 17 posts
Default

Did you add the new plot in your properties section? If you don't, the plot is just a placeholder and not usable by name. It would still be usable by calling it Values[1].

ie Values[1].Set(Trend_flo[0])

or add to Properties section:
[Browsable(false)]
[XmlIgnore()]
public DataSeries TStopL
{
get { return Values[1]; }
}

Then assign it like this:

TStopL.Set(Trend_flo[0])
eDanny is offline  
Reply With Quote
Old 12-30-2009, 01:47 PM   #5
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default

tried that and it works! Thanks
mefTrader is offline  
Reply With Quote
Old 12-30-2009, 01:58 PM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Thanks for the contribution, eDanny!
NinjaTrader_RyanM 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
Adding plots to strategy in NT7 raz0rback Strategy Development 2 12-28-2009 09:54 AM
How to add additional/optional parameters to an indicator? isitpossible Indicator Development 2 08-11-2009 06:42 AM
Problem with adding plots Burga1 Indicator Development 14 04-24-2008 10:40 PM
Adding Plots to Strategy's... Sidhartha Strategy Development 2 04-14-2008 06:32 AM
Adding Plots rt-trader General Programming 5 02-09-2007 01:01 AM


All times are GMT -6. The time now is 07:54 PM.