fix: portfolio current value divided by 100 erroneously
currentPrice is already in cents, so currentValue = price * shares. The extra /100 made every holding appear worth 100x less than its cost, producing ~-100% P&L on every position and an empty allocation chart (values too small for Chart.js to render). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
437fb5a2df
commit
5d30b5eaee
@ -105,7 +105,7 @@ func computeHoldings(trades []Trade, prices map[string]int64) []Holding {
|
|||||||
|
|
||||||
currentPrice := prices[isin]
|
currentPrice := prices[isin]
|
||||||
|
|
||||||
currentValue := int64(float64(currentPrice) * a.shares / 100)
|
currentValue := int64(float64(currentPrice) * a.shares)
|
||||||
unrealizedPCL := currentValue - a.cost
|
unrealizedPCL := currentValue - a.cost
|
||||||
pct := 0.0
|
pct := 0.0
|
||||||
if a.cost > 0 {
|
if a.cost > 0 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user