Skip to main content
US market 11 min read

Heikin Ashi strategy: smooth candles, weak trading results

Heikin Ashi strategy tested with real execution prices: QQQ, inverse timing and US stocks fail robustness checks. Download the full experiment.

These rules did not pass validation

Compare returns and drawdowns.

Compare results
Rules failed robustness

Heikin Ashi strategy equity curves: timing, inverse timing, individual stocks and total-return benchmark

None of the three Heikin Ashi holding designs passes all robustness checks in this experiment. From 2017-01-03 to 2026-11-09, the central QQQ timing rule returned 1.2% a year with daily Sharpe 0.18, versus 20.1% and 0.92 for QQQ total return. This is a study of a failed trading hypothesis, rather than a validated strategy to deploy.

The stock version returned -7.4% a year and won 0 of nine parameter comparisons. Applying the indicator to individual companies did not reproduce a robust advantage over QQQ. The figure compares all three central rules with the benchmark from the same starting value; click it for the full-size chart.

These trading rules are research results. To rerun the experiment, set up FinLab and download the research program (.py). Other files are in the research downloads.

Heikin Ashi strategy: smooth candles do not create tradable prices

Heikin Ashi replaces ordinary candles with calculated values. The synthetic close averages the market open, high, low and close. The synthetic open averages the preceding synthetic open and close. The high and low take the extremes of the market bar and the synthetic body. Because the open carries earlier information forward, adjacent candles tend to look smoother than ordinary market candles.

The first synthetic open uses the first available market open and close. Later opens follow the recursion. That initialization happens during the warm-up history, before the performance window. The rule does not restart the synthetic candle every month or whenever a position changes; doing so would produce different qualifying runs.

Synthetic value Formula What it represents
Close Average of market O, H, L and C A smoothed center of today's market bar
Open Average of previous synthetic open and close Memory of the preceding synthetic body
High Maximum of market high, synthetic open and close Upper displayed extreme
Low Minimum of market low, synthetic open and close Lower displayed extreme

A qualifying candle is bullish and has no lower shadow. In the implementation, synthetic close must exceed synthetic open, and the market low must not fall below synthetic open, allowing a tiny numerical tolerance. The entry requires consecutive qualifying candles. Exit requires consecutive failures of that full condition. A bearish candle and a bullish candle with a lower shadow both count as failures; neither is silently ignored.

Why the strategy trades at a real closing price

The synthetic open is a calculated average and can lie outside today's tradable range. The synthetic close is also an average, not a quote at which the account could necessarily trade. A backtest that buys or sells at those values can obtain favorable fills that no order would have received. The chart can remain useful while that execution assumption is impossible.

This experiment uses Heikin Ashi only to generate the signal. FinLab executes using the underlying security's market-price series at the next close. It does not feed a synthetic candle price into the trade engine. The resulting return therefore includes the delay from waiting for the full daily bar and then waiting for the following session's execution.

Consecutive-candle confirmation adds another delay. By the time the third clean bullish candle is complete, part of the rise has already happened. Waiting for two failed candles before exit can reduce a single-bar whipsaw, but it can also retain exposure through a reversal. Those are explicit trade-offs in the entry-length and exit-length grid.

No lower shadow is a geometric condition, not a forecast

A clean bullish candle means the bar's low stayed above the synthetic open while the synthetic close finished higher. It describes the relationship among today's range and a smoothed historical reference. It does not establish that buyers will remain stronger tomorrow. A sequence can look uninterrupted precisely because smoothing hides variation that an actual holding still experiences.

The drawdown chart therefore uses portfolio equity calculated from real prices. It should not be inferred from how many synthetic candles stay the same color. QQQ timing, inverse QQQ timing and individual-stock equal weighting answer different questions about that same signal. The stock version can add considerable turnover because each company's qualifying run starts and ends on different dates.

A possible inverse result also needs interpretation. Holding QQQ outside the clean-candle state can retain more market exposure and consequently capture more of a long bull market. The same-average-exposure control and the BIL-adjusted Sharpe test help distinguish participation from timing. A small full-period Sharpe lead is insufficient when most neighboring settings or the later half fail.

Changing the rule to require only bullish color, tolerating short lower shadows or adding a trend filter would create new experiments. None is introduced after reviewing this batch. The downloadable grid retains every predefined setting, including those whose candle sequences look least attractive on a selected chart.

Valcu (2004), Using the Heikin-Ashi Technique, appeared in Technical Analysis of Stocks & Commodities. The magazine's implementation archive identifies the February 2004 article; the consecutive-candle entry and exit rules are this experiment's design. Original source.

Results: all three holding designs

