Code not working since update : "!= double.NaN"

Created at 29 Jul 2022, 12:33
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
K1

K100

Joined 04.11.2018

Code not working since update : "!= double.NaN"
29 Jul 2022, 12:33


Hi,

Since updating since yesterday. Code that was working fine is no longer, and i'm not sure why. Its so basic.

If i remove this snippet , indicator works. Any ideas ?


if (AUD[index] == double.NaN)
{
    AUD[index] = 0;
    IndicatorArea.DrawText("Text1", "AUD: " + index, index , 0, audColor);
}
else if (AUD[index] != double.NaN)
{
  IndicatorArea.DrawText("Text1", "AUD: " + index, index , AUD[index], audColor);
}
 

Keep getting the following error.

"Crashed in Calculate with ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: y. Actual value was: NaN."

 

Thanks in advance


@K100
Replies

K100
29 Jul 2022, 13:27

RE:

Nevermind. Found an alternate solution

 

K100 said:

Hi,

Since updating since yesterday. Code that was working fine is no longer, and i'm not sure why. Its so basic.

If i remove this snippet , indicator works. Any ideas ?


if (AUD[index] == double.NaN)
{
    AUD[index] = 0;
    IndicatorArea.DrawText("Text1", "AUD: " + index, index , 0, audColor);
}
else if (AUD[index] != double.NaN)
{
  IndicatorArea.DrawText("Text1", "AUD: " + index, index , AUD[index], audColor);
}
 

Keep getting the following error.

"Crashed in Calculate with ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: y. Actual value was: NaN."

 

Thanks in advance

 


@K100

userUser
02 Aug 2022, 18:00

RE:

K100 said:

Hi,

Since updating since yesterday. Code that was working fine is no longer, and i'm not sure why. Its so basic.

If i remove this snippet , indicator works. Any ideas ?


if (AUD[index] == double.NaN)
{
    AUD[index] = 0;
    IndicatorArea.DrawText("Text1", "AUD: " + index, index , 0, audColor);
}
else if (AUD[index] != double.NaN)
{
  IndicatorArea.DrawText("Text1", "AUD: " + index, index , AUD[index], audColor);
}
 

Keep getting the following error.

"Crashed in Calculate with ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: y. Actual value was: NaN."

 

Thanks in advance

 

Try double.IsNaN(AUD[index]) == true or false


@userUser