patternfetch Stock candlestick pattern API
Stock candlesticks · API + MCPCandlestick 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.
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.
| Candlestick | Direction | Base rate (10-bar) | Baseline | Lift | 95% CI (clustered) | Sample | Read |
|---|---|---|---|---|---|---|---|
| bullish_engulfing | bullish | 58.2% | 57.8% | +0.4pp | ±2.6pp | 11,535 | no lift |
| hammer | bullish | 57.7% | 57.8% | −0.1pp | ±2.7pp | 5,600 | no lift |
| bearish_engulfing | bearish | 41.3% | 42.0% | −0.7pp | ±2.6pp | 12,842 | no lift |
| doji | neutral | — | — | — | — | — | directionless |
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.
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 demo — POST /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 →