Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 12-08-2011, 11:09 PM   #1

Join Date: Mar 2009
Posts: 33
Ignore this user

Thanks: 20
Thanked 1 Time in 1 Post

Floating Point Invalid Number in Calculation

Hello

Does anyone know why I am getting this error message " FPInvalidException: Floating point invalid numbers in calculation" when I put in a number that's greater than 10 yrs for the data range on the Format Symbol window? The strategy works fine for any range that is less than or equal to 10 yrs.

I know people usually get that error if their code has a divisor = 0, but my issue doesnt seem like it's caused by this.

Thanks
feng2088 is offline  
Reply With Quote
Old 12-09-2011, 02:15 AM   #2

Join Date: May 2010
Posts: 180
Ignore this user

Thanks: 0
Thanked 47 Times in 38 Posts

Re: Floating Point Invalid Number in Calculation

Within the range of data you're trying to plot, one of the calculations within your strategy is trying to return both an extremely small and extremely large value (if indeed you're certain you're not dividing by 0). If your code is well written, conscise, then experiment with replacing segments of complex calculations with whole numbers. For instance instead of value1=myLongFormula use value1=smallPortionOf_myL ongFormula, or if necessary take it all the way to value1=1; But that's the advanced debugging, before that you should try simply commenting out code until you find the likely target.

Last edited by onesmith; 12-09-2011 at 02:55 AM.
onesmith is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gold,Dollar and Euro Calculation mehtaka Beginners Forum 7 06-17-2010 09:08 AM
Floating Point Exception Error lonew0lf Coding Forum 3 04-01-2010 07:44 AM
Automatic Pivots Calculation - Help chloe31 Coding Forum 40 03-14-2010 03:13 PM
Tick Size Calculation PeterBrazel Coding Forum 1 08-17-2009 08:55 PM
Capital Progression Calculation in Perl Sparrow Coding Forum 4 03-07-2008 09:33 AM

All times are GMT -4. The time now is 11:10 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.