[Patch] reworked advanced-portfolio.scm

Derek Atkins warlord at MIT.EDU
Sat Feb 18 15:44:38 EST 2006


Make sure you're responding to the list, please....

Quoting Andrew Sackville-West <andrew at farwestbilliards.com>:

>> E.g., here's a problem case:
>>
>>   Buy 100 shares on date T0
>>   pricedb entry on date T1
>>   pricedb entry on date T2
>>   Sell 50 shares on date T3
>>
>> Let's assume that delta-t is something like a week or a month, or even
>> a year.  The value of the sale at T3 could be VERY DIFFERENT than the
>> value in the pricedb at time T2.  When looking at the value of your
>> holding at time T4, IMHO you should use the price from time T3, not
>> the price from time T2.
>>
>> Perhaps we need some C code to make this easier to compute "on the
>> fly".  But it's IMHO how it should work.
>
> yeah, I understand now. good example. So the issue I see is that we
> have to get away from exchange-fn altogether as that is what breaks
> without a pricedb. AM I right? So I have to come up with some other way
> of converting the currencies. The real problem here is that I just
> don't understand what Mike's patch was supposed to do in the first
> place. All I did was fix it so it ran :). Alright, I'm off to study
> this thing more closely and see if I can figure out the proper way to
> do it. I'll report back captain.

I'm not sure we have to get away from exchange-fn altogether..  Although
we might need to extend it a bit.  The current exchange-fn is defined in
report-system/commodity-utilities.scm : gnc:case-exchange-fn and returns
a procedure that does the computation.   There are some docs there in
the source file.

I'm not convinced the problem here is exchange-fn.  I think the problem is
partly that we're assuming a price-db earlier and creating bad commodity
collectors.

I'm hoping Mike will chime in and explain to you what he was trying to do.

You're always welcome to pull out a particular version of the report from
SVN.  http://svn.gnucash.org/trac/browser

Good Luck,

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list