Hi,

This is a proposal for a generalized output for the -J option.

When multiple commodities appear, -J does not work except when using -X.
This works but information is lost about commodities, which is a pity.
I propose a --reference-exchange option (better names could probably be
coined) which would work as follow:
- without -J, --reference-exchange work as --exchange.
- with -J, --reference-exchange produces a csv output containing (in
  that order) the date, and the amount of every commodity contained in
  the account followed by its exchange rate with the --reference
  commodity at the given date.

A few examples:
- if the account has the reference commodity, the output is the same as
  with -J (it should be decided if the exchange rate of 1 for the
  reference commodity itself should be output or left implicit).
- an account with three commodities and --reference-exchange $ would
  give, e.g.:
  date       $    €   €-rate £   £-rate
  2008-09-11 1000 200 1.3078 300 1.5619
  2008-09-12 1500 200 1.3078 300 1.5619
  2008-09-13 1500 700 1.3040 300 1.5619
  2008-09-14 1500 700 1.3040 100 1.5712
  2008-09-15 1100 700 1.3040 100 1.5712

This is designed with plotting in mind: one is able to plot every
commodity separately (useful for portefolios), or to combine them thanks
to exchange rates using the "reference commodity".

A problem is that the exchange rate might not be defined at the
begining for some commodities, but in that case their amount should be 0
so it probably does not matter.

Does this sound reasonable?

Regards,
-- 
Gabriel Kerneis

Reply via email to