> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# 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.

## Error Code Explanation

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.

## Error Description #1

The best overloaded method match for '**NinjaTrader.NinjaScript.StrategyBase.SetStopLoss**(**CalculationMode**, **double**)' has some invalid arguments

```csharp
// 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]);
```

## Error Description #2

The best overloaded method match for '**NinjaTrader.Indicator.Indicator.SMA**(**NinjaTrader.NinjaScript.ISeries`\<double\>`**, **int**)' has some invalid arguments

```csharp
// 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];
```