Documentation
Learn how to leverage LocalAlpha to visualize, analyze, and optimize your LEAN backtests without leaving your desktop.
Installation
LocalAlpha is a standalone binary. It includes a bundled Python environment for analytics, so you don't need to manage `pip` dependencies manually.
- • macOS 12+ (Apple Silicon or Intel)
- • Windows 10/11 (WSL2 optional)
- • Linux (Debian/Ubuntu 20.04+)
- • 4GB RAM minimum (8GB recommended for large logs)
Privacy-First Architecture
Unlike web-based dashboards, LocalAlpha runs 100% on your machine.
- Frontend (Tauri)Renders charts using Rust-native webview. No browser telemetry.
- Analytics (Python Sidecar)A spawned subprocess handles number crunching using Pandas and QuantStats. It accepts inputs only from localhost.
Ingesting Results
LocalAlpha reads the standard `result.json` generated by the LEAN CLI.
Method 1: Drag & Drop
Simply drag your `result.json` file anywhere onto the application window. The dashboard will instantly parse:
- Equity Curve points
- Order Events
- Runtime Statistics
- Log messages
Auto-Watch Mode
For a seamless "Code → Backtest → Analyze" loop, configure Auto-Watch.
- Open Settings (Gear Icon).
- Under "Watch Folder", select your LEAN CLI output directory (usually `./backtests`).
- Toggle Enable Auto-Watch.
Reality Check (Reconciliation)
Verify that your live trading matches your backtests. This tool performs fuzzy matching between two `result.json` files (e.g., a Backtest vs. Live Trading result).
How it works
Upload two files. LocalAlpha will match trades based on Symbol, Quantity, and Entry Time (within a configurable tolerance window).
- • Slippage Analysis: Calculates the difference in execution price between simulated and live orders.
- • Latency: Measures the time delay between expected entry/exit and actual execution.
- • Missing Trades: Highlights orders that occurred in backtest but failed in live (or vice versa).
Core Metrics
We use the industry-standard QuantStats Python library to verify LEAN's summary statistics.
Sharpe & Sortino
Calculated using daily returns (resampled from your equity curve).
• Sharpe: Excess return per unit of total volatility.
• Sortino: Excess return per unit of downside volatility.
Probabilistic Sharpe Ratio (PSR)
We calculate the Probabilistic Sharpe Ratio to estimate the probability that your strategy's performance is not due to luck (false discoveries), adjusting for skewness and kurtosis.
Analysis Visualizations
LocalAlpha provides over 40 multidimensional visualizations to audit your strategy's DNA.
Risk & Efficiency
Trade Dynamics
Timing & Seasonality
Asset-Level Performance
Stability & Rolling Stats
Monte Carlo Simulation
Stress-test your strategy by shuffling the order of your trades.
Methodology
We perform 1,000 simulations by randomly shuffling your realized trade P&L values (without replacement). This preserves the distribution of returns but destroys the sequence.
- • 95th Percentile: Optimistic outcome (Lucky sequence)
- • 50th Percentile: Median outcome (Expected performance)
- • 5th Percentile: Pessimistic outcome (Unlucky sequence - "Risk of Ruin")
Log Explorer
Debug complex strategies with a virtualized log viewer capable of handling gigabytes of text.
Search Syntax
Strategy Optimization
Visualizing parameter stability is crucial to avoid overfitting. LocalAlpha allows you to ingest optimization CSV results and visualize them as heatmaps.
Optimization Heatmaps
Upload your optimization CSV file to visualize the relationship between parameters (e.g., Lookback Period, Threshold) and performance metrics (Sharpe Ratio, Net Profit).
- • Robustness Zones: Identify broad areas of profitability rather than single isolated peaks (which indicate overfitting).
- • Parameter Sensitivity: See how sensitive your strategy is to small changes in parameter values.
Portfolio & Attribution
Analyze multiple strategies simultaneously and decompose their drivers of return.
Portfolio Correlation
Upload multiple backtests to create a "Fund Manager" view.
- • Correlation Matrix: View Pearson correlation coefficients between strategies to assess diversification benefits.
- • Combined Equity: See the weighted performance of your entire portfolio of algorithms.
Drivers of Return (Attribution)
Decompose your strategy's returns to understand why it made money.
- • Long/Short Attribution: Split performance by side.
- • Sector Exposure: Visual breakdown of trade concentration by industry sector.
- • Rolling Beta: Monitor your strategy's market sensitivity over time.