Repository navigation
feat(cli): /records shows daily equity, fills and realized P&L - #651
Merged
Merged
Conversation
Every routine writes these to state/user.db, but nothing in the CLI read them. The command reads DailyRecords and makes no broker calls, so it works offline and shows the state as of the last routine. A sale with no known cost basis says so. Closes #602 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #602.
Every routine writes
account_daily,position_dailyandfillstostate/user.db, but nothing in the CLI read them.The change
/records [days|all], defaulting to the last 10 recorded days:It reads
DailyRecordsand makes no broker calls, so it works offline and shows the state as of the last routine. A sale with no known cost basis says so rather than guessing: on the real records,/records alllists 33 such sales from before records began, and keeps them out of the total.It isn't a
FunctionTool, because #331 hasn't settled that layer.Testing
tests/unit/cli/test_records_command.py, on real records in a temp state dir: the QQQ stop-out's fill and +$237.60, date limits, unknown cost basis, bad arguments, no network, and no records changed.pytest tests/ -m "not db": 1879 passed, 2 skipped.