beancount / beangrow

Returns calculations on portfolios in Beancount
GNU General Public License v2.0
57 stars 21 forks source link

returns of -100.0% for short durations / large return numbers #14

Open gety9 opened 3 years ago

gety9 commented 3 years ago

simple.beancount

option "operating_currency" "USD"
plugin "beancount.plugins.check_commodity"
plugin "beancount.plugins.implicit_prices"

2005-01-01 commodity USD
2005-01-01 commodity AAA

2019-01-01 open Assets:Investments:Cash     USD
2019-01-01 open Expenses:Investing:Fees     USD
2019-01-01 open Income:Investments:Gains    USD
2019-01-01 open Assets:Investments:AAA      AAA

2019-03-18 * "Buy AAA"
  Assets:Investments:AAA                    250 AAA {39.75 USD, 2019-03-18}
  Assets:Investments:Cash              -9937.50 USD

2019-03-20 * "Sell AAA"
  Assets:Investments:AAA                   -250 AAA {39.75 USD, 2019-03-18} @ 41.95 USD
  Expenses:Investing:Fees                  0.23 USD
  Income:Investments:Gains                 -550 USD
  Assets:Investments:Cash              10487.27 USD

conf-simple

investments {
  investment {
    currency: "AAA"
    asset_account: "Assets:Investments:AAA"
    cash_accounts: "Assets:Investments:Cash"
  }
}
groups {
  group {
    name: "currency.AAA"
    investment: "Assets:Investments:AAA"
  }
}

result 1_preFix 2019's return shown as 20%, X_years_ago returns shown as = -100%

result with fix of issue 4 of https://github.com/beancount/beangrow/issues/4#issuecomment-920074454 2_afterFix all returns shown as -100%

The correct return is ~1852657.75%

I am not sure

And though such a large return number is meaningless and not sustainable current outputs are deceptive, i think displaying order of magnitude 10^6% will be more appropriate. (similarly if it's -1852657.75% then -10^6%)