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

[amibroker] Re: compound interest



PureBytes Links

Trading Reference Links

Frankly I don't care what you use, but I thought compound interest 
was calculated on CALENDAR days not on MARKET days.

--- In amibroker@xxxxxxxxxxxxxxx, Sidney Kaiser <s9kaiser@xxxx> wrote:
> As a non programmer it is amazing how much trouble I can get into.  
The 
> calculation result was changing depending on the number of bars 
displayed 
> on the screen.
> 
> I thought BarCount was a fixed number (the # of bars loaded) and 
the 
> calculation did not care how many bars were displayed....wrong.....
> 
> Apparently there are some formulas that may interact with the fast 
> calculation capability and require me to tell AFL manually how many 
bars 
> are required by using the SetBarsRequired statement.  I also 
changed the 
> bars / year to 252 to keep Fred happy.  :-)
> 
> Final Result, I hope
> Sid
> 
> // Compound Interest
> 
> SetBarsRequired( 100000, 100000 );
> 
> interest_rate = 5;  // percent
> r = interest_rate/100;
> 
> A[0] = 1;
> for(i = 1; i < BarCount; i++)
> {
>     A[i] = exp(r*(i/252));
> }
> 
> Plot(A, "Compound Interest", colorBlack, styleLine);  
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.545 / Virus Database: 339 - Release Date: 11/27/2003


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/