The official web-based simulation engine and dashboard for the Cthulhu Algorithmic Trading Framework.
This application serves as the frontend interface and client-side simulator for the Cthulhu Trading System. It allows quantitative traders to:
- Ingest Data: Upload CSV files containing OHLCV market data.
- Configure Strategies: Set parameters for Moving Average Crossover, Capital, Risk, and Execution settings.
- Run Simulations: Execute backtests locally in the browser using a high-performance TypeScript engine.
- Optimize Parameters: Perform grid-search optimization to find the best performing Moving Average periods.
- AI Analysis: Generate institutional-grade performance reports using Google Gemini 2.5 Flash.
- Broadcast Signals: Relay generated trade signals to external execution engines (MT5) via Webhooks.
- Client-Side Execution: Runs entirely in the browser (Zero-Latency).
- Vectorized-like Performance: Capable of processing thousands of candles in milliseconds (FAST mode).
- Execution Modeling: Simulates Commission and Slippage to provide realistic Net PnL.
- Ensemble Logic: Implements a Consensus Voting System running three parallel strategies (Core, Fast, Slow). Trades are taken only when the weighted vote confidence exceeds a user-defined threshold.
- ML / Risk Filter:
- Regime Detection: Uses RSI and Relative Volume to identify favorable market conditions.
- Dynamic Slippage: Models liquidity by adjusting slippage based on volume (High Vol = Low Slippage).
- Selection Policies: Supports
ARGMAX(Greedy) orSOFTMAX(Probabilistic) trade selection.
- Webhook Relay: Capability to broadcast specific trade signals to a configurable HTTP endpoint.
- Integration: Designed to connect with MetaTrader 5 (via Python Bridge) or other execution servers.
- Generative Reporting: Converts raw backtest metrics into a rich, styled HTML report.
- Scoring System: Automatically grades strategies (A+ to F) based on Sharpe Ratio and Risk-Adjusted Returns.
- Tactical Feedback: Provides specific, actionable recommendations to improve strategy parameters.
- Tech: Powered by
@google/genaiusing thegemini-2.5-flashmodel for high-speed inference.
- Grid Search: Automatically iterates through ranges of parameters.
- Fast MA: Start, End, Step.
- Slow MA: Start, End, Step.
- Objective Function: Optimizes for Profit Factor (Gross Profit / Gross Loss).
- Safety Mechanisms: Iteration capping (max 5000) to prevent browser UI freezing.
- Cinematic Dashboard: Full-width, dark-mode UI designed for high-resolution displays.
- Interactive Chart (D3.js):
- Dual-axis plotting (Price vs Equity).
- Trade Markers (Green = Buy, Red = Sell).
- Hover tooltips for trade details.
- Key Performance Indicators:
- Sharpe Ratio, Max Drawdown, Win Rate, Profit Factor.
To enable the AI features, you must provide your Google Gemini API Key via environment variables.
The app expects: process.env['API_KEY'].
To use the "Broadcast" feature:
- Go to the Execution tab.
- Select Data Source: MT5 Webhook Relay.
- Check Enable Outbound Signals.
- Enter the URL of your local execution server (e.g.,
http://localhost:8080/signal).
The application accepts CSV files. Ensure your data follows this schema:
Date,Open,High,Low,Close,Volume
2023-01-01 00:00,1.0500,1.0550,1.0490,1.0520,1000
2023-01-01 01:00,1.0520,1.0560,1.0510,1.0540,1500
...Note: The parser supports various date formats (ISO8601, etc).
- Framework: Angular 21+ (Zoneless, Signals)
- Language: TypeScript 5.2+
- Styling: Tailwind CSS (Dark Mode optimized)
- Charts: D3.js v7
- AI SDK:
@google/genai
Cthulhu Backtester Web Dashboard - v3.3