Discussion:
Problem with market prices and historical balances?
Jonathan Jouty
2018-04-20 10:40:49 UTC
Permalink
Hey,

I couldn't find an existing bug... so maybe I'm just doing things wrong or
don't understand how this is supposed to work.
If I take the market value example (
http://hledger.org/manual.html#market-value):

# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10

# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking

# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03

As an aside, the documentation states that
[when] (no report end date specified, defaults to the last date in the
journal)

However this doesn't appear to be the case anymore:

$ hledger -f t.j bal euros -V
$103.00 assets:euros
--------------------
$103.00
$ hledger -f t.j bal euros -V -e 2016/11/4
$110.00 assets:euros
--------------------
$110.00

The main thing I'm trying to do is get multi-column historical balances.
So I want to see how my euros appreciated or depreciated over time...

I've tried various flags and can not get it to show something either way!

$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
Balance changes in 2016/11:

|| Nov
==============++=========
assets:euros || $103.00
--------------++---------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
--historical
Ending balances (historical) in 2016/11:

|| 2016/11/30
==============++============
assets:euros || $103.00
--------------++------------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
--historical --empty
Ending balances (historical) in 2016/11/01-2016/12/31:

|| 2016/11/30 2016/12/31
==============++========================
assets:euros || $103.00 $103.00
--------------++------------------------
|| $103.00 $103.00


It appears to even be reporting incorrectly for 2016/11/30, it should be
$110.00!
I'm on hledger 1.9.
IIRC this used to work with v1.5.

Anybody has an idea what's going on?

Cheers.
--
Jonathan Jouty
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 12:41:36 UTC
Permalink
Hey,
I couldn't find an existing bug... so maybe I'm just doing things wrong or don't understand how this is supposed to work.
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
As an aside, the documentation states that
[when] (no report end date specified, defaults to the last date in the journal)
$ hledger -f t.j bal euros -V
$103.00 assets:euros
--------------------
$103.00
$ hledger -f t.j bal euros -V -e 2016/11/4
$110.00 assets:euros
--------------------
$110.00
Thanks for the report. hledger 1.5 had this change:

* -V/--value uses today's market prices by default, not those of last transaction date. #683, #648

I have updated those examples at http://hledger.org/manual.html#market-value <http://hledger.org/manual.html#market-value> .
The main thing I'm trying to do is get multi-column historical balances.
So I want to see how my euros appreciated or depreciated over time...
I've tried various flags and can not get it to show something either way!
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
|| Nov
==============++=========
assets:euros || $103.00
--------------++---------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical
|| 2016/11/30
==============++============
assets:euros || $103.00
--------------++------------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical --empty
|| 2016/11/30 2016/12/31
==============++========================
assets:euros || $103.00 $103.00
--------------++------------------------
|| $103.00 $103.00
It appears to even be reporting incorrectly for 2016/11/30, it should be $110.00!
This is a current limitation of our --value flag with multicolumn reports - it uses the report-end prices for all columns (in hledger-1.5 too). It would be more useful if it used the interval-end prices in each column, as you expected. I'd welcome a patch for this.

I guess this wasn't documented - an oversight. I've added it to http://hledger.org/manual.html#market-value <http://hledger.org/manual.html#market-value> and http://hledger.org/manual.html#balance <http://hledger.org/manual.html#balance> .
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Jouty
2018-04-20 16:57:32 UTC
Permalink
Post by Jonathan Jouty
Hey,
I couldn't find an existing bug... so maybe I'm just doing things wrong or
don't understand how this is supposed to work.
If I take the market value example (http://hledger.org/manual.
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
As an aside, the documentation states that
[when] (no report end date specified, defaults to the last date in the
journal)
$ hledger -f t.j bal euros -V
$103.00 assets:euros
--------------------
$103.00
$ hledger -f t.j bal euros -V -e 2016/11/4
$110.00 assets:euros
--------------------
$110.00
* -V/--value uses today's market prices by default, not those of last
transaction date. #683, #648
I have updated those examples at http://hledger.org/manual.
html#market-value .
The main thing I'm trying to do is get multi-column historical balances.
So I want to see how my euros appreciated or depreciated over time...
I've tried various flags and can not get it to show something either way!
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
|| Nov
==============++=========
assets:euros || $103.00
--------------++---------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical
|| 2016/11/30
==============++============
assets:euros || $103.00
--------------++------------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical --empty
|| 2016/11/30 2016/12/31
==============++========================
assets:euros || $103.00 $103.00
--------------++------------------------
|| $103.00 $103.00
It appears to even be reporting incorrectly for 2016/11/30, it should be $110.00!
This is a current limitation of our --value flag with multicolumn reports
- it uses the report-end prices for all columns (in hledger-1.5 too). It
would be more useful if it used the interval-end prices in each column, as
you expected. I'd welcome a patch for this.
Are there any open issues regarding this?
I've found https://github.com/simonmichael/hledger/issues/329
Post by Jonathan Jouty
I guess this wasn't documented - an oversight. I've added it to
http://hledger.org/manual.html#market-value and http://
hledger.org/manual.html#balance .
Thanks for the prompt reply and documentation updates.
Post by Jonathan Jouty
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jonathan Jouty
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 17:06:41 UTC
Permalink
I think that's the best existing issue.
Post by Simon Michael
Hey,
I couldn't find an existing bug... so maybe I'm just doing things wrong or don't understand how this is supposed to work.
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
As an aside, the documentation states that
[when] (no report end date specified, defaults to the last date in the journal)
$ hledger -f t.j bal euros -V
$103.00 assets:euros
--------------------
$103.00
$ hledger -f t.j bal euros -V -e 2016/11/4
$110.00 assets:euros
--------------------
$110.00
* -V/--value uses today's market prices by default, not those of last transaction date. #683, #648
I have updated those examples at http://hledger.org/manual.html#market-value <http://hledger.org/manual.html#market-value> .
The main thing I'm trying to do is get multi-column historical balances.
So I want to see how my euros appreciated or depreciated over time...
I've tried various flags and can not get it to show something either way!
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly
|| Nov
==============++=========
assets:euros || $103.00
--------------++---------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical
|| 2016/11/30
==============++============
assets:euros || $103.00
--------------++------------
|| $103.00
$ hledger -f t.j bal euros -b 2016/11 -e 2016/12/31 --value --monthly --historical --empty
|| 2016/11/30 2016/12/31
==============++========================
assets:euros || $103.00 $103.00
--------------++------------------------
|| $103.00 $103.00
It appears to even be reporting incorrectly for 2016/11/30, it should be $110.00!
This is a current limitation of our --value flag with multicolumn reports - it uses the report-end prices for all columns (in hledger-1.5 too). It would be more useful if it used the interval-end prices in each column, as you expected. I'd welcome a patch for this.
Are there any open issues regarding this?
I've found https://github.com/simonmichael/hledger/issues/329 <https://github.com/simonmichael/hledger/issues/329>
I guess this wasn't documented - an oversight. I've added it to http://hledger.org/manual.html#market-value <http://hledger.org/manual.html#market-value> and http://hledger.org/manual.html#balance <http://hledger.org/manual.html#balance> .
Thanks for the prompt reply and documentation updates.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
Jonathan Jouty
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...