[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Amibroker calculation error



PureBytes Links

Trading Reference Links

You are exceeding the digit limit for AmiBroker. Do a search for "precision", its been discussed many times but I have forgotten the details.. 7 digits is the limit I seem to recall.


AmiBroker doesn't have an overflow error msg.


herman


Monday, May 14, 2007, 11:06:47 AM, you wrote:


>

Herman:

 

My concern is not getting the date format right. There are many ways to do that.

I just need to understand why this simple calculation (add) can have error.

 

1070511 + 19000000 = 20070512 instead of 20070511.

 

My hope is that somebody (maybe TJ) can explain it to me.

This is something serious, because it affects my confidence level toward Amibroker as a whole.

 

Thanks,

 

- Mark

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Herman

Sent: Sunday, May 13, 2007 10:41 PM

To: Mark H

Subject: Re: [amibroker] Amibroker calculation error

 

Why not use this:

 

Filter = 1;

SetOption("NoDefaultcolumns",False);

DateNumber = ParamDate("Date",Now(1)); // To provice test DateNum

DateString = NumToStr(DateTimeConvert( 2, DateNumber),formatDateTime);

AddTextColumn(DateString, "DateNum");

Buy = 1;

 

herman

 

Monday, May 14, 2007, 10:23:37 AM, you wrote:

 

I am trying to convert a date number to a year+month+day number for better display.

It worked before, but for May 11, I got this error:

1070511 + 19000000 = 20070512 instead of 20070511.

Here is a piece of code to demonstrate this calculation error:

 

---------------------------------------------------------

filter = 1;

daten = StrFormat("%f", 1070511 + 19000000);

AddTextColumn(daten, "DateNum");

buy = 1;

---------------------------------------------------------

The column will display 20070512.00000, not 20070511 as you would expect.

I understand that in AFL, all numbers are in double type and integer is converted when used. However, this doesn’t seem to be a rounding error since the result is exactly 20070512.00000, not something like 20070511.71332.

 

I am using 4.90.5. 

Have anyone seen this before?

 

Thanks,

 

- Mark

 

 

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___