Skip to content

AI analysis

Heikin Ashi crypto backtests: separate signals from fills

One synthetic candle reaches a price that never traded. Rebuild the same signal with an ordinary-price execution ledger before interpreting the result.

A lime probe touches solid ivory stone steps beneath an offset, ghostlike reflection on a suspended translucent sheet.
Illustration for ai analysis; examples in this article are educational.

Heikin Ashi crypto backtests should keep synthetic signal prices separate from the real market series used to model fills. Heikin Ashi OHLC values are derived from current and prior price inputs and can include levels that never traded in that interval. A strategy may use a completed Heikin Ashi candle as an input, but its order timing, entry, exits, costs and equity must be evaluated against an explicitly defined market-price and execution model.

A smooth run of candles can make a rule easy to describe. It cannot establish what price an exchange would have accepted. The useful review is to reconstruct one signal with both price series visible, then ask whether the resulting order could exist.

Keep two price ledgers

The market ledger starts with ordinary trading-price data for an exact venue, instrument and interval. Trade OHLC summarizes transactions, but does not establish the quotes available to your order. Keep mark or index inputs used for futures triggers separately identified; they are not interchangeable with execution prices. A perpetual contract and a similarly named spot pair are different inputs.

The signal ledger contains the Heikin Ashi transformation of that market series. TradingView's non-standard chart documentation explains that these OHLC values are synthetic and differ from the market prices at which orders execute. A Heikin Ashi close is therefore an indicator value, even when it is drawn as the end of a candle.

Keep the timestamp linking the two ledgers. Unlike a price-movement chart that creates bars at irregular times, a standard Heikin Ashi transformation retains the underlying time intervals. That does not make its price coordinates executable. The separate Renko backtest guide examines the additional construction and historical-approximation problems of bricks.

A similar distinction matters for other transformations. An anchored volume profile groups volume into price bins; Heikin Ashi transforms OHLC. They answer different questions, and neither transformation supplies evidence that your order filled.

Calculate the candle before trusting its wick

Write ordinary market values as O, H, L and C, and use HA for the derived series. The usual construction is:

  • HA close = (O + H + L + C) / 4.
  • HA open = (previous HA open + previous HA close) / 2.
  • HA high = maximum of H, HA open and HA close.
  • HA low = minimum of L, HA open and HA close.

TradingView describes the averaging rules in its Heikin Ashi construction guide. The recursive open carries information from earlier intervals. This is why a derived wick can extend beyond the current interval's actual trading range.

Here is an invented spot-token example in USDT. It deliberately uses a large price jump to make the distinction visible; it is not a historical crypto sample. Assume the preceding completed HA candle has an open of 100 and close of 102. The next market candle, A, has O = 110, H = 114, L = 108 and C = 112.

Candle A fieldMarket ledgerHeikin Ashi ledger
Open110(100 + 102) / 2 = 101
High114max(114, 101, 111) = 114
Low108min(108, 101, 111) = 101
Close112(110 + 114 + 108 + 112) / 4 = 111

The HA low of 101 does not establish a trade at 101. Every actual trade summarized by candle A lies between 108 and 114. For an already-open position, a hypothetical sell stop at 105 was not reached by this market candle, although its synthetic wick passes through 105. Using the HA low to decide that the stop triggered would invent a market event.

The distortion need not improve reported performance. A false stop can create a loss, while a favorable artificial entry can create a gain. The defect is the price model, regardless of which direction it moves the result.

A next-candle entry can still use an impossible price

Suppose the written entry rule acts after candle A finishes when HA close exceeds HA open. It passes because 111 is greater than 101. The order can only become eligible after the final inputs arrive; it cannot retrospectively buy at A's open. The candle-close confirmation guide explains that finalizing a signal does not guarantee a closing-price fill.

Now assume the next market candle, B, has O = 112, H = 116, L = 111 and C = 115. Its HA open is (101 + 111) / 2 = 106. Waiting for the next candle has fixed the obvious timing mistake, but filling at its HA open still buys below every market trade in B.

For a narrow accounting comparison, assume a two-unit position later exits at an independently stipulated market execution price of 114. Both versions use that same exit; the example does not infer the exit from B's high or assume a limit touch guarantees a fill. Costs are excluded here to isolate the entry discrepancy.

Entry model after A's signalAssumed entryExitTwo-unit gross P&L
Synthetic next HA open1061142 × (114 − 106) = 16 USDT
Standard next market open1121142 × (114 − 112) = 4 USDT

The synthetic entry adds 12 USDT to this invented result. The standard next-open entry is also a modeling assumption. A real order arriving after that open can face a different quote, spread, depth or partial fill. It is a more coherent price basis, not proof of execution.

Run a comparison that isolates the change

Freeze the exact HA signal rules, parameters, quantity and test period. First export the signal timestamps. Then compare two execution runs: the original synthetic-price model and a model using the corresponding ordinary market data. Keep the signal timestamps identical for this first diagnostic.

Record each changed entry, exit and stop event. In the example, the impossible next-open entry and false stop touch are different discrepancies; a single profit total conceals their causes. If exits depend on position state, changing a fill can legitimately change later orders. Preserve that chain in the event ledger.

Changing the chart to ordinary candles without explicitly retaining the HA signal inputs may change the strategy itself. A moving average applied to HA closes is a different calculation from the same moving average applied to ordinary closes. You cannot attribute the difference entirely to fills when both inputs and execution changed.

For TradingView specifically, its current strategy documentation describes the Standard bars option under Heikin Ashi mode and the fill_orders_on_standard_ohlc = true declaration parameter for ordinary-price fills. Inspect the saved strategy settings and exported trades rather than assuming a screenshot proves the setting. This is a TradingView capability, not a claim about KLINEO's available controls.

A reusable audit worksheet

Field to preserveWhat a reviewable record says
Market identityVenue, instrument, price basis, interval and timezone
HA constructionFormula, initialization rule and warm-up history
FinalityWhich completed candle is used and when it became available
Signal inputHA values explicitly named; no accidental ordinary-series substitution
Order eligibilityFirst submission time after the required inputs arrived
Execution inputOrdinary market series, order type and fill convention
ExceptionsSynthetic-only price touches, ambiguous exits and missing data
Costs and equityActual modeled fill notionals, fees and the declared marking basis

Initialization deserves attention: the first HA open needs a seed. Different seeds can affect early values through the recursive calculation. Preserve the seed and warm-up period, and compare early signals when changing the history start.

An unfinished HA candle can also change as its underlying high, low and close update. Waiting for completion addresses that provisional input; it does not repair a synthetic fill model. The separate look-ahead bias audit covers when inputs become usable.

Finally, standard OHLC still omits intrabar sequence, queue position and the depth available to your order. The backtest evidence worksheet addresses those remaining assumptions. Charge costs on the modeled fills and value exposure using a declared appropriate market basis, so synthetic prices do not re-enter through fees or equity.

Method and limits

This AI-assisted article synthesizes the linked primary charting documentation and supplies original hypothetical candle calculations, an entry comparison and an audit worksheet. The arithmetic was recomputed; no historical strategy, live order or KLINEO implementation was tested. A corrected price model makes a backtest easier to interpret. It does not establish a profitable signal or future returns.

Keep the context with the example.

Each worked example is illustrative, with its sources and assumptions in the article. Read our editorial standards for authorship, verification and corrections.