I need a script that will track and show the high and low points for different indicators. For this case we can use iMa (22 periods) but I will be switching out the iMa with different indicators, so this must be written flexibly to allow for the use of other indicators.
I need arrows shown at high and low points, similar to this:
but it is showing high/low points for price. I need the script to show the same thing for an indicator like iMa or ATR. I will update the code to switch out to the indicator that I need after the script is written.
I need two buffers, one holding the highs and one holding the low candles. The script must also include a threshold that must be met so that if the threshold difference is not met then the arrow is not drawn.