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 spot · 1m → 1d · multi-bar geometry

Try free — no signup Read the docs

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:

No-signup demoPOST /v1/demo returns a real brief with detected patterns, no key. ② Free key with $0.05 starter credit (~5 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_…"

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.

Related

Candlestick patterns API · Support/resistance levels API · Technical indicators API · Docs · Try free