Python Min-Max Array Calculations for Stocks