View Full Version : newbie: Ninnja Trader Tutorial 2 problem
07-14-2010, 01:04 PM
NinjaScript Tutorial 2 in the help file says:
Plots.Add(new Plot(Color.OrangeRed, PlotStyle.Line, "Plot0"));
In compiling, I get the following error:
'System.Array' does not contain a definition for 'Add'
07-14-2010, 01:42 PM
Welcome to the NinjaTrader forums!
I'm looking for the snippet you posted but have been unable to locate. Do you have the link or can provide more information on where it can be found?
Add(new Plot(Color.OrangeRed, PlotStyle.Line, "Plot0"));
Above is a complete statement. It belongs in the Initialize() method and doesn't need the Plots. before it
If you have any variable declarations like Period = 10, these belong in the variables region.
07-14-2010, 02:19 PM
The problem code for me in the Ninja Trader tutorial is found at:
Help - NinjaScript - Tutorial: Indicator on Indicator (Level 2) - Setup
The first line in the area noted by number 2 produces the problem described in thread #1
07-14-2010, 02:45 PM
In entering the tutorial code, if it didn't work ... I started a new NinjaScript code file under a new name.
In the compiling phase, rather than reporting errors in the just the current code, the compiler reported errors in each of the non-working files. I missed that point.
After I deleted the non-working scripts, the tutorial compiled and ran as desired.
07-14-2010, 02:51 PM
Thanks for the update and glad to hear you have sorted it out. Looks like the screenshot has already been corrected in our version 7 documentation for this.