patternfetch Stock candlestick pattern API

Stock candlesticks · API + MCP

Candlestick patterns on stocks, measured against the market's own drift.

One POST /v1/brief with a stock or ETF ticker detects the candlestick signals — bullish & bearish engulfing, hammer, doji — each with a geometric confidence, a backtested base rate, and the number every other candlestick API leaves out: the pattern-free baseline for the same market and horizon. It matters more than it sounds. A bearish engulfing on US stocks resolves down 41.3% of the time, which reads like a finding until you learn that an arbitrary 10-day window closes down 42.0% of the time anyway. We measured all of it, and we put both numbers in the payload.

StocksETFs1m → 1wYahoo · adjustedengulfing · hammer · doji

One bearish candle, two bullish — and all three land on their baseline.

Three textbook candlestick signals, all a clean geometric fit. Here is how often each actually resolved its own way over the next 10 bars on US stocks & ETFs, against the rate an arbitrary window in the same market hits with no candle involved.

The vertical rule is the pattern-free baseline, not 50%. The shaded band is the cluster-robust 95% interval on the difference: where it covers the rule, the pattern adds nothing measurable.

AAPL · 1d
bearish engulfing · bearish
shape 0.75–1.00 · US stocks & ETFs
41.3%vs base 42.0%n=12,842
No lift
SPY · 1d
bullish engulfing · bullish
shape 0.75–1.00 · US stocks & ETFs
58.2%vs base 57.8%n=11,535
No lift
AAPL · 1d
hammer · bullish
shape 0.75–1.00 · US stocks & ETFs
57.7%vs base 57.8%n=5,600
No lift
Directional hit rate over the next 10 bars, no lookahead, on a US-stocks/ETF corpus — the same evidence block your model receives. The vertical rule in each row is that row's own pattern-free baseline: 42.0% for a bearish signal on the daily, 57.8% for a bullish one. Those two numbers are the entire asymmetry. Subtract them and the three candles are left with −0.7pp, +0.4pp and −0.1pp, every one of them inside a ±2.6–2.7pp interval. The candles are not weak signals here. They are the market's drift, relabelled.

TL;DR — One POST /v1/brief (or the MCP tool patternfetch_brief) with { ticker, timeframe } returns detected candlestick patterns on stocks & ETFs — bullish_engulfing, bearish_engulfing, hammer, doji — in analysis.patterns, alongside the multi-bar chart patterns. Each directional pattern carries a geometric confidence (0..1), the candle index at, a span, and an evidence block with the backtested base rate + 95% CI on a US-equities corpus. doji is directionless, so it ships a shape score but no base rate.

The asymmetry is the drift. Nothing else is left.

Candlestick lore treats a bearish engulfing as a reversal-down signal. On US equities the measured base rate looks like it half-agrees — 41.3%, comfortably under half. But the stock is more likely to be up 10 bars later than down whatever the candle did, because equities have a structural upward drift. Once you compare against that drift instead of against 50%, the apparent signal is gone: the candle contributes −0.7 percentage points, inside a ±2.6pp interval. Nothing survives.

The mechanism

  • Equities drift up over the long run: on the daily, an arbitrary 10-bar window closes higher 57.8% of the time and lower 42.0%.
  • A bearish candle only "hits" if price falls, so it inherits the 42.0% — before it has said anything.
  • A bullish candle "hits" if price rises, so it inherits the 57.8%.
  • Compare either one to 50% and the drift looks like an edge. Compare it to its own baseline and the edge is zero within measurement error.
  • Crypto settles it: no drift there, baselines at ~50%, and the bullish/bearish split vanishes — bullish engulfing 49.2%, bearish 49.1% at 4h.

What a competitor shows vs. what we show

# typical candlestick API
{ "pattern": "bearish_engulfing",
  "signal": "SELL" }        ← confident, blind

# patternfetch
{ "name": "bearish_engulfing",
  "evidence": { "hitRate": 0.413,
    "n": 12842,
    "lift": { "baseline": 0.420,
      "lift": -0.007,
      "ci95Clustered": 0.026,
      "informative": false } } }
← resolved its way 41.3% — and so does the
  market, at 42.0%, with no candle at all

Request in, candlesticks + base rate out.

