Look up the real candle behind a Heiken-Ashi bar

Look up the real candle behind a Heiken-Ashi bar

Write down both kinds of input

For the real bar take open 101, high 105, low 100 and close 104. For the preceding Heiken-Ashi bar assume a synthetic open of 96 and close of 100. The preceding synthetic pair matters because the displayed open is recursive. Looking up the previous raw open and close would seed a different candle.

Construct the four displayed prices

The synthetic close is the average of the four real prices, or 102.5. The synthetic open is the midpoint of the previous synthetic pair, or 98. The displayed high is the greatest of 105, 98 and 102.5; the displayed low is the least of 100, 98 and 102.5. The resulting candle extends down to 98.

HA close = (101 + 105 + 100 + 104) / 4 = 102.5

Check an apparent fill

The actual low on this bar was 100. A backtest recording an execution at 98 simply because the synthetic candle touched it has used an artificial level as a tradable quote. Keep signal inputs and fill inputs as separate columns. For a fill claim inspect the applicable bid or ask and the available tick history.

Reconcile with MT5

Read the ordinary candle and the indicator values at the same timestamp in the Data Window. Compare the synthetic close first because it depends only on this bar. If the close matches but the open differs, work backward through the previous synthetic pair and the chosen starting history.

Sources and further reading

Back to top

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.80

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping