I'm trying to use bean-price so that I could run a query like 'BALANCES AT COST' to have my stock position in USD rather than the amount of units.
It work fine when I'm using a journal generated from bean-example but with my own file it's not, and I can't see why. :s
$ cat test.bean
option "title" "Example Beancount file"
option "operating_currency" "USD"
2011-05-31 commodity RGAGX
export: "MUTF:RGAGX"
price: "USD:google/MUTF:RGAGX"
2015-09-30 open Equity:Opening-Balances
2015-09-30 open Assets:RGAGX RGAGX
2015-09-30 pad Assets:RGAGX Equity:Opening-Balances
2015-10-01 balance Assets:RGAGX 1500.0001 RGAGX
If I run bean-price on the file nothing happen:
$ bean-price -v test.bean
INFO : Using price cache at "/tmp/bean-price.cache" (with indefinite expiration)
INFO : Processing at date: 2015-12-14
INFO : Loading "test.bean"
Running the query manually work:
$ bean-price -e USD:google/MUTF:RGAGX
2015-12-11 price MUTF:RGAGX 44.4 USD
So I add it manualy:
$ bean-price -e USD:google/MUTF:RGAGX >> test.bean
Here I get an error because bean-price output MUTF:RGAGX
$ bean-query test.bean 'BALANCES AT COST'
test.bean:12: ValueError: Invalid account name: MUTF:RGAGX
So at this point I just rename it to RGAGX but my BALANCES report still show up unit of RGAGX
$ bean-query test.bean 'BALANCES AT COST'
account sum_cost_position
----------------------- -----------------
Assets:RGAGX 1500.0001 RGAGX
Equity:Opening-Balances -1500.0001 RGAGX