Realized P&L (FIFO)
realized_pnlRealized profit and loss from a pasted transactions export: sells matched first-in-first-out against earlier buys per symbol, fees on both sides taken out of the gain. Returns win rate, net, average win and loss, payoff ratio, average holding period in calendar days, totals by symbol, the worst and best closed lots, and sells with no buy in the data (reported apart, not counted as zero-cost wins). Reads E*TRADE's transaction download, the CSV this repo's fetcher writes, or any CSV with columns date, action (buy/sell), symbol, quantity, price and optionally fee. Options rows are set aside and counted. Nothing pasted is stored. Example: {"transactions_csv": "date,action,symbol,quantity,price,fee\n2025-01-06,buy,KO,100,61.20,0\n2025-09-02,sell,KO,100,69.85,0"}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"transactions_csv": "<transactions_csv>"
},
"name": "realized_pnl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | Limit the result to one symbol | |
| transactions_csv | Yes | The transactions export as CSV text, header row included |