AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Backtest Strategy

skill-qunyou-agent-finance-skills-backtest-strategy · by qunyou-agent

Runs backtests on trading strategies using historical market data. Calculates performance metrics including Sharpe ratio, maximum drawdown, win rate, total return, and generates equity curves. Trigger when the user requests backtesting, strategy simulation, or performance evaluation.

No reviews yet
0 installs
37 views
0.0% view→install

Install

$ agentstack add skill-qunyou-agent-finance-skills-backtest-strategy

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-qunyou-agent-finance-skills-backtest-strategy)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Backtest Strategy? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Backtest Strategy

Runs backtests on trading strategies and provides performance analysis.

Real Code Reference

  • tradinglearn/backtest/backtester.pyBacktester class: run_backtest(data, strategy_class, strategy_params), get_performance(), plot_results()
  • tradinglearn/strategies/macd_strategy.pyMACDStrategy with generate_signals(data) → positions
  • tradinglearn/pytdx2/backtest.pyBacktestEngine + BacktestConfig + BaseStrategy
  • tradinglearn/utils/parameter_optimizer.pyParameterOptimizer.optimize_macd_parameters()

Architecture

DataLoader → Strategy signals → Portfolio tracking → Metrics calculation → Report
  1. DataLoader — fetch historical K-line via data_fetcher.fetch_stock_data(ticker, start, end)
  2. Strategy — generate buy/sell signals per bar (MACDStrategy(fast, slow, signal))
  3. Backtesterrun_backtest(data, MACDStrategy, params) iterates bars, tracks positions
  4. Metricsget_performance() returns Sharpe, max drawdown, win rate, total return, CAGR
  5. Plotplot_results() shows price vs portfolio value overlay

Usage

from backtest.backtester import Backtester
from strategies.macd_strategy import MACDStrategy
from utils.data_fetcher import fetch_stock_data

data = fetch_stock_data("000001", start_date="2024-01-01", end_date="2025-01-01")
bt = Backtester(initial_capital=100000.0, transaction_cost=0.001)
bt.run_backtest(data, MACDStrategy, {"fast_period": 12, "slow_period": 26, "signal_period": 9})
bt.generate_detailed_report()
bt.plot_results()

Key Checks

  • No lookahead bias — signal at bar t uses only data up to bar t
  • Out-of-sample validation separate from parameter optimization
  • Account for transaction costs (commission + slippage)
  • Handle corporate actions (splits, dividends) in price data

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.