get_trading_pnl
Calculates realized trading P&L using per-account moving-average cost basis, with by-symbol or round-trip views and custom date ranges for portfolio review.
Instructions
Realized trading P&L under per-account moving-average cost basis.
view "by_symbol": realized P&L, fees and taxes per symbol for the period. view "round_trips": closed buy-to-sell cycles, win rate and open-position P&L. start/end (ISO YYYY-MM-DD) override period. detail_level "summary" lists 20 by_symbol rows, incomplete data first, then the largest realized P&L (symbols_page has the total), or the top 10 round_trips symbols by |realized P&L| with reason groups (symbol_count, omitted_symbols); pass symbol or detail_level "full" for every symbol. Fetched broker rows are recorded in the local append-only ledger (no broker writes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| view | No | by_symbol | |
| start | No | ||
| period | No | YTD | |
| symbol | No | ||
| account | No | all | |
| detail_level | No | summary |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||