Skip to main content
Track Heikin-Ashi
16 / 16
Library

2013issue C1020-25

Walk-forward tests for color-coded Heikin-Ashi crosses

Candle color can publish a long or short state when a faster typical-price average crosses a slower heikin-ashi average and that bar’s body polarity agrees. This lesson freezes those lengths on an earlier sample, reads the same paint on a later calendar, and keeps a bollinger-bands envelope as the quantitative baseline that can stand down some of the colors.

  • A candle-color overlay can encode a long state on one color change and an exit or short state on the opposite change, while filled and unfilled bodies still record whether the bar closed above or below its open.
  • Color may flip only when the typical-price average crosses the heikin-ashi average and the same bar meets the polarity-lock. Otherwise the held-state rule keeps the previous long or short color.
  • Walk-forward analysis searches candidate lengths on an earlier sample, freezes them, and then applies the same color rules to a later window.
  • The painted expert is confirmation only. A bollinger-bands envelope from the same swing-rule stack remains in place to stand down some of the colors it proposes.
Entries in this reading3 entries

Candle color as a state claim

A candle-color overlay can encode a long state on one color change and an exit or short state on the opposite color change. Filled versus unfilled bodies still record whether that bar closed above or below its open.

Editorial reading: treat that paint as a published regime claim, not as decoration.

Simple average-cross rules are described as workable mainly when prices trend and as prone to unhelpful flips otherwise. Extra conditions are added before a cross is allowed to change state.

A slower heikin-ashi rail and a faster typical-price rail

Heikin-ashi is a recalculated open-high-low-close transform whose derived close becomes the slower, smoother rail of the dual-average color state. That close is presented as the stronger smoother and is generally one bar later than the raw close.

The fast series is typical price, defined as the mean of high, low, and close, and then exponentially averaged. Default construction applies an eight-bar exponential average to the heikin-ashi close and a five-bar exponential average to typical price.

Color state flips only when the typical-price average crosses the heikin-ashi average and the same bar’s close-versus-open polarity agrees. The polarity-lock requires that the bar’s close sit on the same side of its open as the intended new state. If that joint test fails, the held-state rule keeps the previous long or short color.

Freeze the lengths, then read the later calendar

Average lengths are not treated as universal. A strategy wrapper is used so candidate heikin-ashi and typical-price lengths, plus stop and breakeven inputs, can be searched on historical bars.

Walk-forward analysis fits those lengths and protective stops on an earlier sample, freezes them, and then reads the same color rules on a later sample. An in-sample search from January 2005 through January 2010 is used to freeze lengths. The same frozen rules are then applied to a later window from January 2010 through January 2013.

Equal six-bar lengths were discarded because the two averages would travel together and could generate extra later crosses. A six-and-four pair was retained as nearer the visual eight-and-five default.

Stops locked after the rails

After lengths were frozen, emergency stop and breakeven were searched separately, with chart fit preferred over extreme optimizer scores. A 9 percent stop with a 10 percent breakeven was locked before the later-window run.

Editorial reading: keep the volatility-band envelope in the same lesson so the out-of-sample colors are judged against that explicit quantitative baseline rather than trusted on sight.

Walk-forward average win versus loss on CIEN

On the 2010–2013 out-of-sample window the color-coded Heikin-Ashi / typical-price cross still showed a positive expectancy: the average winner was 11.53 percent against a 4.56 percent average loser, so a 42 percent hit rate was enough. Longs had the larger average win; shorts were closer to even. Values are the Average Trade, Average Winning Trade, and Average Losing Trade rows from the NinjaTrader summary for all, long, and short trades.
On the 2010–2013 out-of-sample window the color-coded Heikin-Ashi / typical-price cross still showed a positive expectancy: the average winner was 11.53 percent against a 4.56 percent average loser, so a 42 percent hit rate was enough. Longs had the larger average win; shorts were closer to even. Values are the Average Trade, Average Winning Trade, and Average Losing Trade rows from the NinjaTrader summary for all, long, and short trades.CIEN · Daily · 2010-01-01T00:00:00.000Z to 2013-01-01T00:00:00.000Z

Heikin-ashi length 6 and typical-price length 4 were frozen from the 2005–2010 search; the walk-forward then used a 9 percent emergency stop, a 10 percent breakeven, and 100-share size.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
16 of 16 in the Heikin-Ashi track
2006Track finished · Next track: Highpass filterConstructing lowpass, highpass, and finite impulse response filters from one recurrence14 readings
All readings on this track · 16 readings
  1. 2004Reconstructing Heikin-Ashi bars from smoothed OHLC
  2. 2004Heikin-Ashi candle construction as an OHLC transform
  3. 2004Stacking heikin-ashi, swing charts, and a moving average in strong trends
  4. 2007Constructing a Heikin-Ashi volume-price oscillator
  5. 2007A volume-price oscillator is a timing trigger, not a standalone entry
  6. 2008Heikin-Ashi OHLC construction and simplification
  7. 2008How a Heikin-Ashi candlestick oscillator is built from color, lag, and hold rules
  8. 2008Heikin-Ashi color-coded candles and smoothed trend filters
  9. 2010Heikin-Ashi smoothed percent b for divergence timing
  10. 2011Constructing Heikin-Ashi, moving-average, and MACD filters
  11. 2011Constructing candlestick, Elliott-wave, and Heikin-Ashi hypotheses
  12. 2012Constructing a three-state Heikin-Ashi trend filter
  13. 2012Heikin-ashi as a trend-state signal without candlestick-patterns
  14. 2013Heikin-Ashi volume gates, smoothing, and denominator floors
  15. 2013How Heikin-Ashi close and typical-price form a two-average crossover
  16. 2013Walk-forward tests for color-coded Heikin-Ashi crosses
All 17 readings tagged Heikin-Ashi
Also on Heikin-Ashi5 readings