backtest-center

Runs Qlib backtests, compares strategies, and optimizes parameters via QuantMind APIs.

1.5k|337|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/qusong0627/QuantMind --skill backtest-center-qusong0627
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backtest-center
Source: https://github.com/qusong0627/QuantMind/tree/main/skills/backtest-center
Command: npx skills add https://github.com/qusong0627/QuantMind --skill backtest-center-qusong0627

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Quantitative researchers need to validate trading strategies against historical data, compare model performance, and tune parameters without manually wiring Qlib engine calls, authentication, and result polling across multiple API endpoints. ## Core Features & Use Cases - Backtest Execution: Submit single, rolling, inference, and vectorized Qlib backtests through the /api/v1/qlib/* endpoints with automatic environment detection between QuantBot containers and local hosts. - Strategy Comparison & Parameter Optimization: Compare two backtest results side-by-side and run genetic-algorithm parameter searches over ranges like topk and rebalance period. - Advanced Analysis & Reporting: Generate risk metrics, performance attribution, trade statistics, style attribution, and export results as CSV, PDF, or Excel reports. - Use Case: A researcher asks to backtest a TopkDropout strategy on CSI 300 for 2024, then optimize its topk parameter and export a PDF report of the best configuration. ## Quick Start Ask the assistant to run a Qlib backtest of a chosen strategy or model over a specific date range and then show the risk metrics and analysis results.

Frequently Asked Questions about backtest-center

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Qlib backtest through an API?

Authenticate against /api/v1/auth/login to get a bearer token, then POST a backtest request to /api/v1/qlib/backtest with strategy_id or strategy content, date range, capital, and benchmark. Poll /api/v1/qlib/results/{backtest_id}/status until completion.

How to optimize trading strategy parameters with a genetic algorithm?

Submit parameter ranges to /api/v1/qlib/optimize or /api/v1/qlib/optimize/genetic with generations and population_size settings. The endpoint returns an optimization_id used to query results and optimization history.

What is the vectorized backtest mode in Qlib?

Setting use_vectorized to true triggers a pandas matrix-based engine that reduces full-market yearly backtests from hundreds of seconds to seconds or minutes. A safety gate automatically falls back to step mode for strategies with weighting, stop-loss, or custom classes.

Why does my backtest return no results?

Empty results usually mean the date range contains no trading days or the job failed. Verify available dates via /api/v1/admin/models/backtest/trading-dates and inspect /api/v1/qlib/logs/{backtest_id} for errors.

Can I compare multiple models in one backtest run?

The multi-horizon comparison endpoint was removed in 2026-09. Instead, run separate backtests per model or strategy and compare results pairwise using /api/v1/qlib/compare/{id1}/{id2}.

How do I export backtest reports as PDF or Excel?

Call /api/v1/qlib/export/{backtest_id}/pdf, /csv, or /excel with your auth token to download the report. The backtest_id must reference a completed run with full results, otherwise the export fails.