Skip to main content
Glama
eminsk

yfinance-ta-patterns

by eminsk

Backtest Candlestick Patterns

ta_backtest_patterns
Read-only

Run 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

NameRequiredDescriptionDefault
top_nNoNumber of top-ranked patterns to return (default: 10)
periodNoBacktest period (default: '1y'; auto-clamped for intraday intervals)1y
symbolYesTicker symbol (e.g. 'BTC-USD', 'AAPL')
sort_byNoRanking metric: 'composite' (balances win rate, PF, Sharpe, log trades) or 'win_rate'composite
timeframeNoTimeframe interval (default: '1d')1d
filter_newsNoIf true, skips trades on days with high-impact macroeconomic events using the economic calendar
min_signalsNoMinimum total signals required to include a pattern (default: 1)
holding_periodNoBars to hold each trade (default: 5)

Output Schema

NameRequiredDescriptionDefault
periodNo
symbolNo
sort_byNo
timeframeNo
filter_newsNo
top_patternsNo
holding_periodNo
news_dates_filteredNo
total_patterns_evaluatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.60

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds real behavioral context the annotations do not: trades are executed at next-open and results are ranked rather than raw. It still omits computational cost/latency, which matters for a backtest that runs over an arbitrary period.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight sentence with the operation front-loaded and the return shape trailing. No filler, no repetition of name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-value detail need not be in the description, and all eight parameters are fully documented. For a read-only computation tool this is nearly complete; only guidance on cost/period tradeoffs and sibling differentiation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with defaults, enums, and ranges documented inline (top_n, sort_by, timeframe, filter_news, min_signals, holding_period). The description restates only the ranking metric, adding nothing beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Run quantitative historical backtesting of all candlestick patterns on a symbol' and the output ('top-performing patterns ranked by composite score or win rate'). Clear and specific, but it does not differentiate itself from the lookalike sibling ta_scan_symbol, which also scans patterns on a symbol.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what the tool computes but never says when to choose it over ta_scan_symbol or ta_scan_watchlist, nor when a live scan is preferable to a historical backtest. No exclusions, prerequisites, or alternatives are offered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.