Story: PnL tracking improvements

Table of Contents

This page documents a story in Sprint 19. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

Improve OreStudio's PnL tracking to match the standard set by leading retail platforms. Drawing on the Lightyear PnL tracking approach, this story introduces: FX rate locking at cash-event time (deposits and withdrawals fix their exchange rate permanently), timeframe-scoped PnL so charts reflect the selected window, a clean split between total-portfolio-value and investment-only PnL views, two-phase sell-order calculations (intraday estimate → EOD final), and user-selectable cost basis methods (weighted average or FIFO).

Status

Field Value
State DONE
Parent sprint Sprint 19
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-06-03

Acceptance

  • FX rates are locked at the moment each deposit or withdrawal is recorded; subsequent FX moves do not alter historical cost basis.
  • PnL figures respect the selected chart timeframe (1D, 1M, YTD, all-time).
  • The UI offers two chart modes: total portfolio value (including uninvested cash) and investment-only PnL (excluding cash movements).
  • Sell-order P&L shows an intraday estimate immediately and updates to EOD-rate final figures once settlement closes.
  • Accounts can be configured to use either weighted average cost or FIFO cost basis; the method is reflected consistently in P&L display and in Capital Gains Statements.

Tasks

Task State Start End Description
Implement PnL tracking improvements BACKLOG 2026-06-03   Design, gap-analysis, and initial implement

Decisions

Out of scope

  • Tax reporting integration (tracked separately).
  • Performance attribution beyond the simple money-weighted formula.

Emacs 29.1 (Org mode 9.6.6)