A desktop application for statistical scenario analysis of financial markets.
Built with Python, React, and Electron.
[Screenshots placeholder – will be added after MVP]
Retrocast is not a backtester. It's a statistical scenario analyzer.
Instead of testing a full trading strategy with entries, exits, and position sizing, Retrocast answers probabilistic questions about market behavior:
"In what percentage of cases was SPY trading 10% lower after 30 days, when it was above its 200-day moving average?"
"When AAPL's RSI(14) crossed above 30, how often was the stock 5% higher after 60 days?"
You define conditions (technical indicator-based rules) and targets (what to measure N days later). Retrocast scans years of historical data, finds every occurrence matching your conditions, and computes detailed statistics on what happened next.
- 📊 Configurable Scenarios – Combine multiple technical indicators with AND/OR logic
- 📈 17+ Technical Indicators – SMA, EMA, RSI, Bollinger Bands, MACD, ATR, ADX, Stochastic, and more
- 🎯 Multiple Targets – Measure forward returns at different time horizons simultaneously (10d, 30d, 60d, 90d...)
- 📉 Interactive Charts – TradingView-quality charts with signal markers and indicator overlays
- 📋 Detailed Statistics – Hit rates, distributions, percentiles, averages, standard deviation
- 📁 Multiple Data Sources – Yahoo Finance, CSV files, Norgate Data
- 💾 Export Results – CSV and Excel export
- 🖥️ Desktop App – Native Windows application with Start Menu shortcut
CREATE a Scenario ├── Pick an underlying (e.g., SPY) ├── Define conditions (e.g., Close > SMA(200) AND RSI(14) > 50) └── Set targets (e.g., "30 days later, 10% lower?")
RUN the Analysis ├── Retrocast scans all historical data ├── Finds every date matching your conditions └── Measures what happened N days after each signal
REVIEW the Results ├── Hit rate: 73.2% of signals matched the target ├── Distribution chart of all forward returns ├── Click any signal to see it on a chart └── Export everything to CSV/Excel
Screenshots will be added after MVP completion
- Node.js 18 or higher
- Python 3.11 or higher
- pip (comes with Python)
- (Optional) Norgate Data subscription with NDU installed
# Clone the repository
git clone https://github.com/YOUR_USERNAME/retrocast.git
cd retrocast
# Install Node dependencies (also installs frontend deps)
npm install
# Install Python dependencies
cd backend
pip install -r requirements.txt
cd ..
# Configure environment
cp .env.example .env
# Edit .env if needed (defaults work out of the box)npm run devThis single command starts:
- 🐍 Python backend on http://localhost:8000
- ⚛️ React frontend on http://localhost:5173
- 🖥️ Electron window loading the frontend
# Full build (frontend + Python executable + Electron installer)
npm run build:fullThe installer will be created in dist-electron/.
Double-click Retrocast-Setup-x.x.x.exe to install.
retrocast/
├── backend/ # Python FastAPI backend
│ ├── app/
│ │ ├── api/ # REST API endpoints
│ │ ├── core/ # Analysis engine, indicators, conditions
│ │ ├── models/ # Pydantic data models
│ │ └── db/ # SQLite database layer
│ └── tests/ # Backend tests
├── frontend/ # React TypeScript frontend
│ └── src/
│ ├── components/ # UI components
│ ├── hooks/ # Custom React hooks
│ ├── services/ # API client
│ └── types/ # TypeScript type definitions
├── electron/ # Electron desktop shell
├── .agent/ # AI agent governance files
└── docs/ # Progress tracking & documentation
No setup required. Just enter a ticker symbol (e.g., SPY, AAPL, BTC-USD).
Data is fetched automatically via the yfinance library.
Place CSV files in the data/csv/ directory. Expected format:
Date,Open,High,Low,Close,Volume
2024-01-02,472.65,473.53,468.37,472.65,52345600The date column is auto-detected. Column names are flexible.
If you have a Norgate Data subscription:
- Install Norgate Data Updater (NDU) and keep it running
- Install the Python package:
pip install norgatedata - Select "Norgate" as data source when creating a scenario
| Category | Indicators |
|---|---|
| Trend | SMA, EMA, ADX |
| Momentum | RSI, MACD, MACD Signal, MACD Histogram, Stochastic %K/%D |
| Volatility | Bollinger Bands (Upper/Middle/Lower), ATR |
| Price | Price Change %, Highest High, Lowest Low |
| Volume | Volume Ratio (vs. moving average) |
| Operator | Description | Example |
|---|---|---|
| Above | Value is greater than reference | Close > SMA(200) |
| Below | Value is less than reference | RSI(14) < 30 |
| Crosses Above | Was below, now above | SMA(50) crosses above SMA(200) |
| Crosses Below | Was above, now below | Close crosses below BBANDS Lower |
Conditions can be combined with AND / OR logic.
| Layer | Technology |
|---|---|
| Backend | Python 3.11, FastAPI, pandas, pandas-ta, yfinance, SQLite |
| Frontend | React 18, TypeScript, Vite, TailwindCSS, shadcn/ui, TradingView Lightweight Charts, TanStack Table, Recharts |
| Desktop | Electron 33, electron-builder |
All configuration is done via the .env file:
DB_PATH=./data/scenarios.db # SQLite database location
DATA_DIR=./data # General data directory
CSV_IMPORT_DIR=./data/csv # Where to place CSV files
HOST=127.0.0.1 # Backend host
PORT=8000 # Backend portThis project is primarily developed using AI-assisted coding (Antigravity). If you'd like to contribute:
- Check
docs/PROGRESS.mdfor current status - Check
docs/BACKLOG.mdfor planned features - Read
.agent/workflows/new-agent-onboarding.mdfor development guidelines
MIT License – see LICENSE for details.