NinjaScript > Editor > Compile Error Codes > NT0019 |
|
The following NT0019 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 happen when a DataSeries is compared to another object via the use of relational operators. Relational operators (==, <, >, <=, >=) can be used to compare the values of the DataSeries but not the DataSeries object itself.
To fix this error ensure that you are actually comparing the values of the DataSeries to another object. You can do this by adding the index value to the DataSeries call. The index value is on a zero-based referencing system. [0] references the latest bar while [1] references one bar ago and [2] references two bars ago.
Error Description #1
// Erroneous Sample Code - DataSeries objects cannot be compared with integers
// Resolution Sample Code - Checks to see if the current close is equal to 5
Error Description #2
// Erroneous Sample Code - DataSeries objects cannot be compared with each other
// Resolution Sample Code - Checks to see if the current bar’s close is greater than the current bar’s open
Error Description #3
// Erroneous Sample Code - DataSeries objects cannot be compared with doubles while (Low < Close[1])
// Resolution Sample Code - While the current low is less than the previous close continue with this code segment while (Low[0] < Close[1]) |