This is still not a well-defined problem. You specified that a 10%+ drop from a given date represented such a gap to be recorded, but what if the previous date was higher? That would also be a 10% drop and would result in a gap of the same number of days + 1. Basically, you need to define how a "drop" both ends and begins.
If you can actually completely define the problem, doing it in SQL is no more difficult than doing it in any other logic programming language.
I do have it defined....especially since I've provided the methodology.Then once you have it defined, implementation is straightforward. This is literally just picking data out of a database and doing some division.
Drat - a clever programmer can abstract this problem to work BOTH WAYS.The specification on the chart said the number of days between a High and a Low. Or a Low and a High? But not both.
We just spent two pages teasing the exact description out of you, and I'm still not sure you exactly have it.I do have it defined....especially since I've provided the methodology.
So if it's that easy Dude, why don't you write the code ?