CS0200

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Editor > Compile Error Codes >

CS0200

Previous page Return to chapter overview Next page

The following CS0200 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 is most common when you try to assign values to a particular Series<T> index that is read-only. Instead try making your own Series<T> and assign the value there.

 

Error Description
Property or indexer 'NinjaTrader.NinjaScript.ISeries<double>.this[int]' cannot be assigned to -- it is read only

 

Example #1

// Erroneous Sample Code - Cannot assign values to something that is read-only

Close[0] = 25;

 

// Resolution Sample Code - Assigns value to a custom Series<double>

myCustomClose[0] = 25;

 

Example #2

// Erroneous Sample Code - Cannot reassign values to Series<double> indexed value and cannot have an if statement based // on an assignment operator

if (Close[0] = Open[0])

 

// Resolution Sample Code - Properly compares two Series<double> values

if (Close[0] == Open[0])