Financial formulae

Mike Bonner bonnmike at gmail.com
Fri Nov 9 08:27:23 EST 2012


found my other stack, heres the script from it. (got the script from
somewhere else and adjusted for lc)

*/

*
//----------------------------------------------------------------------------------------------
*

*// COMPOUND INTEREST*

*// present value, future value, imputed compound interest rate per period.*

*// NumPeriods and InterestPerPeriod are relative to each other, regardless
of the units used for either.*

*
//----------------------------------------------------------------------------------------------
*

*function* PresentValue NumPeriods, InterestPerPeriod, FutureValue

   *return* FutureValue / (1 + InterestPerPeriod) ^ NumPeriods

*end* presentvalue


*function* FutureValue NumPeriods, InterestPerPeriod, PresentValue

   *return* PresentValue * (1 + InterestPerPeriod) ^ NumPeriods

*end* futurevalue


*function* ImputedInterest PresentValue, FutureValue, NumPeriods

   *return* (FutureValue / PresentValue) ^ ((1 / NumPeriods) - 1)

*end* imputedInterest


*function* NumPeriods PresentValue, FutureValue, InterestPerPeriod

   *return* (log10(FutureValue) - log10(PresentValue)) / log10(1 +
InterestPerPeriod)

*end* numPeriods



*
//----------------------------------------------------------------------------------------------
*

*// PERIODIC INTEREST RATES*

*// Given an annual rate, returns an array containing the rates for shorter
periods. *

*// The elements can be accessed as, for example, Rates["Daily"] or
Rates.Daily.*

*function* GetPeriodicInterestRates AnnualRate

   *put* AnnualRate into Rates["Annually"]

   *put* AnnualRate /2 into Rates["Semiannually"]

   *put* AnnualRate /4 into Rates["Quarterly"]

   *put* AnnualRate /12 into Rates["Monthly"]

   *put* AnnualRate /52 into Rates["Weekly"]

   *put* AnnualRate /365 into Rates["Daily"]

   *return* Rates

*end* getPeriodicInterestRates


On Thu, Nov 8, 2012 at 9:53 PM, Peter M. Brigham <pmbrig at gmail.com> wrote:

> On Nov 5, 2012, at 3:02 AM, Graham Samuel wrote:
>
> > You know I did search the dictionary, but never thought of something so
> obvious as 'annuity' or 'compound'. Well, you learn something new every day
> (at least I do).
>
> I have been known to browse through the dictionary from time to time. That
> must make me some kind of geek, but I have discovered a few things doing
> this that I didn't know.
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list