Thank for this indicator Apprentice. While it works well on a Marketscope 2.0 chart, it seems to misbehave when using on Strategy Backtester chart. It does not produce any graphical output, and the log error I get is this:
"An error occurred during the calculation of the indicator 'BTF CANDLE'. The error details: BTF Candle.lua:278: BTF Candle.lua:172: (null)."
Since it works in MS2, it is not a big deal, but it would be great if it worked on both.