I managed to bypass the "KeyError: ('USD', 'USD')"" by removing "currency:
"USD"" from investment, basically making it:
"investments {
investment {
asset_account: "Assets:Investing:CSchwab:Cash"
cash_accounts: "Assets:Personal:Checking"
}
}
groups {
group {
name: "CSchwabCash"
investment: "Assets:Investing:CSchwab:Cash"
}
}"
But then when i try to add other cash accounts (as i understand it for
CSchwab:Cash my investments (RDFN, SQ, etc) become cash_accounts (accounts
external to the investment)):
investment {
asset_account: "Assets:Investing:CSchwab:Cash"
cash_accounts: "Assets:Personal:Checking"
cash_accounts: "Assets:Investing:CSchwab:RDFN"
cash_accounts: "Assets:Investing:CSchwab:SQ
.....
}
i get error
R:\b\b-office>python beangrow/compute_returns.py -e 2021-09-01 b.beancount
conf-returns returns
Traceback (most recent call last):
File "beangrow/compute_returns.py", line 105, in <module>
main()
File "beangrow/compute_returns.py", line 80, in main
account_data_map = investments.extract(
File "R:\b\b-office\beangrow\investments.py", line 553, in extract
account_data = [process_account_entries(pruned_entries,
config.investments, aconfig,
File "R:\b\b-office\beangrow\investments.py", line 553, in <listcomp>
account_data = [process_account_entries(pruned_entries,
config.investments, aconfig,
File "R:\b\b-office\beangrow\investments.py", line 376, in
process_account_entries
flows_general = produce_cash_flows_general(entry, account)
File "R:\b\b-office\beangrow\investments.py", line 178, in
produce_cash_flows_general
assert not posting.cost
AssertionError
(same as the one you reported on github for In-kind transfers
https://github.com/beancount/beangrow/issues/3 )
On Monday, September 13, 2021 at 11:15:15 PM UTC-4 [email protected] wrote:
> On Monday, September 13, 2021 at 5:12:30 PM UTC-7 Bman Q wrote:
>
>> I have couple of additional questions on bean grow set-up:
>> 1. configure.py seems to ignore closed accounts, is it how it supposed to
>> work?
>> (usually for strictness i was closing accounts after i exited/sold
>> position, example: "2020-10-06 close Assets:Investing:CSchwab:RDFN")
>>
>
> Hmm, it shouldn't: see this line and comment
> <https://github.com/beancount/beangrow/blob/49bf41539cbb4fcee3c2034ce419ab507b3860bf/beangrow/configure.py#L37>and
>
> its code:
>
> """Return a list of account names from the balance sheet which either
> aren't
> closed or are closed now but were still open at the given start date. """
>
> If you're seeing a problem case, would you mind opening a bug in the repo
> with a demo example?
>
>
> 2. "Including Uninvested Cash"
>> Do i understand it right that the easiest way to account for uninvested
>> cash is to create
>> -commodity "IDDLEUSD"
>> -account Assets:Investing:IDDLEUSD
>> buy IDDLEUSD for all cash (USD) that i can invest at rate 1:1,
>> and then at each interval i do reports "price IDDLEUSD 1 USD",
>> and when i want to buy smng sell IDDLEUSD for USD, and buy what i want.
>> ?
>>
>> OR is there a way to make my investment cash accounts
>> "Assets:Investing:CSchwab:Cash", etc to be counted as investment (with 0
>> return) ?
>>
>
> The latter is exactly what I do for now: simply include
> "Assets:Investing:CSchwab:Cash" as a commodity, and it'll show up with very
> low returns.
>
> However, for me, this means that cash in other parts of the hierarchy
> (example: banks, paypal, etc.) are not counted. AFAIK, beangrow does not
> offer a global solution for this. See "Including Uninvested Cash" in Martin's
> doc
> <https://docs.google.com/document/d/1nPsMIunLnDvdsg6TSsd0PZb7jngojNpFlqnaX36WRp8/edit#>
> .
>
> Not really an analysis solution, but as a strategy, I personally use
> fava_investor <https://github.com/redstreet/fava_investor> to monitor
> uninvested cash.
>
>
> 3. Is there recommended time frame for "price" quotes?
>> Usually i open positions for 3-5 years, so not interested in daily or
>> even monthly fluctuations.
>> Do i understand it right that if i use
>> -"plugin "beancount.plugins.implicit_prices"" (to get price from buy/sell
>> transactions)
>> -price my investments on 1st of each Quarter
>> -run compute_returns.py with -e DATE = 1st of each Quarter (basically
>> same cut off as date of last price quote)
>> then i will be fine and won't need any more price quotes
>> ?
>>
>
> After including the implicit_prices plugin, and running beangrow once, you
> will want to run:
> beangrow/beangrow/download_prices_from_file.py
> <your_returns_output_dir>/prices/prices.beancount
>
> and include the resulting price database in your source, and re-reun
> beangrow. Without that, beangrow uses the price values on the closest dates
> it can find, which in your case could be weeks or months off, which means
> your returns numbers will be off.
>
> The file generated above provides the only dates on which the prices
> matter to beangrow for your configuration. These are the start and end
> dates of your cashflow. Meaning, period opening and closing dates, and
> dates on which you bought/sold, IIRC. More detail here
> <https://github.com/beancount/beangrow/issues/7>.
>
> Enjoy!
>
>
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/d18c220c-c188-49e0-bbe5-aef33de666d3n%40googlegroups.com.