Floating-point invalid operation caused by rounding an environment function  [SOLVED]

Questions about MultiCharts and user contributed studies.
PD Quig
Posts: 186
Joined: 27 Apr 2010
Location: San Jose
Has thanked: 65 times
Been thanked: 10 times

Floating-point invalid operation caused by rounding an environment function  [SOLVED]

Postby PD Quig » 09 Nov 2018

I just isolated the line of code that caused an intermittent Floating-point invalid operation error to be this:

Text_Plot_Top = round(GetAppInfo(aiHighestDispValue), 1);

The error would stop the indicator but I'd be able to restart it and it would keep working. Couldn't replicate in playback, but got the error while importing and compiling indicators on my laptop after hours while the market was stopped. I removed the round() function and the problem was resolved.

Maybe everyone else knows not to round the return values of these functions, but I didn't and this problem has been a minor irritation for quite a while. Don't do what I did. :wink:

Return to “MultiCharts”