A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I used to mess around with this sort of stuff a few years ago.
Let's see if I've got this right:
Talking first only about upward price movement; within your chosen interval (50 minutes) you want to know what happens if you buy at the open of that 50 minutes, what the greatest movement up is (and when it happens) before that 50 minutes is over or before the price drops below the buy price, whichever happens sooner?
If this is right, then, if available to you, you could use the Highs and Lows data too. Whether or not you have High/Low data, I'd use a different method.
I'll await confirmation that I've got the concept right.