At first, this question can sound really stupid, but it is not in fundamental. Maybe, it can seem like unresolvable exactly by any algorithm, but I pretend to say it is.
I might not fully understand but why can't you just take the lowest point for a specific time range? Most data providers do provide high/low of the day, can you not just store it and then simply get the lowest value for time range x?
By extending the range of your study you remove the small ups/downs. This is what I typically do. Another way is, you can use averages of the last X days to smooth out the results(moving averages) but then you'll lose accuracy(degree is dependent on range..if its a 2-3 days moving average than its not as bad a 2 year moving average).
EDIT: sorry, I miss understood, you are trying to find the range. Well if you have the data then why not find the lowest point(s) first and then go to the next day and figure out the % change, then the next, etc..and overwrite the day when you find a higher range. You'll need to add some more logic later(such as %down from that peak or something) otherwise you'll report will typically take the stock's ipo and take its all that high and say thats a single period.