A real /v1/brief shape for Apple on the daily. Note the figures in evidence: hitRate (went the pattern's way), dist.winRate (actually closed up) — and lift.baseline, which is what the market does without the candle. The last one is what makes the first two readable.

Request

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

{ "ticker": "AAPL",
  "timeframe": "1d" }

Response — a candlestick in analysis.patterns

{ "name": "bearish_engulfing",
  "confidence": 1, "at": 118, "span": 2,
  "evidence": {
    "scope": "US stocks & ETFs",
    "tf": "1d", "band": "0.75-1.00",
    "horizon": 10, "n": 12842,
    "hitRate": 0.413, "ci95": 0.009,
    "dist": { "winRate": 0.586, "median": 0.008 },
    "lift": {
      "baseline": 0.420, "baselineN": 46038,
      "lift": -0.007, "ci95Clustered": 0.026,
      "informative": false,
      "reading": "indistinguishable-from-baseline" }
  } }

A picture-perfect bearish engulfing (shape 1.00) that historically resolved bearish 41.3% of the time (n=12,842) — and where the stock actually rose 58.6% of the time (dist.winRate) over the next 10 bars. Both of those look like the candle did something. Neither is: the pattern-free baseline for the same market and horizon is 42.0% down / 57.8% up. The candle moved the number by −0.7pp, against a ±2.6pp interval. The same call also returns chart patterns, support/resistance levels, regime, interpreted indicators and a one-line nl summary — none of which depend on this finding. See it live →

Every stock candlestick, next to what it has to beat.

Daily, high-confidence rates for the candlestick set on US stocks & ETFs. The base rate column is what a conventional candlestick API would show you. The baseline column is what the same market does with no candle present. The lift column is the only one that carries information — and none of it is distinguishable from zero.

CandlestickDirectionBase rate (10-bar)BaselineLift95% CI (clustered)SampleRead
bullish_engulfingbullish58.2%57.8%+0.4pp±2.6pp11,535no lift
hammerbullish57.7%57.8%−0.1pp±2.7pp5,600no lift
bearish_engulfingbearish41.3%42.0%−0.7pp±2.6pp12,842no lift
dojineutraldirectionless

US stocks & ETFs · timeframe 1d · confidence band 0.75–1.00 · horizon 10 bars · gross-directional, no lookahead. The interval is cluster-robust by calendar day, because ~117 tickers moving together on one day are one market event, not 117 independent samples — treating them as independent made our own intervals 2.1–2.7× too narrow until we corrected it. Baselines vary by timeframe: 42.0% down on the daily, 38.8% on the weekly, 47.2% on the hourly. The live numbers are whatever the corpus says at call time. Methodology, including where it is weak →

Same engulfing, different corpus — and the split disappears

On crypto pairs there is no structural drift, so the baselines sit at ~50% (4h: 49.7% up / 50.1% down). Run the same two candles against them and the bullish/bearish spread that looked so convincing on equities is simply gone: bullish engulfing 49.2%, bearish engulfing 49.1% at 4h. Here — and only here — "a coin flip" is a fair description, because the baseline itself is one. That is the cleanest evidence we have that the equity spread was never the candle; it was the drift. patternfetch routes stocks to a US-equities corpus and crypto to a crypto-pairs corpus automatically, because a base rate borrowed across asset classes would be meaningless. Compare on the crypto candlestick API.

Free to start. MCP-native for agents.

Streamable HTTP at /mcp — discovery is free, a tools/call is billed like REST. Five tools, one schema across stocks, ETFs and crypto.

patternfetch_brief patternfetch_multi patternfetch_delta patternfetch_analogs patternfetch_capabilities

Connect (OAuth or Bearer)

# one line — OAuth mints a free key,
# nothing to paste
claude mcp add --transport http \
  patternfetch https://patternfetch.com/mcp

# or Bearer in a config file
{ "mcpServers": { "patternfetch": {
  "url": "https://patternfetch.com/mcp" } } }

Free, then pay-per-call

Free to start:No-signup demoPOST /v1/demo returns a real brief with patterns and evidence, 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. Credits never expire. Pricing →

Questions.

Which candlestick patterns does it detect on stocks?
bullish_engulfing, bearish_engulfing, hammer and doji. The same response also returns multi-bar chart patterns (double_top, double_bottom, head_and_shoulders) in analysis.patterns. Directional patterns carry an evidence base rate; doji is directionless and ships a shape score only. See the chart pattern API for the multi-bar formations.
Why does a bearish stock candlestick resolve its way only ~41% of the time?
Because US equities drift up, and that is all. On the daily, an arbitrary 10-bar window closes lower 42.0% of the time with no candle present. A bearish candlestick only resolves "its way" if price falls, so it starts from that 42.0% before it has said anything — and it finishes at 41.3%. Bullish candlesticks sit near 57.8% for the mirror reason. The number is not the candle underperforming; it is the market's drift wearing the candle's name. Measured as lift over the baseline, the daily bearish engulfing contributes −0.7pp against a ±2.6pp interval.
How is the base rate different from confidence?
confidence is a geometric shape score (0..1) — how cleanly the candle geometry matches the textbook body/wick ratios. The base rate (evidence.hitRate) is separate: how often that pattern, timeframe and confidence band historically resolved its way over the next 10 bars, no lookahead, on a US-equities corpus. Neither can be read on its own — for that you need the third number, evidence.lift.baseline, which is the same measurement with no pattern required. evidence.lift.lift is the difference, and evidence.lift.ci95Clustered its cluster-robust interval.
Which timeframes and tickers are supported?
US stocks and ETFs (e.g. AAPL, SPY, MSFT, QQQ) plus crypto spot pairs (e.g. BTC/USDT). Timeframes 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w. 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 investment, financial, legal or tax advice, not personalized, non-executing. See the disclaimer.
Related

Keep exploring.