Is there an existing method that will provide the total returns for a security account

Bob B's Avatar

Bob B

05 Aug, 2020 07:49 PM

I need to get the total returns for a security in an investment account.

Total returns = (proceeds from all sales + dividends+ misc income) - cost of all buys.

I've searched through the documentation but I don't see such a function - does one exist? If not, what's the best way to create one? Should I retrieve all the transactions for the security account and iterate through them accumulating the values? Is this an expensive function in terms of performance?

  1. 1 Posted by dwg on 05 Aug, 2020 10:09 PM

    dwg's Avatar

    I'm a fellow user.

    The return amount on the investment report looks like it may give what you want.

    The definition on how this is calculated is in the thread:

  2. 2 Posted by dwg on 05 Aug, 2020 10:10 PM

    dwg's Avatar

    hmm seems I may have posted too soon, I only just noted you posted this in the extensions forum not the investment forum.

    My apologies

  3. 3 Posted by Bob B on 06 Aug, 2020 01:58 AM

    Bob B's Avatar

    Thanks. Failing a different answer, I'll try to find a coding example in existing extensions.

  4. System closed this discussion on 05 Nov, 2020 02:00 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac