Skip to content

How P&L is Calculated

crux1s edited this page Feb 28, 2026 · 1 revision

How P&L is Calculated

TastyMechanics uses cash-flow based P&L — every number represents money that actually hit or left your account. Unrealised gains and losses on open positions are never included.


Three components

Total realised P&L is the sum of three independent components:

Total P&L = Options P&L + Equity P&L + Income P&L

1. Options P&L

All option trade rows (Equity Option and Future Option) with Type = Trade or Receive Deliver are summed. The Total column is used — this is the net cash amount after commissions and fees. No further adjustment is made.

Cash-settled index options (SPX, XSP, NDX etc.) that expire or exercise into cash are included here via their Receive Deliver settlement rows.

2. Equity P&L (FIFO)

Share sales are matched against prior purchases using First-In, First-Out (FIFO) cost basis. Each realised gain or loss = sale proceeds minus the cost of the earliest matching lot.

The FIFO engine (_iter_fifo_sells in mechanics.py) maintains a separate deque per ticker. It handles:

  • Standard buy → sell sequences
  • Assignment deliveries (shares received at the assigned strike)
  • Fractional shares
  • Partial lot sales

Shares that are still open (unsold) contribute nothing to P&L — only realised sales are counted.

3. Income P&L

Dividends, credit interest, and debit interest (margin charges) are summed from Money Movement rows. The three Sub Types counted are:

  • Dividend
  • Credit Interest
  • Debit Interest

Balance Adjustments and Transfers are explicitly excluded.


Campaign accounting

Options traded while a wheel campaign is open are attributed to that campaign and shown in the Wheel Campaigns tab. Options traded before the first share purchase (pre-campaign) are classified as standalone P&L — they appear in the ticker breakdown but are not counted as campaign premiums.

This prevents inflating the effective basis calculation with options that had nothing to do with the wheel.

See Wheel Campaigns for full detail.


Windowed P&L

All three components can be filtered by a time window (7 days, 30 days, 90 days, YTD, All Time). The window filters on transaction date — the UTC date the trade was recorded by TastyTrade.

Note: TastyTrade stores timestamps in UTC. A trade placed at 9pm US Eastern time will appear as the next calendar day in UTC. This is consistent across all trades and does not affect weekly or monthly bucketing in any meaningful way.


What is NOT included

  • Unrealised gains/losses on open share positions
  • Options margin (only cash actually paid/received is counted)
  • Wash sale adjustments
  • Tax lot adjustments
  • Mark-to-market values

Always reconcile against your official TastyTrade statements for tax purposes.

Clone this wiki locally