CS0029
<< Click to Display Table of Contents >> CS0029 |
The following CS0029 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 try to convert from one 'type' to another 'type'.
To fix this error, ensure that you are assigning the correct value type.
// Erroneous Sample Code - 'CurrentBar' is an integer
if (CurrentBar)
// Resolution Sample Code - Compares an integer with another integer
if (CurrentBar < 1)
// Erroneous Sample Code – Close[0] returns a double value
if (Close[0])
// Resolution Sample Code – Compares a double with another double
if (Close[0] > Close[1])
// Erroneous Sample Code - Incorrect since assigning an indicator to a variable of double type
double myValue = SMA(20);
// Resolution Sample Code - Correct expression since we are accessing the current bar's value of the SMA indicator
double myValue = SMA(20)[0];