Central design Annualized return (CAGR) Daily Sharpe Max drawdown First / second half Sharpe Settings beating QQQ Time invested
QQQ timing 1.2% 0.18 -19.5% 0.31 / 0.03 0 / 9 27.5%
QQQ inverse timing 18.6% 0.92 -36.4% 1.20 / 0.67 4 / 9 72.5%
Individual stocks -7.4% -0.05 -85.5% 0.42 / -0.39 0 / 9 94.9%
QQQ total return 20.1% 0.92 -35.1% 1.22 / 0.63 — 100%

Daily Sharpe here means average daily return divided by its standard deviation, multiplied by the square root of 252, without subtracting a risk-free rate. CAGR uses elapsed calendar years. Maximum drawdown is the deepest fall from a previous equity peak. These are different questions, so a higher Sharpe does not imply a higher annual return. Sharpe (1994) defines the ratio using differential returns; the zero-rate convention here is explicit.

The embedded FinLab report is the central QQQ timing rule, not the best-performing grid cell. The second downloadable report is the central stock portfolio. The headline table keeps the full common window, including cash before the first trade; a report can begin at its first executed trade. Its built-in Sharpe also has its own risk-free-rate convention, while this study's comparisons consistently use zero.

Neighboring parameters and the two halves

Enter after 2, 3 or 4 consecutive bullish Heikin Ashi candles with no lower shadow; exit after 1, 2 or 3 consecutive candles fail that condition. The center is three qualifying candles to enter and two failures to exit. Every combination was registered before reviewing results. At least seven of the nine settings must beat QQQ's same-window daily Sharpe. The central setting must also beat it in each half of the trading-day calendar. These are robustness screens on historical data, not untouched out-of-sample forecasts.

Heikin Ashi nine neighboring settings: daily Sharpe difference from the benchmark

Heikin Ashi first-half and second-half daily Sharpe for each central rule and benchmark

Blue positive cells beat the benchmark; negative cells do not. The three panels belong to timing, inverse timing and stock holding. The split-period chart compares those same central allocations with QQQ rather than changing parameters between periods. A full-window lead cannot compensate for a failed half or an unstable neighborhood.

Costs, cash and the best year

The US market default in sim() is zero commission and zero transaction tax. Each central rule is also rerun with 0.1% per side, a separate allowance for trading friction. No additional market-impact model, tax-on-capital-gains calculation or capacity estimate is supplied.

The equity curves, parameter grid, split-period chart and embedded report use zero commission. The table separates the 0.1% per-side cost results from the zero-commission BIL comparison.

Central rule CAGR at 0.1% per side Daily Sharpe at 0.1% Zero-fee Sharpe after BIL Best calendar year removed Sharpe without that year / QQQ
QQQ timing -1.6% -0.13 -0.08 2017 0.08 / 0.85
QQQ inverse timing 15.3% 0.79 0.81 2020 0.81 / 0.87
Individual stocks -22.5% -0.58 -0.12 2023 -0.20 / 0.78

Subtracting BIL's daily total return gives QQQ an excess-return Sharpe of 0.81. Idle cash earns zero in the strategy; the experiment does not quietly pay Treasury returns to cash holdings. The fixed-exposure control holds the same average fraction of QQQ every day and keeps the remainder at zero-return cash. Its Sharpe for the timing allocation is 0.92, compared with 0.18 for the rule. The control excludes rebalancing costs.

Removing the central rule's best calendar year is an additional historical stress test. That year is selected from the rule's own annual returns, and the same dates are removed from the benchmark. The remaining daily returns are compounded without inserting a return across the removed interval. Passing this check cannot repair an earlier failure.

Heikin Ashi drawdowns calculated from actual portfolio equity

Universe, execution and limits of the evidence

Signals are formed after the close and executed at the following trading session’s market close in every grid and central rule.

The data end on 2026-11-09 and this run was completed on 2026-11-11, using finlab 2.3.8. US adjusted OHLC comes from us_price for stocks and us_fund_price for QQQ. QQQ's adjusted close is the total-return benchmark, computed directly from prices without transaction costs. Every comparison uses its available trading calendar.

The stock universe uses FinLab's common-stock classification, adjusted price above $5, a 60-session average adjusted-price-times-volume amount above $5 million, and the 100 largest such amounts each day. The amount requires at least 20 observations. A stock is excluded after a 50% absolute daily move, using a rolling 252-session record shifted by one session. This screens earlier extreme moves; it cannot prevent the first extreme event. The common-stock classification is a present security-type filter, so historical classification changes remain a limitation.

