Install
openclaw skills install stock-strategy-backtesterBacktest stock trading strategies on historical OHLCV data and report win rate, return, CAGR, drawdown, Sharpe ratio, and trade logs. Use when evaluating or comparing strategy rules (SMA crossover, RSI mean reversion, breakout), quantifying transaction-cost impact, tuning parameters, or generating performance summaries from CSV data. Trigger for requests like "回测股票策略胜率", "测收益率", "compare two strategy backtests", and "build a strategy report from historical prices".
openclaw skills install stock-strategy-backtester1.0.0 and 1.0.1 are deprecated.1.0.2 or newer only.Run repeatable, long-only stock strategy backtests from daily OHLCV CSV files. Use bundled scripts to generate consistent metrics and trade-level output, then summarize with investor-friendly conclusions.
Date and Close columns.python scripts/backtest_strategy.py \
--csv /path/to/prices.csv \
--strategy sma-crossover \
--fast-window 20 \
--slow-window 60
python scripts/backtest_strategy.py \
--csv /path/to/prices.csv \
--strategy rsi-reversion \
--rsi-period 14 \
--rsi-entry 30 \
--rsi-exit 55 \
--commission-bps 5 \
--slippage-bps 2
Date is parseable and sorted ascending.Open/High/Low/Close are numeric; missing Open/High/Low falls back to Close.sma-crossover: trend-following with fast/slow moving averages.rsi-reversion: buy oversold and exit on momentum recovery.breakout: enter on highs breakout and exit on lows breakdown.--commission-bps and --slippage-bps.total_return_pct, cagr_pct, win_rate_pct, max_drawdown_pct, sharpe_ratio, profit_factor, and trade count.python scripts/backtest_strategy.py \
--csv /path/to/prices.csv \
--strategy sma-crossover \
--fast-window 10 \
--slow-window 50
python scripts/backtest_strategy.py \
--csv /path/to/prices.csv \
--strategy breakout \
--lookback 20
python scripts/backtest_strategy.py \
--csv /path/to/prices.csv \
--strategy rsi-reversion \
--quiet
strategyperiodmetricsconfigtradest, execute at bar t+1 open.references/backtest-metrics.md