Trading AI Platform
Real-Time Signal & Fundamental Intelligence Engine
A FastAPI platform that fuses real-time price, macro and news data into an ensemble prediction pipeline, a CALLS/PUTS decision engine, EDGAR XBRL fundamental analysis, automated thesis generation, backtesting and scheduled retraining.
Real-time
Prediction
Ensemble
Models
10-year
Fundamentals
Walk-forward
Backtesting
Business challenge
Market signals are buried in noisy, high-volume, multi-source data — prices, macro indicators, news and financial filings. Turning that into disciplined, testable trade signals requires a real pipeline, not a notebook.
What I built
I built a FastAPI /predict pipeline that ingests price data (yfinance), macro data (FRED) and news sentiment, engineers features, runs an ensemble model, and passes results to a decision engine that emits CALLS/PUTS signals with an assistive advisor. A separate EDGAR XBRL pipeline ingests 10 years of financial statements, computes ratios and forecasts, and generates thesis reports. Signals are persisted, outcomes tracked, and models retrained on a schedule.
Why it matters
A credible trading-intelligence tool has to combine short-horizon technical signals with long-horizon fundamentals, and it has to be honest about performance. That means rigorous backtesting, persistence of every signal, and feedback loops that track real outcomes — otherwise it's just a demo.
How it's designed
Interface
How the intelligence flows
- 01Ingest — yfinance prices, FRED macro series, and news sentiment.
- 02Feature engineering — technical, macro and sentiment features.
- 03Ensemble prediction — combine models for a robust signal.
- 04Decision engine — translate predictions into CALLS/PUTS with an assistive advisor.
- 05Fundamentals — EDGAR XBRL ingestion, 10-year statements, ratio calculations and forecasts.
- 06Thesis — automated thesis report generation per ticker.
- 07Feedback — persist signals, track trade outcomes, retrain on schedule.
How data is modeled
- SQLAlchemy models for signals, predictions, features and trade outcomes.
- Fundamentals store: filings, line items, computed ratios and forecasts.
- Signal persistence with timestamps for backtesting and outcome tracking.
- Versioned model + dataset references for reproducibility.
Key endpoints
/predictRun the real-time ensemble pipeline and return a CALLS/PUTS signal./fundamentals/{ticker}EDGAR XBRL statements, ratios and forecasts./thesis/{ticker}Automated investment thesis report./signalsPersisted signals with tracked trade outcomes./retrainTrigger scheduled model retraining.Technologies
Key features
- Real-time /predict pipeline with ensemble models.
- CALLS/PUTS decision engine with an assistive advisor.
- EDGAR XBRL ingestion with 10-year statements and ratios.
- Forecasting and automated thesis reports.
- Backtesting harness with feedback loops.
- Scheduled retraining automation.
- Streamlit dashboard for exploration.
Challenges & trade-offs
Avoiding overfitting
Walk-forward, out-of-sample backtesting kept results honest and prevented curve-fitting to history.
Fusing multi-source data
Prices, macro series, news and XBRL filings arrive on different cadences and shapes — the feature layer had to align them cleanly.
Closing the loop
Persisting signals and tracking real trade outcomes made scheduled retraining meaningful rather than cosmetic.
Code snippet
@app.post("/predict")
async def predict(req: PredictRequest) -> Signal:
prices = yfinance.history(req.ticker)
macro = fred.series(MACRO_SERIES)
news = sentiment.score(req.ticker)
features = engineer(prices, macro, news)
proba = ensemble.predict_proba(features) # multiple models
signal = decision_engine(proba) # CALLS / PUTS / HOLD
db.persist(Signal(ticker=req.ticker, **signal)) # tracked for outcomes
return signalHow it ships
- Containerized FastAPI service with reproducible environments.
- Scheduled jobs for ingestion, retraining and thesis generation.
- Streamlit dashboard for interactive analysis.
Security
- — Isolated research environment with access-controlled data.
- — Read-only market/data credentials scoped to ingestion.
Scalability
- — Vectorized batch processing for large historical datasets.
- — Decoupled ingestion, training and serving paths.
- — Signal persistence enables reprocessing without re-ingesting.