Empty index locations not comparing to double.NaN correctly

Created at 30 Sep 2014, 08:38
WhiteSage's avatar

WhiteSage

Joined 02.02.2014

Empty index locations not comparing to double.NaN correctly
30 Sep 2014, 08:38


When checking for an empty value on an alternate symbol series, indicator or indicatordataseries.

The comparison:

if (the_series[index] == double.NaN)

Always returns FLASE. Even where printing the same result to the log shows "NaN".

How do I correctly calculate the start index of a given series on the time series I am displaying? (particularly with indicators only function being .Result)


@WhiteSage
Replies

Spotware
30 Sep 2014, 09:23

You can check value for NaN using the following code snippet:

if (double.IsNaN(the_series[index]))
...

 


@Spotware

WhiteSage
30 Sep 2014, 09:52

Ah wonderful. Thank you!


@WhiteSage