![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
if comment out "TStopL.Set(Trend_flo);" it compiles!
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
But not with TStopL.Set(Trend_flo); i.e removing the comment
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jul 2008
Location: East Rochester, NY
Posts: 899
Thanks: 0
Thanked 19 times in 17 posts
|
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]) |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
tried that and it works! Thanks
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Thanks for the contribution, eDanny!
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |