Add trend-aware review for non-traded holdings#26
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds local trend/status review for non-traded holdings so portfolio surfaces can show basic market-context signals without implying model-backed recommendations. This extends the existing local portfolio review flow in the CLI, decision summary, and GUI.
Changes:
- Added local market-CSV-based trend analysis for non-traded holdings in
portfolio.review. - Surfaced trend status/note and price date in daily decision text, CLI portfolio status, and GUI positions table.
- Added tests covering trend classifications and the new output in CLI/decision/GUI paths.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_portfolio_state.py |
Adds CLI status coverage for non-traded trend review output. |
tests/test_portfolio_review.py |
Adds unit tests for trend classification and stale/missing price handling. |
tests/test_portfolio_gui.py |
Extends GUI assertions for the new trend columns/content. |
tests/test_decision.py |
Adds decision-text coverage for non-traded holding trend review. |
src/trading_lab/portfolio/review.py |
Implements holding trend parsing/classification and review metadata. |
src/trading_lab/portfolio/gui_render.py |
Displays trend-related fields in the positions table. |
src/trading_lab/decision.py |
Passes market directory through and renders trend review lines. |
src/trading_lab/cli/main.py |
Appends non-traded holdings trend review to tl portfolio status. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+380
to
+385
| reference_date = reference_date or date.today() | ||
| latest_date, prices = _latest_market_row(symbol, market_dir) | ||
| if latest_date is None or not prices: | ||
| return HoldingTrend("PRICE_MISSING") | ||
| if reference_date is not None and latest_date < reference_date: | ||
| return HoldingTrend("PRICE_STALE", latest_date=latest_date) |
Comment on lines
+443
to
+447
| with path.open(newline="", encoding="utf-8") as handle: | ||
| reader = csv.DictReader(handle) | ||
| for row in reader: | ||
| parsed_date = _parse_date(row.get("date", "")) | ||
| price = _row_price(row) |
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.
Adds non-model-backed trend/status review for portfolio holdings using local market CSVs while preserving local-only behavior. Closes #21.