Commit Graph

9 Commits

Author SHA1 Message Date
dtarkent2-sys 8c48c3cffd WIP: local TradingAgents customizations through 2026-04-13
Bulk commit of accumulated local changes on the dtarkent2-sys fork.
Spans agents, dataflows, llm_clients, graph orchestration, CLI, and
docs. Primary work areas:

- llm_clients/ — multi-LLM client layer (anthropic, google, openai,
  factory, base, validators) for swappable provider support
- dataflows/alpaca_data.py — Alpaca integration alongside existing
  alpha_vantage and y_finance flows
- agents/structured/ — portfolio, scoring, and tier1/2/3 layers
- agents/analysts, researchers, risk_mgmt — local prompt and logic
  customizations
- graph/ — orchestration tweaks (parallel_analysts, propagation,
  reflection, signal_processing, trading_graph)
- alembic scaffolding inherited from prior commit
- chainlit web UI design notes in docs/plans/

This is a single WIP snapshot to preserve work before any upstream
merge. History can be cleaned up with interactive rebase later.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:01:00 -04:00
dtarkent2-sys 84f7894768 feat: switch stock data to Alpaca Markets API with yfinance fallback
Alpaca provides 10k calls/min free with 7yr history via IEX feed.
Hybrid approach: Alpaca for price bars, snapshots, sector ETF perf,
and moving averages; yfinance for fundamentals (PE, margins, 13F).

- Add alpaca_data.py: bars, snapshots, MAs, sector ETF perf, news
- Update get_macro_indicators: sector ETF performance via Alpaca
- Update get_sector_rotation: compute relative strength vs SPY
- Update entry timing node: Alpaca MAs from actual bar data
- Add alpaca-py to requirements.txt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:23:58 +00:00
dtarkent2-sys 5e8c81e738 fix: 6 audit issues — missing await, regime range, pct_out scaling, ticker validation, dead code, flag merge
1. app.py: await _update_in_progress (coroutine was silently dropped)
2. models.py + tier1.py: regime_score_adjustment range ±2→±10 (was negligible on 0-100 scale)
3. y_finance.py: pct_out * 100 (was fraction, displayed as percent)
4. app.py: ticker validation accepts dots/hyphens (BRK.B, BF-B)
5. portfolio.py: wire _fetch_peer_basics into theme substitution (was dead code)
6. setup.py: accumulate global_flags across parallel agents (dict.update was dropping them)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:56:38 +00:00
dtarkent2-sys ee80a42971 feat: add regime awareness, smart-money tracking, theme substitution & position replacement
- MacroRegimeOutput: risk_appetite, liquidity_regime, regime_score_adjustment (-2 to +2)
- InstitutionalFlowOutput: 13F holders, insider transactions, short interest trend, smart_money_signal
- Scoring node applies regime adjustment to master score
- Theme Substitution Engine: identifies best expression of theme, ranks peers, flags overlap
- Position Replacement Agent: compares candidate to theme alternatives, flags replacements
- Pipeline: Scoring → Portfolio Analysis → Debate → Decision
- Final decision narrative includes theme context and replacement flags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:46:03 +00:00
dtarkent2-sys 7ad9e1d1ce feat: rebuild as structured Pydantic equity ranking engine
Replace generic LLM debate system with a tiered, macro-aware equity
ranking pipeline where every agent returns Pydantic structured output
and scoring is deterministic Python — no prose drives downstream decisions.

Architecture: Validation → Tier 1 (Macro+Liquidity parallel) →
Tier 2 (8 agents parallel) → Scoring (Archetype+MasterScore) →
Tier 3 (Bull/Bear debate + Risk + FinalDecision) → END

Master Score: 25% business_quality + 20% macro + 15% institutional_flow
+ 10% valuation + 10% entry_timing + 10% earnings_revisions + 5% backlog
+ 5% crowding. Hard veto gates, confidence penalties, position role
assignment all computed deterministically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:30:46 +00:00
Yijia Xiao 3d040f8da4
feat: add yfinance support to accommodate community request for stability and quota 2026-02-03 22:27:20 +00:00
Edward Sun 7bb2941b07 optimized yfin fetching to be much faster 2025-10-06 19:58:01 -07:00
Edward Sun c07dcf026b added fallbacks for tools 2025-10-03 22:40:09 -07:00
luohy15 b01051b9f4 Switch default data vendor
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 12:43:27 +08:00