public static double getClosingRange(
      InstrumentPriceModel currentPrice, InstrumentPriceModel lastPrice) {
    final BigDecimal close = currentPrice.getClose();
    final BigDecimal low = currentPrice.getLow();

    BigDecimal high = null;
    if (lastPrice != null
        && lastPrice.getLow().doubleValue() > currentPrice.getHigh().doubleValue()) {
      // this is a gap down
      high = lastPrice.getClose();
    } else {
      high = currentPrice.getHigh();
    }

    return ((close.doubleValue() - low.doubleValue()) * 100)
        / (high.doubleValue() - low.doubleValue());
  }
  private boolean isPriceAtSupport(final InstrumentPriceModel tick, BigDecimal pricePoint) {

    // calc % from ma
    final double lowPctFromPoint =
        100 * (tick.getLow().doubleValue() - pricePoint.doubleValue()) / pricePoint.doubleValue();
    final double closePctFromPoint =
        100 * (tick.getClose().doubleValue() - pricePoint.doubleValue()) / pricePoint.doubleValue();

    if (lowPctFromPoint <= LOW_THRESHOLD && lowPctFromPoint >= -LOW_THRESHOLD) {
      return true;
    } else if (closePctFromPoint < CLOSE_THRESHOLD && closePctFromPoint > -CLOSE_THRESHOLD) {
      return true;
    }

    return false;
  }