Chart pattern detection

How does an AI agent detect crypto chart patterns like double tops and head & shoulders?

It calls one endpoint. POST /v1/brief with a ticker and timeframe scans the price series geometrically and returns each multi-bar chart pattern — double_top, double_bottom, head_and_shoulders — with a confidence, the candle index, and how many bars it spans. No charting library, no image recognition, no screenshots.

Crypto spot1m → 1dmulti-bar geometry

TL;DR — One POST /v1/brief (or the MCP tool patternfetch_brief) with {ticker, timeframe} detects multi-bar chart patterns geometricallydouble_top, double_bottom, head_and_shoulders — plus candlestick patterns. Each pattern carries a confidence (0..1), the candle index at, and a span (how many bars the formation covers). No charting library and no image recognition — it reads the numeric series directly.

Chart patterns vs candlestick patterns

Two different shapes of pattern, both returned in the same analysis.patterns array:

ClassBars coveredExamples
Chart patternsMany candles (a formation)double_top, double_bottom, head_and_shoulders
Candlestick patterns1–2 barsengulfing, hammer, doji

Chart patterns describe the macro shape of price over a stretch of the series; that is why each one reports a span — the number of candles the formation covers. Candlestick patterns are local, single- or two-bar signals. The brief returns both classes in one call, so your agent never has to run two passes. If you want detail on the 1–2 bar signals, see the crypto candlestick patterns API.

The one call

Request

POST https://patternfetch.com/v1/brief
Authorization: Bearer pf_…
Content-Type: application/json

{ "ticker": "ETH/USDT",
  "timeframe": "1d" }

Response — chart patterns

"patterns": [
  { "name":"head_and_shoulders",
    "confidence":0.74, "at":177, "span":40 },
  { "name":"double_bottom",
    "confidence":0.86, "at":158, "span":14 }
]

The same call also returns support/resistance levels, the regime (trend + volatility), interpreted indicators (RSI/EMA), and a one-line nl summary your agent can act on — all in a few hundred tokens. See it live →

How confidence + span work

Each detected pattern carries three fields that an agent can reason over directly:

FieldMeaning
confidenceA geometric quality score from 0 to 1 — how cleanly the series matches the pattern's shape (peak/trough symmetry, neckline fit, depth). It is not a probability of profit and not a forecast.
spanThe number of candles the formation covers. A head_and_shoulders with span:40 spans 40 bars; a double_bottom with span:14 spans 14.
atThe completion index — the candle in the series where the pattern finishes forming.

So { "name":"head_and_shoulders", "confidence":0.74, "at":177, "span":40 } reads as: a head-and-shoulders that completes at candle 177 and covers the preceding 40 bars, with a clean-but-not-textbook geometric fit of 0.74.

Free to start

Free to start:

No-signup demoPOST /v1/demo returns a real brief with detected patterns, no key. ② Free key with $3.00 starter credit (300 briefs) from one call, no card. A brief is $0.01. Pay with x402 (USDC on Base, no account) or Stripe. Pricing →

For AI agents (MCP)

Call the tool patternfetch_brief over MCP (Streamable HTTP) and read analysis.patterns for the chart patterns. Two ways to connect, both zero-friction:

A) OAuth — one-click connect (no key handling)

Add the server URL and click Authorize once — patternfetch mints a free-tier key for you automatically, nothing to paste.

# Claude.ai → Settings → Connectors → Add custom connector
https://patternfetch.com/mcp
# (discovery: /.well-known/oauth-protected-resource)

B) Bearer key (config file)

{
  "mcpServers": {
    "patternfetch": {
      "url": "https://patternfetch.com/mcp",
      "headers": { "Authorization": "Bearer pf_…" }
    }
  }
}

Or one line: claude mcp add --transport http patternfetch https://patternfetch.com/mcp --header "Authorization: Bearer pf_…"

The honesty layer: every pattern ships its base rate

Most pattern and signal APIs hand a model a confident-looking "double_bottom", 0.86 and let it quote that blind. patternfetch attaches an evidence block to every detected pattern — the backtested historical hit-rate for that exact pattern, timeframe and confidence band, the pattern-free baseline for the same market and horizon, and a cluster-robust interval on the difference — measured with no lookahead (chart patterns are scored only from the bar they become knowable). A hit rate on its own cannot be read: a drifting market moves it away from 50% with no pattern involved. Measured against the baseline instead, three of the 105 buckets we tested clear an uncorrected cluster-robust 95% interval — and all three are crypto: bullish_engulfing 1h −1.76pp (±1.36, n=8,897), double_bottom 1d −12.25pp (±8.91, n=143), and double_top 1d +9.78pp (±8.42, n=149), the only bucket of the 105 that lands above its baseline. That is fewer than the ~5.3 chance alone would produce at this threshold, and none of the three survives a Bonferroni correction across 105 comparisons; on US stocks & ETFs it is 0 of 60. The evidence block reports exactly that, instead of laundering a shape score into a confident call. Impersonal market data, not advice. See the method →

FAQ

Which chart patterns does it detect?
Multi-bar chart patterns: double_top, double_bottom and head_and_shoulders, detected geometrically from the price series. The same response also returns 1–2 bar candlestick patterns (engulfing, hammer, doji) in analysis.patterns. See the candlestick patterns API for those.
Is the confidence a probability of profit?
No. Confidence is a geometric quality score from 0 to 1 — how cleanly the series matches the pattern's shape. It is not a probability of profit, not a forecast, and not advice.
Which timeframes and pairs are supported?
Crypto spot pairs (for example BTC/USDT, ETH/USDT) on timeframes from 1m to 1d. Pass ticker and timeframe to POST /v1/brief.
Is this investment advice?
No. It's impersonal market data and algorithmic signals, for informational purposes only — not advice, not personalized, non-executing. See the disclaimer.