code: private double[] findMinMax(double[] lows, double[] highs) {
  
      double min = Double.MAX_VALUE;
      double max = -Double.MAX_VALUE;
  
      for (int i = 0; i < highs.length; i++) {
  
        if (!Double.isNaN(highs[i]) && highs[i] > max) {
          max = highs[i];
        }
        if (!Double.isNaN(lows[i]) && lows[i] < min) {
          min = lows[i];
        }
      }
  
      return new double[] {min, max};
    }
docs: Finds the min and max of a dataset
  
  @param lows
  @param highs
  @return