CS0201

View as Markdown

The following CS0201 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 make a statement solely from an indicator or variable call.

You will need to do something with the value you called for the statement to be complete.

Error Description #1

Only assignment, call, increment, decrement, await and new object expressions can be used as a statement

Erroneous Sample Code - Statement that does nothing

1// Erroneous Sample Code - Statement that does nothing
2SMA(5)[0];

Resolution Sample Code - ‘currentSMA’ takes on the current bar’s SMA(5) value

1double currentSMA = SMA(5)[0];