9 ML models. Adversarial debate. One-click execution.
Don't guess the market. Let AI argue about it first.
Live Demo · Presentation · Evaluation Report · 中文
Most AI trading projects: feed data into a model, get a signal, done.
Orallexa runs a multi-agent intelligence pipeline. 4 AI analysts with different risk profiles debate the trade. A 20-agent swarm simulates market reactions. 5 independent signal sources vote. A bias tracker corrects the system's own mistakes. Then it executes.
Market Data → 9 ML Models → 4-Role Panel + Bull/Bear Debate
→ 5-Source Signal Fusion → Judge Verdict → What-If Scenarios
→ Risk Plan → Paper Execution → Dashboard → Social Content
Every stage automated. Every stage observable. The system learns from itself.
Open Live Demo — demo mode, no API key needed. Click NVDA, TSLA, or QQQ to see a full analysis.
Or run locally:
git clone https://github.com/alex-jb/orallexa-ai-trading-agent.git
cd orallexa-ai-trading-agent
pip install -r requirements.txt
echo "ANTHROPIC_API_KEY=your_key" > .env
# Terminal 1: API
python api_server.py
# Terminal 2: UI
cd orallexa-ui && npm install && npm run devDocker: docker compose up --build — that's it.
| Strategy | Ticker | OOS Sharpe | Verdict | p-value |
|---|---|---|---|---|
| rsi_reversal | INTC | 1.41 | PASS | 0.002 |
| dual_thrust | NVDA | 0.96 | PASS | 0.001 |
| alpha_combo | NVDA | 0.92 | PASS | 0.016 |
| macd_crossover | NVDA | 0.91 | PASS | 0.003 |
| ensemble_vote | NVDA | 0.90 | PASS | 0.001 |
| trend_momentum | NVDA | 0.74 | PASS | 0.005 |
| double_ma | GOOG | 0.64 | PASS | 0.049 |
| ensemble_vote | META | 0.31 | MARGINAL | 0.324 |
90 strategy-ticker pairs across 10 tickers and 9 strategies (including ensemble vote and regime-aware ensemble). 1 STRONG PASS, 7 PASS, 33 MARGINAL. Full report →
|
|
What one NVDA analysis produces:
┌─────────────────────────────────────────────────────────────────┐
│ DECISION: BUY Confidence: 68% │
│ Risk: MEDIUM Signal: 72/100 │
├─────────────────────────────────────────────────────────────────┤
│ │
│ BULL CASE: │
│ • Price above MA20 > MA50 — full bullish alignment │
│ • RSI at 62 — strong momentum, not yet overbought │
│ • Volume 1.8x average — institutional participation likely │
│ │
│ BEAR CASE: │
│ • ADX at 32 but declining — trend may be exhausting │
│ • Bollinger %B at 0.85 — extended near upper band │
│ • Earnings in 12 days — vol crush after event │
│ │
│ JUDGE VERDICT: │
│ "Bull case is stronger. BUY with tight stop at MA20." │
│ │
│ PROBABILITIES: Up 58% | Neutral 24% | Down 18% │
│ RISK PLAN: │
│ Entry: $132.50 | Stop: $128.40 | Target: $141.00 | R:R 2.1:1 │
└─────────────────────────────────────────────────────────────────┘
Not just a number. A structured argument with transparent reasoning and an actionable risk plan.
Every analysis runs all available models. The ML Scoreboard shows Sharpe, return, win rate side by side.
| Model | Type | What It Does |
|---|---|---|
| Random Forest | Classification | 28 technical features → 5-day direction |
| XGBoost | Gradient Boosting | Same features, different optimization |
| Logistic Regression | Linear | Regularized baseline |
| EMAformer | Transformer | iTransformer + Embedding Armor (AAAI 2026) |
| MOIRAI-2 | Foundation | Salesforce zero-shot time series forecaster |
| Chronos-2 | Foundation | Amazon T5-based probabilistic forecaster |
| DDPM Diffusion | Generative | 50 possible price paths → VaR and confidence intervals |
| PPO RL Agent | Reinforcement | Gymnasium env, Sharpe-based reward |
| GNN (GAT) | Graph | 17-stock relationship graph, inter-stock signal propagation |
All models run on CPU.
Signal View — Decision card, probability bars, Bull/Bear debate, ML scoreboard, risk plan.
Intel View — Morning brief, gainers/losers, sector heatmap, volume spikes, AI picks, social thread.
Art Deco theme. Polymarket-inspired probability display. Mobile responsive. EN/ZH bilingual.
A floating pixel bull that lives on your desktop:
- Voice chat — Hold K to talk, Whisper transcribes, Claude responds
- Chart analysis — Ctrl+Shift+S screenshots any chart for Claude Vision analysis
- Decision cards — Entry, stop, target, risk/reward overlaid on screen
- Market-aware avatar — Bull changes color based on market conditions
Not every task needs the expensive model:
| Task | Model | Cost |
|---|---|---|
| Bull/Bear arguments | Haiku 4.5 | ~$0.001 |
| 4-Role perspective panel | Haiku 4.5 | ~$0.002 |
| Judge verdict | Sonnet 4.6 | ~$0.005 |
| Deep market report | Sonnet 4.6 | ~$0.005 |
| What-if scenario | Sonnet 4.6 | ~$0.005 |
| Signal fusion + swarm | Local (no LLM) | $0 |
| Bias tracking | Local (no LLM) | $0 |
One full analysis: ~$0.005. One daily intel report: ~$0.05.
Two patterns from this repo have been extracted as standalone Python packages + Claude Code skills:
- claude-tier-router — the Haiku/Sonnet dual-tier routing (
pip install claude-tier-router)- claude-debate — the Bull/Bear/Judge adversarial decision pattern, generalized (
pip install claude-debate)
| Problem | Typical Approach | Orallexa |
|---|---|---|
| Isolated signals | One model, one prediction | 5 sources fused: technical + ML + news + options + institutional |
| No reasoning | "BUY 73%" — why? | 4 analysts debate, Bull/Bear argue, Judge decides with evidence |
| No self-correction | Same mistakes repeated | Bias tracker detects overconfidence, auto-adjusts future calls |
| Static analysis | Can't test hypotheticals | "What if Fed hikes 50bp?" — scenario simulation with swarm |
| Expensive AI | Every call hits GPT-4 | Haiku for 80%, Sonnet only where reasoning matters |
| Manual workflow | Notebook → read → decide → execute | Automated: signal → debate → risk plan → paper order |
| No context | Each stock analyzed alone | GNN propagates signals across 17 related stocks |
| Not shareable | Screenshot your terminal | "Copy for X" on every section |
Inspired by ai-hedge-fund. We share the multi-agent philosophy but take different approaches:
| Feature | ai-hedge-fund | Orallexa |
|---|---|---|
| ML Models | 0 (LLM-only) | 9 (RF, XGB, EMAformer, MOIRAI-2, Chronos-2, DDPM, PPO RL, GNN, LR) |
| Model Ranking | No | Auto-ranked by Sharpe ratio |
| LLM Providers | OpenAI, Groq, Anthropic, DeepSeek | Claude Sonnet + Haiku (dual-tier routing) |
| Cost per Analysis | ~$0.03+ (single-tier) | ~$0.003 (80% Haiku, 20% Sonnet) |
| Real-time Dashboard | Basic web UI | Next.js 16 with WebSocket, Art Deco theme |
| Paper Trading | No execution | Alpaca bracket orders (stop-loss + take-profit) |
| Daily Intelligence | No | 50+ tickers, sector rotation, AI morning brief |
| Desktop Assistant | No | Pixel bull with voice (Whisper + TTS) |
| Social Content | No | One-click "Copy for X" on every section |
| Walk-Forward Eval | No | 70 strategy-ticker pairs, OOS Sharpe |
| Tests | Limited | 698 automated (261 frontend + 437 backend) |
| Bilingual | No | EN/ZH |
| Frontend | Next.js 16, React 19, Tailwind CSS 4, PWA |
| Backend | FastAPI, Python 3.11, WebSocket |
| AI | Claude Sonnet 4.6 + Haiku 4.5 (dual-tier routing) |
| ML | scikit-learn, XGBoost, PyTorch (EMAformer, DDPM, GAT, PPO) |
| Data | yfinance (real-time + historical) |
| NLP | FinBERT, VADER, TextBlob |
| Trading | Alpaca paper trading (bracket orders) |
| Orchestration | LangGraph (stateful debate pipeline) |
| Deploy | Docker, GitHub Actions CI/CD, Vercel |
698 automated tests. 0 failures. CI on every push.
python -m pytest tests/ -v # Backend (390 tests)
cd orallexa-ui && npm test # Frontend (245 unit tests)
cd orallexa-ui && npm run test:coverage # Frontend with coverage
cd orallexa-ui && npx playwright test # E2E (16+ specs)Full test breakdown
| Suite | Tests | Coverage |
|---|---|---|
| Engine Core | 62 | Backtest, 9 strategies, market analyst |
| Engine Integration | 34 | TA indicators, strategies, backtest, brain routing |
| ML/RL Signals | 20 | Feature extraction, RL env, PPO trainer |
| ML Regression | 13 | All 9 models — ensures upgrades don't degrade |
| API E2E | 19 | Every endpoint via FastAPI TestClient |
| Unit Tests | 47 | DecisionOutput, BehaviorMemory, risk, scalping |
| Desktop Agent | 30 | Intent detection, ticker/mode/TF extraction |
| Daily Intel | 10 | Price fetch, constants, cache path |
| Backend Other | 67 | Monte Carlo, walk-forward, regime, ensemble, statistics |
| Backend Misc | 88 | Param optimizer, strategy evolver, breaking signals |
| UI Components | 245 | All 14 component suites + hooks + mock data |
| Playwright E2E | 16+ | Dashboard, components, responsive, offline |
| Total | 635 | 437 backend + 245 frontend |
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/analyze |
Fast signal analysis (scalp/intraday/swing) |
POST |
/api/deep-analysis |
Multi-agent deep analysis with debate |
POST |
/api/chart-analysis |
Screenshot chart analysis (Claude Vision) |
POST |
/api/watchlist-scan |
Parallel multi-ticker scan |
GET |
/api/daily-intel |
Daily market intelligence (cached) |
GET |
/api/news/{ticker} |
News + sentiment scores |
GET |
/api/profile |
Trader behavior profile |
GET |
/api/journal |
Decision execution log |
POST |
/api/scenario |
What-if scenario simulation |
GET |
/api/bias-profile |
Prediction bias analysis |
GET |
/api/role-memory |
Role learning progress |
POST |
/api/swarm-sim |
Agent swarm simulation |
POST |
/api/evolve-strategies |
LLM strategy evolution |
GET |
/api/alpaca/account |
Paper trading account |
POST |
/api/alpaca/execute |
Execute signal as paper order |
WS |
/ws/live |
Real-time price + signal stream |
This repo includes .claude/skills/ — drop the folder into any Claude Code project and the agent learns these patterns automatically:
.claude/skills/tier-router/— route Haiku for structured, Sonnet for reasoning (standalone).claude/skills/adversarial-debate/— Advocate/Critic/Judge over any decision (standalone)
Both skills are self-contained: copy the folder, no install needed.
Directory layout
orallexa/
├── api_server.py # FastAPI + WebSocket server
├── docker-compose.yml # One-click deployment
│
├── engine/ # Trading engine (9 models + intelligence)
│ ├── multi_agent_analysis.py # Multi-agent pipeline (debate + panel + fusion)
│ ├── signal_fusion.py # 5-source signal fusion (tech/ML/news/options/institutional)
│ ├── scenario_sim.py # What-if scenario simulation
│ ├── bias_tracker.py # Prediction bias self-correction
│ ├── role_memory.py # Persistent role memory & learning
│ ├── micro_swarm.py # 20-agent Monte Carlo swarm
│ ├── ml_signal.py # Model comparison framework
│ ├── strategies.py # 7 rule-based strategies
│ ├── emaformer.py # EMAformer Transformer
│ ├── diffusion_signal.py # DDPM probabilistic forecasting
│ ├── gnn_signal.py # Graph Attention Network
│ ├── rl_agent.py # PPO reinforcement learning
│ ├── strategy_evolver.py # LLM strategy evolution
│ └── sentiment.py # FinBERT / VADER
│
├── llm/ # AI reasoning
│ ├── claude_client.py # Dual-tier model routing
│ ├── debate.py # Bull/Bear debate (with bias injection)
│ └── perspective_panel.py # 4-role analyst panel with memory
│
├── orallexa-ui/ # Dashboard (Next.js 16)
│ ├── app/components/ # 11 UI components
│ ├── app/__tests__/ # 200 unit tests (vitest)
│ └── e2e/ # 14 E2E tests (Playwright)
├── desktop_agent/ # Desktop AI coach
├── bot/ # Execution layer (Alpaca)
├── tests/ # ~180 backend tests
└── .github/workflows/ # CI/CD (lint, test, build, E2E)
Anthropic Claude · yfinance · Polymarket · Alpaca
MIT License — see LICENSE
Disclaimer: Research and educational project. Not financial advice.
Built with conviction, not hype.
