Einstein Research — Backtest Engine
Programmatic backtesting framework for trading strategies. Runs backtests with historical price data (yfinance or CSV), supports momentum/mean-reversion/factor/signal-based strategies, walk-forward optimization, out-of-sample testing, transaction cost modeling, regime-aware splits, and full performance metrics (Sharpe, Sortino, Calmar, max drawdown, CAGR, win rate, profit factor). Distinct from einstein-research-backtest (which provides methodology guidance). Use when a user wants to actually run a backtest, test a specific strategy on historical data, or generate performance metrics.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/clawdiri-ai/einstein-research-backtest-engine-dvWhat This Skill Does
The Einstein Research — Backtest Engine is a sophisticated, programmatic framework designed for quantitative trading analysis within the OpenClaw ecosystem. Unlike generic strategy platforms, this engine allows users to perform rigorous, rule-based simulations on historical market data using either yfinance or local CSV imports. It evaluates trading logic—ranging from momentum and mean-reversion to signal-based factor models—and provides actionable performance diagnostics. The engine excels at handling complex scenarios, including out-of-sample testing, walk-forward optimization, and transaction cost modeling, ensuring that strategy results reflect realistic market friction.
Installation
To integrate this engine into your local OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/clawdiri-ai/einstein-research-backtest-engine-dv
Ensure that your environment has internet access if you plan on fetching live historical data via yfinance, or ensure your local directory structure is correctly mapped if using CSV files.
Use Cases
- Strategy Validation: Verifying that a specific trading hypothesis (e.g., 'buy when volume spikes 2x and price hits 52-week high') actually yields profit in historical market regimes.
- Risk Profiling: Quantifying the risk-adjusted returns of a portfolio strategy using metrics like the Sortino, Calmar, and Sharpe ratios before deploying capital.
- Out-of-Sample Testing: Using the engine to test strategies against periods of data the model has never seen, a critical step to prevent overfitting.
- Automated Reporting: Quickly generating comprehensive JSON or Markdown performance reports for internal audit or strategy documentation.
Example Prompts
- "Run a backtest for my strategy defined in
momentum_v1.yamlusing S&P 500 data from 2020 to 2023 with a 0.05% transaction cost applied." - "Perform a walk-forward optimization on the trend-following strategy located in my project folder and generate the full performance metrics report."
- "Evaluate the performance of the mean-reversion strategy in
strategy.yaml. Split the data at 2022-06-01 to ensure out-of-sample validation."
Tips & Limitations
- Strategy Definitions: Ensure your
strategy.yamlfiles strictly follow thebacktest-engine/v1schema to avoid parsing errors during execution. - Overfitting: Be wary of excessive parameter optimization. Always utilize the out-of-sample split feature to ensure your strategy isn't just 'memorizing' past market noise.
- Costs: Always model transaction costs. Even a small fee can significantly degrade the perceived performance of high-frequency strategies.
- Data Quality: If using CSV files, ensure the time-series data is clean and contains no gaps, as the engine's day-by-day iteration depends on continuous date indexing.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-clawdiri-ai-einstein-research-backtest-engine-dv": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write, code-execution, external-api
Related Skills
Follow-Through Day (FTD) Detector
Detects Follow-Through Day (FTD) signals for market bottom confirmation using William O'Neil's methodology. Dual-index tracking (S&P 500 + NASDAQ) with state machine for rally attempt, FTD qualification, and post-FTD health monitoring. Use when user asks about market bottom signals, follow-through days, rally attempts, re-entry timing after corrections, or whether it's safe to increase equity exposure. Complementary to market-top-detector (defensive) - this skill is offensive (bottom confirmation).
Gumroad Page Generator
Generates Gumroad product page content from a simple spec.
Analytics Tracking
Track events and user behavior using Segment.
AutoSignals - Autonomous Trading Signal Optimization
Monitors and controls the AutoSignals autonomous research loop.
first-principles
Deep first-principles analysis of any topic, decision, strategy, or assumption. Strips inherited thinking, identifies what is provably true, and rebuilds from ground truth. Use when user asks for first principles analysis, wants to challenge assumptions, says "analyze this from scratch", "break this down", "what's really true here", or triggers with /firstprinciples. Also useful for strategic decisions, investment theses, product strategy, career moves, or any situation where conventional wisdom may be wrong.