Thank you for you post. Simply brilliant.
I can see I was all backwards in my original logic. I'm now trying to apply a "filter" to your code to exclude those peaks / troughs that result from price rapidly crossing above or below the SMA. Something along the lines of where upbar & downbar are within 4 bars of each other.
Again thank you.
Shannon

Comment