Get a list of every stock that was being traded during the time period, and how much each went up or down every day. Find the one whose value went up the most each day. Say ABC Company went up the most on day 1, DEF Inc went up the most on day 2, etc. If you had spent all your available cash to buy ABC on day 1, sold it on day 2 and bought DEF, etc, you would have the maximum possible profit.
Of course this assumes that the amount that you are investing is not large enough that your buys and sells make a measurable difference in the market. If you're investing a billion dollars, then you would have to somehow determine how much your transactions would have changed the market. In real life there's no way you could know that.
And frankly, I think the exercise would be useless. In any given day there are always stocks that have some ridiculous increase in price because of one factor or another, or just statistical noise. Like I see that on January 18, J Alexander went up an incredible 9% in one day. Magnachip Semiconductors went up 11%. And Five Oaks Investments went up 27%! If you really could predict the one stock whose value will increase the most tomorrow, and you could consistently do this every day, you could have profits of at least 10% PER DAY, or approximately 128 quadrillion percent per year with compounding. The catch, of course, is that no one can predict what stock is going to go up the most every day for a year.
Well, I just checked and find that all the stocks on all the stock exchanges in the world are worth a total of about $70 trillion. So if you started with $1,000 and made 10% per day profit, after 262 days you would own all the stock in all the publicly traded companies in the world. After that you presumably couldn't make any more money trading because there is no one to trade with. You own it all.
So you really need a more realistic standard. What's the most I could have realistically made if I ... but if I what? What's the plausible expectation versus the maximum amount theoretically possible? I don't know how you could determine that, or what the criteria would be. Maybe a realistic standard to compare to would be, What was the highest return earned by any mutual fund on the market? Or something like that.