Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

There is no verified universal statistic showing that 90% of candlestick patterns fail. Whether a pattern “works” depends on what counts as a pattern, what outcome and time horizon are measured, which market is tested, and whether costs and execution are included. A Python confluence scanner can help test a defined trading hypothesis, but its score is not automatically a probability or a profitable signal.

The useful question is not whether a candle shape predicts the future in general. It is whether a precisely specified pattern, combined with defined market context, improves on a simple baseline in unseen data after realistic trading costs.

What does “fail” mean for a candlestick pattern?

A candlestick summarizes an interval’s open, high, low, and close. A named pattern is a rule applied to those prices; it is not, by itself, evidence that the next price move will have a particular direction. “Fail” can refer to several different outcomes, and they should not be conflated:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Identification: the rule or model labels a candle as a pattern. This tests whether the pattern is recognized, not whether it predicts anything.
  • Directional classification: a model predicts, for example, whether the return over a specified future horizon will be positive. Accuracy measures the share of labels predicted correctly; it depends on the label definition and baseline.
  • Trade performance: a fully specified strategy enters and exits at executable prices. Its win rate is the fraction of trades with positive returns, but that alone says nothing about the size of wins and losses or costs.
  • Net profitability: returns after fees, spread, slippage, timing assumptions, and other relevant expenses. A strategy can classify direction more often than not and still lose money.

To make a claim about failure meaningful, state the pattern universe, instruments, bar interval, forecast horizon, success criterion, sample period, and evaluation method. The “90%” in the headline is therefore a question to investigate, not an established market-wide result.

#1 Best Overall
Sale
Japanese Candlestick Charting Techniques, Second Edition
  • A great option for a Book Lover
  • Great one for reading
  • Comes with Proper Binding

What does existing chart-pattern research establish?

The 2019 preprint Using Deep Learning Neural Networks and Candlestick Chart Representation to Predict Stock Market describes converting historical data into chart images and evaluating neural-network approaches on selected Taiwan and Indonesia stock-market datasets. The paper’s authors report accuracy of 92.2% for the Taiwan dataset and 92.1% for the Indonesian dataset in their classification experiments. Those figures describe that study’s image-model setup and labels. They are not a general success rate for named candlestick rules, a trade win rate, or evidence of net profitability after costs.

The 2024 Journal of Financial Economics article Charting by Machines reports that, in the authors’ study, machine-learning forecasts built from historical performance predict the cross-section of future stock returns. That is evidence about learned chart and historical signals in the study’s setting, not a direct confirmation of any particular candlestick pattern or of the scanner described here.

Together, these findings support testing chart-related data as model inputs; they do not supply a universal pattern-failure percentage or validate a specific trading system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should a confluence scanner measure?

Confluence means combining separately defined features that describe a setup or its context. A scanner should expose those inputs instead of hiding them behind an unexplained “AI” label. For a research prototype, keep four layers distinct:

  1. Data: specify the instrument universe, bar interval, timezone, price-adjustment policy, data source, and retrieval date. Validate timestamps, missing or duplicate bars, OHLC consistency, and whether volume is available and meaningful.
  2. Pattern: encode candle rules from OHLCV fields with explicit lookback and thresholds. Deterministic rules are easier to reproduce than chart-image labels when the question is specifically about a named candle shape.
  3. Context: add independently defined features such as trend, volatility, volume, or location relative to a predeclared price level. Document the scale and calculation of every feature.
  4. Evaluation and output: define the target and horizon before fitting, evaluate in time order, compare with simple baselines, and show the pattern, contributing features, score calculation, timestamp, and limitations to the user.

A weighted score is a ranking heuristic unless it has been fitted to a defined outcome and its probabilities have been calibrated and checked on data not used to fit it. Calling a score “80% confidence” without that evidence gives a number more meaning than it has.

How do you build an inspectable Python prototype?

The following example illustrates one deterministic bullish-engulfing rule and two context features. It assumes a pandas DataFrame named df with columns open, high, low, close, and volume, indexed by chronologically ordered bar timestamps. It is a teaching example, not a tested trading strategy. The rolling windows and score weights are illustrative choices, not optimized or validated values.

1. Validate the bars before generating signals

Start with data checks appropriate to the source and instrument. At minimum, detect duplicate or unordered timestamps, missing bars relative to the expected trading calendar, nonnumeric or missing OHLC values, and rows where the high is below the open or close, or the low is above either. Do not silently fill missing prices or assume that volume has the same interpretation across all instruments. Record the source and retrieval date so the analysis can be reproduced.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Define the candle and context rules

import pandas as pd

# df must contain chronologically ordered OHLCV bars.
# This example leaves data validation and market-calendar checks to the caller.
prev_open = df["open"].shift(1)
prev_close = df["close"].shift(1)

