No changes to any functional code, I just wanted to post a quick clarification to the note about using this to back-test with HA candles in bar replay mode...
As the base chart type will still technically be normal candles, any additional indicators that you add to the chart will calculate based on normal candle values for open, high, low, and close instead of the Heiken Ashi values!
Let's use the EMA as an example...
On a normal Heiken Ashi chart using the built-in Moving Average Exponential indicator with a price source of "close", the EMA calculation would be performed using the HA value for "close" (which is the average of the actual open, high, low, and close of the candle) instead of the actual close value for that time period. However, if you change the chart type to "Candle", the EMA calculation would shift to using the actual candle closing price value instead of the Heiken Ashi close value, resulting in a new and possibly different EMA line.
This is due to how the default Pinescript variables for "open", "high", "low", and "close" are set by TradingView. The values for these variables are determined by the actual on-screen chart type and corresponding candle values. For a "normal" chart like Bars, Candles, Hollow Candles, etc., the values for these default variables will be the actual open, high, low, and close prices. However, if you change to a different chart type like Heiken Ahsi, Renko, etc., the values for these same variables will change to whatever the post-transformation plotted values on the chart are.
While in most cases this is pretty intuitive and desired behavior, it can present some challenges in cases where you want to reference true price in an indicator when viewing a Heiken Ashi chart, and vice versa.
In this case, since the "bar reply of Heiken Ashi candles" is technically using a true-price bar/candle chart, any additional indicators added to the chart in that mode will be based on true-price values and not Heiken Ashi values. This means that the same additional indicator and settings may display differently than the same indicator and settings on a native Heiken Ashi real-time chart.