• Resolved leontancredimedia

    (@leontancredimedia)


    Hi I’m trying to implement a compound interest with monthly contributions formula.

    However the result of the formula keeps showing a wrong result while when I’m doing in my excel everything is working fine.

    Below the formula used:
    P=Initial Investment; PMT=monthly contribution; r=interest rate; n=12; t=years
    [ P(1+r/n)^(nt) ] + [ PMT × (((1 + r/n)^(nt) – 1) / (r/n)) ]

    I implemented it that way in my form:
    (fieldname14*(1+(fieldname16/12))^(12*fieldname17))+(fieldname15*(((1+(fieldname16/12)^(12*fieldname17)-1)/(fieldname16/12))))

    Could you please help me understand why I don’t get the right amount which is €23,504?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @leontancredimedia

    In javascript does not exists the ^ operator, you should use the POW operation instead.

    5^2 would be POW(5,2)

    So, this equation:

    (fieldname14*(1+(fieldname16/12))^(12*fieldname17))+(fieldname15*(((1+(fieldname16/12)^(12*fieldname17)-1)/(fieldname16/12))))

    need to be edited as follows:

    
    fieldname14*POW(1+fieldname16/12,12*fieldname17)+(fieldname15*(((1+POW(fieldname16/12,12*fieldname17)-1)/(fieldname16/12))))
    

    However, I think the parenthesis in your original equation are not used in the correct places (please, check the maths).

    Best regards.

    Thread Starter leontancredimedia

    (@leontancredimedia)

    Hi,

    Thank you so much this definitely helps a lot.
    However still seems like the formula is not giving the right amounts:

    futureValue=fieldname19*POW((1+(fieldname16/12/100)),(fieldname17*12))+fieldname15*(POW((1+(fieldname16/12/100)),(fieldname17*12)+1)-(1+(fieldname16/12/100)))/(fieldname16/12/100)

    Even tried to write it as a full javascript with vars but still didn’t worked:
    var P = startingAmount;
    var Y = yearsOfInvesting;
    var c = getAdditionalContributionsPerPeriod;
    var t = getTermsPerPeriod;
    var n = t * Y;
    var r = interestRate / 100 / t; // interestRate [%]
    var z = 1 + r;
    total = P * Math.pow(z, n) + c * (Math.pow(z, n + 1) – z) / r;

    Plugin Author codepeople

    (@codepeople)

    Hello @leontancredimedia

    I think the operations you need are included into the “Financial Operations” module, distributed with the Developer and Platinum versions of the plugin:

    https://cff.dwbooster.com/documentation#financial-module

    Best regards.

    Thread Starter leontancredimedia

    (@leontancredimedia)

    Hi,

    Is there a way to get historical stock and indexes prices with the developer or platinum versions?

    It’s basically a function that is available in google sheet so was wondering if you allow it too in the premium versions.

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @leontancredimedia

    The plugin gives the tools for calling external APIs and services, but the integration with the external APIs and services must be implemented by your own code, and depends on the requirements of the external API and/or service to call, and not the plugin.

    Best regards.

    Thread Starter leontancredimedia

    (@leontancredimedia)

    Hi,
    I already implemented API of Stockdio Historical chart.
    How can I call the values of the Stockdio API and apply calculations on it?
    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @leontancredimedia

    I’m sorry, I cannot respond to your question because I don’t know your implementation of the API, I don’t know the information you are getting from the API, and the way you want to use it.

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Compound interest Formula’ is closed to new replies.