Backtest Candlestick Patterns
ta_backtest_patternsRun quantitative historical backtests of candlestick patterns for a symbol, then rank top performers by composite score or win rate with next-open execution.
Instructions
Run quantitative historical backtesting of all candlestick patterns on a symbol (next-open execution) and return the top-performing patterns ranked by composite score or win rate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Number of top-ranked patterns to return (default: 10) | |
| period | No | Backtest period (default: '1y'; auto-clamped for intraday intervals) | 1y |
| symbol | Yes | Ticker symbol (e.g. 'BTC-USD', 'AAPL') | |
| sort_by | No | Ranking metric: 'composite' (balances win rate, PF, Sharpe, log trades) or 'win_rate' | composite |
| timeframe | No | Timeframe interval (default: '1d') | 1d |
| filter_news | No | If true, skips trades on days with high-impact macroeconomic events using the economic calendar | |
| min_signals | No | Minimum total signals required to include a pattern (default: 1) | |
| holding_period | No | Bars to hold each trade (default: 5) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | ||
| symbol | No | ||
| sort_by | No | ||
| timeframe | No | ||
| filter_news | No | ||
| top_patterns | No | ||
| holding_period | No | ||
| news_dates_filtered | No | ||
| total_patterns_evaluated | No |