PDA

View Full Version : New and Fun error code


bobby1001
10-02-2007, 07:18 PM
// plot below by replacing 'Close[0]' with your own formula.
myDataSeries.Set(((High[0] - Low[0])/2) + Low[0]);
myDataSeries1.Set((High[0] - Low[0]) + High[0]);
myDataSeries2.Set(Low[0] - (High[0] - Low[0]));
Plot0.Set(SMA(myDataSeries[0], myInput0));
Plot1.Set(Close[0]);
Plot2.Set(Close[0]);

What is the problem with this? This is the error code I'm getting.
The best overloaded method match for 'NinjaTrader.Indicator.SMA(NinjaTrader.Data.IDataS eries, Int) has some invalid arguments, specifically Argument 1 cannot covert form Double to IDataseries. What is double? What does that mean? How is it used? The online manual is, at best, vague.

NinjaTrader_Josh
10-02-2007, 09:02 PM
Hi bobby1001,

This line Plot0.Set(SMA(myDataSeries[0], myInput0));should be Plot0.Set(SMA(myDataSeries, myInput0)[0]);A double is basically a number with decimal points. The first parameter when you call SMA() is suppose to be a DataSeries object not a double object. To get the DataSeries object you can remove the [0] indexing. In this case, you will also need to add an index reference at the end of SMA(). Make sure myInput0 is an int and it should compile after that.

bobby1001
10-02-2007, 10:55 PM
It worked fine. I think I understand why, but wanted to check to make sure. The [0] we added refers to the SMA for the plot, correct?

Thanks again.

NinjaTrader_Josh
10-02-2007, 11:35 PM
Correct. It refers the latest SMA() value to the plot.