Indicators
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.















