hi guys...
I have been working on something similar so thought I would chime in...
rather than have the indicator follow price as in a close relative to a moving average, personally I find it more useful to compute a price in advance that signals a 'reversal' if touched. Thus you can see a 'mechanical trigger point' in advance rather than having to wait for a bar to close. I realize this is really only a minor difference in what you are doing but thought I would throw this in anyway.
Linda Rashke just did a presentation using her own indicator here:
https://lbrgroup.com/images//Bloombe.../bloomberg.pdf
her indicator paints the bar depending on where the current bar closes relative to the trailing 16 bar high/low. thus, if in a downtrend -- the bar would be red and switch to green on any close that is above the 16-bar low +2.5 avgtruerange's --- she uses: avgtruerange(9), btw.
I have played around these settings and like 1.5 true ranges better and like computing a price in advance rather than waiting for the bar close -- you can use buy and sell stops to enter when you have the computed price in advance.
Here is an example:
