CS1502
<< Click to Display Table of Contents >> CS1502 |
The following CS1502 error code information is provided within the context of NinjaScript. The examples provided are only a subset of potential problems that this error code may reflect. In any case, the examples below provide a reference of coding flaw possibilities.
This error can occur when you pass in incorrect parameter object types into a method such as an indicator.
Please check the overload methods for the proper parameter object types and pass in the proper object. You can check the overload methods with NinjaScript editor’s Intelliprompt when you call a method.
// Erroneous Sample Code - Close is a Series<double> object type and is not a valid value to the SetStopLoss() method
SetStopLoss(CalculationMode.Price, Close);
// Resolution Sample Code - The SetStopLoss() method takes a double value so pass in Close[0]
SetStopLoss(CalculationMode.Price, Close[0]);
// Erroneous Sample Code - Using an integer when the first parameter should be a Series<double>
double myValue = SMA(5, 5);
// Resolution Sample Code - 'myValue' will take the value of the current bar's SMA
double myValue = SMA(Close, 5)[0];