Walsh: Multi-agent research pipeline with risk manager that | Coderz Club

Walsh: Multi-agent research pipeline with risk manager that can veto trades ats4321 / walsh Public Notifications You must be signed in to change notification settings Fork 1 Star 5 git-committingBran

Walsh: Multi-agent research pipeline with risk manager that can veto trades ats4321 / walsh Public Notifications You must be signed in to change notification settings Fork 1 Star 5 git-committingBran

By Coderz Club · 2026-08-02 · Tags: git

Walsh: Multi-agent research pipeline with risk manager that can veto trades

ats4321 / walsh Public Notifications You must be signed in to change notification settings Fork 1 Star 5 git-committingBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History17 Commits17 Commitsagentsagents backtestbacktest demodemo evaleval memorymemory orchestratororchestrator teststests toolstools .gitignore.gitignore CLAUDE.mdCLAUDE.md README.mdREADME.md conftest.pyconftest.py pyproject.tomlpyproject.toml requirements.txtrequirements.txt schema.pyschema.py uv.lockuv.lock View all filesRepository files navigationWalsh Walsh is a multi-agent stock research system that routes each ticker through four specialized agents in parallel — Fundamental, Technical, Sentiment, and Macro — aggregates their theses via a confidence-weighted Portfolio Manager, then gates the final call through a Rule-Based Risk Manager that can veto or downgrade before any trade is executed. Live demo: walsh-demo.vercel.app · Demo GIF Results Backtest run: AAPL · MSFT · NVDA, Jan 2023 – Dec 2023, $100k initial capital, rule-based signal agents, strict no-lookahead enforcement. Metric Walsh Pipeline Buy & Hold (equal-weight) Total Return +75.52% +119.75% Sharpe Ratio 2.36 2.86 Max Drawdown −13.50% −13.22% Win Rate 76.2% — # Trades 21 — Final Value $175,518 $219,749 Walsh underperformed buy-and-hold on this bull-market period. In Oct 2023, the pipeline exited all positions when momentum signals broke down and held cash for the entire month, missing a subsequent NVDA recovery rally. This is the intended behavior of the risk gate — it correctly identified a high-uncertainty period — but reveals the cost of a conservative threshold in trending markets. Per-agent accuracy / confidence calibration: pending. The eval/agent_attribution.py module is ready; results require ≥50 completed pipeline runs with follow-up price data to produce meaningful calibration curves. Cost and latency per run: pending. The eval/cost_latency.py PipelineTracker is instrumented; numbers will be populated once the LLM-backed agents replace the current rule-based stubs. Adversarial robustness: 18 test cases across three agent types; 5 flagged for overconfidence (see Known limitations). Architecture ┌──────────────────────────┐ ticker ──────► │ Orchestrator │ │ (asyncio.gather) │ └──┬──┬──┬──┬──────────────┘ │ │ │ │ (parallel) ┌─────────────┘ │ │ └─────────────┐ ▼ ▼ ▼ ▼ ┌────────────┐ ┌──────────┐ ┌──────────┐ ┌───────────┐ │Fundamental │ │Technical │ │Sentiment │ │ Macro │ │ Analyst │ │ Analyst │ │ Analyst │ │ Analyst │ │ │ │ │ │ │ │ │ │PE, growth, │ │RSI, MACD,│ │news, │ │GDP, rates,│ │margins, │ │golden │ │social, │ │inflation, │ │D/E ratio │ │cross │ │insider │ │sector │ └─────┬──────┘ └────┬─────┘ └────┬─────┘ └─────┬─────┘ └──────────────┴──────────────┴──────────────┘ │ ▼ AgentThesis × 4 ┌──────────────────────┐ │ Portfolio Manager │ │ confidence-weighted │ │ signal synthesis │ └──────────┬───────────┘ │ PortfolioDecision ▼ ┌──────────────────────┐ │ Risk Manager │ │ veto / downgrade │ │ • conf < 45% → veto │ │ • spread ≥ 4 → veto │ │ • conf < 65% → │ │ downgrade STRONG │ └──────────┬───────────┘ │ FinalDecision ▼ approved / vetoed How it works Fundamental Analyst fetches valuation metrics (PE ratio, revenue growth, profit margin, debt-to-equity) and scores them against thresholds. A PE below 15 adds a bullish vote; above 30 adds a bearish one. Revenue growth above 15% or profit margins above 20% each add a bullish vote. The raw score maps to a STRONG_BUY / BUY / HOLD / SELL / STRONG_SELL signal with confidence proportional to conviction strength. Technical Analyst evaluates SMA crossovers (20d and 50d), MACD histogram direction, and optionally a golden-cross flag. Each indicator votes +1 or −1, with a dead band to suppress spurious signals on flat prices. In the backtest harness, the rule-based TechnicalSignalAgent uses realized momentum over 20d and 50d rolling windows against yfinance price data. Sentiment Analyst aggregates a news sentiment score (−1 to +1) and a social sentiment score, averages them, then applies an insider-buying bonus. Outputs a directional signal and a confidence value dampened for near-neutral sentiment. Macro Analyst checks GDP growth, the Fed Funds rate, inflation, and a sector outlook tag. Favorable macro conditions (growth > 2.5%, rate < 4%, inflation < 3%, bullish sector) each add a bullish vote; unfavorable conditions subtract. The macro signal acts as a regime filter — a strong bearish macro can offset bullish technical or sentiment readings. Portfolio Manager synthesizes the four theses using a confidence-weighted average of their numeric signal scores. Consensus penalty: confidence is scaled down by the spread between the highest and lowest agent signals (conf × max(0.5, 1 − spread × 0.1)). A tight consensus stays near full confidence; a 4-point spread (STRONG_BUY vs STRONG_SELL) h

View this page on Coderz Club