# Illustrative rule: prior candle is down; current candle is up;
# current real body covers the prior real body.
down_before = prev_close < prev_open
up_now = df["close"] > df["open"]
engulfs_body = (df["open"] <= prev_close) & (df["close"] >= prev_open)
df["bullish_engulfing"] = down_before & up_now & engulfs_body

# Illustrative context features. Values are computed using data available
# through the current bar; they are not evidence of predictive power.
df["sma20"] = df["close"].rolling(20, min_periods=20).mean()
df["uptrend_context"] = df["close"] > df["sma20"]
df["volume_mean20"] = df["volume"].rolling(20, min_periods=20).mean()
df["above_average_volume"] = df["volume"] > df["volume_mean20"]

# A transparent 0–3 ranking score, not a probability.
df["score"] = (
    df["bullish_engulfing"].astype(int)
    + df["uptrend_context"].fillna(False).astype(int)
    + df["above_average_volume"].fillna(False).astype(int)
)

This rule intentionally spells out what “engulfing” means: it compares real bodies, not the full high-low ranges. Other definitions exist, so a different definition should be documented rather than mixed into the same test. The example’s three-part score simply counts conditions; it has no learned weights and makes no probability claim.

3. Define the outcome and signal timing

Choose a target before examining results: for example, the return over a fixed number of future bars, or whether that return exceeds a stated threshold. If a signal uses the closing price of a bar, a backtest must not also assume it entered at that already-observed close unless the execution model justifies that timing. A conservative prototype can make the signal available after the bar closes and model entry at the next bar’s open, while recognizing that the next open may not be fully executable at the displayed price.

For classification, create labels from future data only after defining the horizon; keep those labels out of features. For a strategy simulation, specify entry, exit, position sizing, overlapping-signal handling, and the treatment of gaps. These are different experiments and should be reported separately.

How should you test the scanner without fooling yourself?

Split data chronologically

Randomly shuffling market bars can leak information across time and create an unrealistic test. Fit or choose rules using an earlier interval, use a later validation interval for decisions, and reserve a final chronological test period that remains untouched until the design is fixed. If parameters are tuned repeatedly against the final interval, it is no longer an independent test.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare against baselines and report distinct metrics

Compare classification results with simple baselines, such as predicting the majority class or using a basic historical direction rule. Report the class distribution and the chosen horizon alongside accuracy; where appropriate, also report precision, recall, and confusion counts so false positives are visible. Do not use a classifier’s accuracy as a substitute for simulated strategy returns.

For strategy results, disclose trade count, signal and execution timing, fees, spread, slippage assumptions, and the calculation of returns. Include risk and loss measures appropriate to the strategy rather than relying only on win rate or gross returns. Test sensitivity to plausible costs and to different instruments, time periods, and market regimes where the available data permits. Results on one symbol or one interval do not establish broad reliability.

Check for leakage and instability

  • Ensure each feature uses only information available when the signal is generated. A centered rolling calculation, future price level, or later-revised data can leak information.
  • Apply any data scaling, feature selection, threshold tuning, or model fitting using training data only; then apply the frozen process to later data.
  • Account for survivorship and selection effects in the instrument universe. A universe chosen using future membership can distort historical results.
  • Inspect performance across periods and instruments rather than selecting only the strongest result. A result that disappears with a small change in costs or timeframe may be fragile.

A scanner can rank candidates for further examination, but an attractive backtest does not remove uncertainty about future behavior or real-world execution.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should the scanner use candle rules, chart images, or both?

Approach What it represents Main trade-off
Deterministic OHLC rules Explicit definitions applied to open, high, low, and close data Easy to inspect and reproduce, but results depend on the chosen definition and thresholds
Image-based model A model classifies chart images constructed from historical prices Can learn visual representations, but image construction and labels must be controlled; the model may be harder to interpret
Hybrid research setup Explicit candle rules and context features tested alongside an image model Enables comparison, but requires a matched target, time split, and evaluation protocol; it does not guarantee that combining inputs helps

There is no evidence here establishing a winner among these approaches. An apples-to-apples test needs the same instruments, periods, outcome definition, and evaluation discipline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What controls belong in an operational scanner?

Present each alert as a candidate for review, not an instruction to trade. Display the raw pattern label, each context feature, the arithmetic behind the score, the bar timestamp and data source, and a warning when required data is missing or stale. Log generated alerts and later outcomes so data-quality problems and changes in behavior can be investigated.

Scott W. Bauguess, an SEC staff speaker, said, “good data is better than more data.” In the context of his SEC speech on machine learning and risk assessment, the point is that adding volume to poor or unstructured inputs does not solve the underlying data problem. The speech also describes risk models producing false positives and expert staff critically examining outputs; that is a cautionary analogy about oversight, not evidence about trading performance.

The SEC’s 2020 staff report on algorithmic trading, whose landing page was updated in 2023, provides an official overview of algorithmic trading in U.S. capital markets. It should not be read as a universal checklist for every personal research script. Duties depend on the operator, activity, instruments, and jurisdiction.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.