AlertDesk 0.2.11

Why my numbers differ from my broker's or another program's

Which lot a sale closes
When you sell part of a position bought in several lots, the gain depends on which lot the sale closes. AlertDesk uses your broker's own lot assignment, from the gain/loss file you import (Schwab: Accounts → Cost Basis → Realized Gain/Loss, lot details): if Schwab says a sale closed the lot bought on 9/2, AlertDesk closes that lot. Without that file, or for a sale it doesn't cover, the oldest lot goes first (first in, first out). A program that always closes the oldest lot first can differ from your broker by a few dollars on sales that close part of a position; a position closed in full comes to the same total either way.
Fees
AlertDesk's P/L is after the trade's own commissions and fees, as your broker's Amount column has them. A program that shows P/L before fees differs by exactly those fees: Performance's Fees paid says how much. Fees charged to the account rather than a trade, interest, deposits and withdrawals are in the Ledger, never in P/L.
Dates
A trade's day is the trade date in your transactions. Schwab's gain/loss file dates a sold option by the settlement day after you bought it back; AlertDesk still matches that lot, keeps the transactions' dates, and notes it ("dated differently"). A program using settlement dates can put a close a day later -- sometimes in another month or year.
Positions moved between your accounts
They keep their original cost and buy date, from the gain/loss file. A program that starts them again at the transfer shows a different cost, and a different holding time.

Where this comes from

Originator and date

AlertDesk's maker, 10/13/2026, after importing a real account's files and comparing AlertDesk's figures with the broker's own and with another program's.

Industry sources read

Schwab's Realized Gain/Loss lot details, as its website exports them: for each sale, the lot it closed, with the lot's buy date, quantity and gain or loss. First in, first out and specific-lot identification are the cost-basis methods brokers describe for closing lots; no further source was read for this page.

What prompted it

A program that closes lots first in, first out disagreed with the broker by a few dollars on sales that closed part of a position, and the broker's file dated sold options by the settlement day after they were bought back.

What we changed and why

AlertDesk now closes the lots the broker's own gain/loss file says each sale closed; without that file, or for a sale it doesn't cover, the oldest lot goes first. Dates come from the transactions, and a lot the broker dates differently counts as a match with a note. P/L is after the trade's own commissions and fees, as before.

Our own evidence

`tests/test_import_session.py`: a sale the broker assigns to the newer lot closes that lot, where first in, first out would have closed the older one; a sold option bought back at once after two sales matches the broker's single lot dated by settlement, with its note, and stays out of Needs a look.