The following CS0021 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 is a common error when calling indicators methods. It occurs when an indicator is called without its required parameter arguments before accessing an indexed value.
To fix this error you will need to first pass to the indicator method all the necessary parameter arguments. You can do this with '()' after the indicator name. Please note that you will still need to pass an empty parameter argument list even if your indicator requires no arguments.
Error Description #1
// Erroneous Sample Code - SMA is an indicator and requires parameter arguments
double value = SMA;
// Resolution Sample Code - SMA() properly called
double value = SMA(14);
// Erroneous Sample Code - EMA is an indicator and requires parameter arguments
double maDelta = EMA - EMA;
// Resolution Sample Code - SMA() properly called with an overload method (one of several variations)
double maDelta = EMA(High, 14) - EMA(High, 14);