The highest Nth peak in a given period of bars

Question is what you want to do if there are NO three peaks in given number of bars?
Normally you would just call PeakBars() function with Nth parameter set to your preference and see if it returns number of bars lower than your desired range.

2 Likes