Eligible stocks with positive indicator states receive equal target weights, recalculated daily. The market, liquidity ranking and indicator use information available at that close. No present-day S&P 500 membership list, analyst snapshot, financial-statement factor or investor's private strategy is used. Available delisted price columns are retained when they pass classification, but completeness of delisting returns is not separately audited. Financial and other sectors are not individually excluded, and there is no market-cap forecast or sector-neutral constraint.

Each stock receives 1 divided by the number of current holdings; no additional per-stock cap is imposed, so a single remaining stock can receive 100%. The fund rules allocate either 100% to QQQ or 100% to cash. Target-weight turnover for each central allocation is:

Central allocation Recorded trades Average monthly target turnover Highest month
QQQ timing 138 116.0% 350.0%
QQQ inverse timing 139 116.0% 350.0%
Individual stocks 7049 731.8% 1025.4%

The central stock version averages 11.6 positions. Target-weight turnover is half the absolute daily target-weight changes, summed by month. This is not executed notional turnover: price drift and execution details can change the actual amount. A change in universe membership can require trading even without a fresh indicator reversal.

All tests are historical and in sample. Registering parameters before this run reduces within-batch cherry-picking, but the idea and market were selected with knowledge of financial history. The half-period split, grid and best-year check do not provide a statistical probability of future profit. Bailey and colleagues (2017) examine backtest overfitting; this study does not estimate their probability-of-overfitting statistic. Moskowitz, Ooi and Pedersen (2012) study futures trend following, which does not validate this indicator.

Reproduce the rule with an AI agent

Complete the FinLab setup flow with Claude Code, Codex or Gemini CLI. The agent guide explains how the skill gives your agent access to FinLab's data and backtests. The direct skill install command is:

Show Code
npx skills add koreal6803/finlab-ai --skill finlab -g -y

The browser version, FinLab Studio, also supports AI research. Ask the agent to reproduce the fixed experiment before proposing changes: “Use the downloaded Heikin Ashi research program, keep its registered dates and nine settings, and compare the three holding rules with QQQ including the cost test.” The point is to retain the definitions in the results table. A newly generated trading rule, even if it uses the same indicator name, does not reproduce this experiment.

Download the research program as research.py in the working directory. This excerpt runs the central individual-stock rule; the program's command-line options also run the complete grid. Its dependency command includes finlab, numba and TA-Lib. Login is handled by FinLab.

Show Code
import finlab
from research import load, signal, backtest
 
finlab.login()
prices, eligible = load("us")
state = signal(prices, "heikin", 3, 2)
position = (state & eligible).loc["2017-01-03":"2026-11-09"]
report = backtest(position)
report.to_html("heikin_stocks_report.html")

Questions about this Heikin Ashi test

What is the best setting? The middle values were fixed in advance. The heatmap supplies every neighboring outcome; no winning cell is substituted for the original rule.

Does a smaller drawdown prove the signal works? Cash can reduce both drawdown and return. The fixed-exposure and BIL comparisons ask whether the timing adds more than that reduction in participation.

Does the inverse rule mean short selling? No. It holds QQQ in the original rule's cash sessions and holds cash otherwise. Borrow fees and short-position losses are outside this experiment.

Can these results be transferred to an individual stock? The separate stock portfolio already tests a liquid universe, and its failure does not support selecting a few attractive charts afterward. Company-specific concentration adds another risk.

Does the report's Sharpe equal the table's? Not necessarily. This table consistently uses daily returns with a zero risk-free rate and a common full window. Report conventions and a first-trade start can differ.

Can I change the timeframe to intraday? That requires another dataset and new execution assumptions. Daily highs and lows cannot identify the order of intraday fills or guarantee fills at indicator boundaries.

For broader context, the US strategy studies distinguish validated rules from negative experiments. Backtesting methods explain execution and bias; the quant glossary defines the result metrics. The Bollinger Bands study tests a different volatility envelope, and Turtle trading tests channel breakouts. FinLab's research workflow and team information provide product and author context.

Research downloads

File Contents
Download research program (Python) Give this to your AI agent after setting up FinLab
Download daily balances (CSV) Daily balances for the rules and benchmark; opens in a spreadsheet
Download complete test results (JSON) Full test results for AI or coding tools
Open timing report (web) Interactive webpage; no setup or installation needed
Open stock report (web) Interactive webpage; no setup or installation needed

Past performance does not guarantee future results. This material is for research and education and is not investment advice. It does not recommend any individual stock, guarantee a stop price or promise that a historical advantage will persist.

Last updated: 2026-11 | Backtest window: 2017-01-03 to 2026-11-09 | Author: FinLab Quant Research. The team maintains reproducible Taiwan and US market studies using FinLab data.

FinLab AI

Want to build your own strategy?

Describe your stock-picking ideas in natural language. AI automatically validates, backtests, and gives you answers

Start Free

More Technical Indicators research

View all