added gradient exclusion in case any of maxUP or minUP or maxDown or minDown is Double.NaN