Skip to content

Add trend-aware review for non-traded holdings#26

Merged
aaronjs99 merged 1 commit into
masterfrom
batch/trend-review-non-traded-holdings
May 5, 2026
Merged

Add trend-aware review for non-traded holdings#26
aaronjs99 merged 1 commit into
masterfrom
batch/trend-review-non-traded-holdings

Conversation

@aaronjs99

Copy link
Copy Markdown
Owner

Adds non-model-backed trend/status review for portfolio holdings using local market CSVs while preserving local-only behavior. Closes #21.

Copilot AI review requested due to automatic review settings May 5, 2026 02:48
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@aaronjs99 aaronjs99 merged commit 79134f3 into master May 5, 2026
5 checks passed
@aaronjs99 aaronjs99 deleted the batch/trend-review-non-traded-holdings branch May 5, 2026 02:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add trend-aware review for non-traded holdings

2 participants