well I took a look at the code and the changelog, and found out for some questionable reasons, the behaviour was changed from displaying the numeric worth of all investments to a color-trend based on the worth change...
but looking at the code itself revealed, that the calculation seem rather broken:
in the code below, the lines in the iterations should rather read like
var = row[updater.VARIATION]
now = row[updater.VALUE]
start = now - var
to make more sense imho... also the color-scale sensitivity might be a candidate for the preference dialog, as it might need considerable (relative) worth-changes to cause a noticeable color change, depending on the investments done...
well I took a look at the code and the changelog, and found out for some questionable reasons, the behaviour was changed from displaying the numeric worth of all investments to a color-trend based on the worth change...
but looking at the code itself revealed, that the calculation seem rather broken:
in the code below, the lines in the iterations should rather read like
var = row[updater. VARIATION]
now = row[updater.VALUE]
start = now - var
to make more sense imho... also the color-scale sensitivity might be a candidate for the preference dialog, as it might need considerable (relative) worth-changes to cause a noticeable color change, depending on the investments done...
(from http:// svn.gnome. org/viewcvs/ gnome-applets/ trunk/invest- applet/ invest/ widgets. py?view= markup) gtk.Image) : update( self, updater): TICKER_ ONLY]:
class InvestTrend(
...
def on_quotes_
start_total = 0
now_total = 0
for row in updater:
# Don't count the ticker only symbols in the color-trend
if row[updater.
continue
var = row[updater. VARIATION] /100
now = row[updater.VALUE]
start = now / (1 + var)
portfolio_number = sum([purchase[ "amount" ] for purchase in invest. STOCKS[ row[updater. SYMBOL] ]])
start_total += start * portfolio_number
now_total += now * portfolio_number
day_var = (now_total - start_total) / start_total * 100 127.5*day_ var))) NEGATIVE[ min(len( COLORSCALE_ NEGATIVE) -1, abs(color))] POSITIVE[ min(len( COLORSCALE_ POSITIVE) -1, abs(color))]
color = int(2*day_var)
opacity = min(0xFF, int(abs(
if day_var < 0:
color = COLORSCALE_
else:
color = COLORSCALE_
self. set_color( color, opacity)