Coding

Strategy Backtester

Try it

Validates historical behavior of stock ranking, factor, and portfolio-selection strategies using reproducible backtests, benchmark comparison, turnover, draw...

What it does

Validates historical behavior of stock ranking, factor, and portfolio-selection strategies using reproducible backtests, benchmark comparison, turnover, draw...

The skill document

Strategy Backtester

Purpose

Use this skill to test whether a ranking, factor mix, or portfolio-selection rule had useful historical behavior before treating it as an investment signal.

Scope

  • Equity ranking and selection strategies.
  • Periodic rebalance backtests from local CSV inputs.
  • Benchmark comparison when benchmark data is available.
  • Bias and robustness review.

Non-goals

  • Do not claim that historical performance predicts future returns.
  • Do not optimize parameters until a preferred result appears.
  • Do not issue absolute buy/sell instructions.
  • Do not fetch live market data.

Input contract

Required inputs:

  • SIGNAL_CSV: rows with date, ticker, and score.
  • PRICE_CSV: rows with date, ticker, and close.
  • REBALANCE_FREQUENCY: monthly, quarterly, or yearly.
  • TOP_N: number of selected names per rebalance.

Optional inputs:

  • BENCHMARK_CSV: rows with date and close or return.
  • FEE_BPS: round-trip fee assumption in basis points.
  • SLIPPAGE_BPS: slippage assumption in basis points.
  • UNIVERSE_HISTORY: point-in-time membership if available.

Execution workflow

  1. Validate input files and required columns.
  2. Estimate whether the test window and symbol coverage are sufficient.
  3. Run scripts/backtest_strategy.py with explicit rebalance, fee, slippage, and top-N assumptions.
  4. Review performance metrics and benchmark comparison.
  5. Identify bias risks and robustness gaps.
  6. Return the required output sections.

Required output format

  1. Backtest Setup
  • Strategy name, test window, rebalance frequency, top-N, fees, slippage, benchmark.
  1. Performance Summary
  • Total return, CAGR, volatility, max drawdown, Sharpe, Sortino, turnover, hit rate when available.
  1. Benchmark Comparison
  • Relative return, relative drawdown, and tracking observations when benchmark data exists.
  1. Robustness and Bias Warnings
  • Survivorship bias, lookahead bias, data-snooping risk, liquidity assumptions, fee/slippage sensitivity.
  1. Confidence and Data Gaps
  • Confidence level and missing inputs that could change the conclusion.
  1. Handoff Bundle
  • Include strategy_name, test_window, rebalance_frequency, fee_assumption, slippage_assumption, benchmark, metrics, bias_warnings, confidence, and data_gaps.

Shared confidence rubric

  • High: point-in-time signals, adequate price coverage, benchmark available, fees/slippage included, and test window covers multiple market regimes.
  • Medium: usable history and price coverage, but one major robustness input is missing.
  • Low: short history, missing benchmark, sparse price coverage, likely survivorship/lookahead risk, or no fee/slippage assumptions.

Guardrails

  • Separate observed backtest results from assumptions and inference.
  • Always state that backtests are historical simulations, not forecasts.
  • Downgrade confidence if the test appears overfit or data is not point-in-time.
  • Treat backtest output as one input to stock-picker-orchestrator, not as a trading command.

Trigger examples

  • "Backtest this VN30 value-quality ranking."
  • "Check whether this stock ranking strategy beat VNINDEX historically."
  • "Validate this screening rule before using it for shortlist selection."

Related skills

Backtest stock trading strategies on historical OHLCV data and report win rate, return, CAGR, drawdown, Sharpe ratio, and trade logs. Use when evaluating or...

40 installs1 stars

Run long-only backtests on daily stock OHLCV CSVs and get standardized performance metrics plus a trade log.

167 installs3 stars

股票深度回测(Stock Deep Backtest)技能 —— 基于 QuantAll(全A解析)MCP, 对"已回测的策略"做深度诊断:策略为什么有效/失效、最终在哪儿赚钱、能否用入场因子筛选改善。 三层能力:① 四个回测视角(summary 成绩单 / detail 横截面 / segments 持仓片段 / timeline 时序净值); ② 原生分组(行业/市值/交易所/时间 + 热力图);③ 因子筛选改善(单/双/多因子 → 片段收益对比)。 固定调用指令已固化为 tasks/*.json,run_task_file 可直接执行;深度分析由 scripts/ 脚本完成; 一键完整链

Backtest dollar-cost averaging (DCA) against lump-sum investing on any coin's real historical price data, using the free CoinGecko market_chart API (no API key required, up to 365 days of daily history). Built for crypto traders and passive-income investors deciding between DCA and lump-sum entry strategies before committing capital. Simulates weekly contributions and compares final portfolio value, invested capital, and percent return against a lump-sum baseline of the same total capital deployed on day one. Complements trading, whale-tracking, and DeFi yield skills by covering the entry-strategy decision, which is distinct from picking what to buy or where to farm yield.

1 installs

回测分析工具。从交易记录CSV计算回测核心指标: 胜率、盈亏比、最大回撤、夏普比率、获利因子、 最佳/最差单笔交易。支持JSON报告导出。 Use when: 需要评估交易策略表现、分析回测结果、 计算策略风险指标、对比不同策略。 🎉 v1.0.0 指标: - 总交易数 / 盈利交易 / 亏损交易 - 胜率 / 盈亏比 / 获利因子 - 总收益率 / 平均每笔收益 - 最大回撤 / 夏普比率 - 最佳/最差单笔交易 触发关键词:回测分析、策略评估、量化交易、交易统计 适用范围:CSV 交易记录 运行模式:纯本地

2 installs

Use when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count thresholds, exit-reason mix, paramete...