Package com.barchart.util.value.api

Examples of com.barchart.util.value.api.Price


  }

  @Override
  public final boolean equals(final Object thatValue) {
    if (thatValue instanceof Price) {
      final Price that = (Price) thatValue;
      return this.compareTo(that) == 0;
    }
    return false;
  }
View Full Code Here


    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

  }

  public static final boolean isStrictMultiple(final Price priceTest,
      final Price priceStep) {
    final long count = priceTest.count(priceStep);
    final Price priceBack = priceStep.mult(count);
    if (priceBack.equals(priceTest)) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

        type = Book.Type.COMBINED;
        break;
      }
      final SizeValue size = LIMIT;
      // TODO ValueConverter
      final Price tempStep = instrument.tickSize();
      final PriceValue step = ValueBuilder.newPrice(tempStep.mantissa(),
          tempStep.exponent());

      final VarBookDDF varBook = new VarBookDDF(instrument, type, size, step);
      final VarBookTopDDF varBookTop = new VarBookTopDDF(varBook);

      set(BOOK, varBook);
View Full Code Here

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if(priceStep.isNull()) {
      log.error("priceStep.isNull(");
      return false;
    }
   
    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isNull() || priceStep.isZero()) {
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

          type = Book.Type.COMBINED;
          break;
      }
      final SizeValue size = LIMIT;
      // TODO ValueConverter
      final Price tempStep = instrument.tickSize();
      final PriceValue step = ValueBuilder.newPrice(tempStep.mantissa(),
          tempStep.exponent());

      final VarBookDDF varBook = new VarBookDDF(instrument, type, size, step);
      final VarBookTopDDF varBookTop = new VarBookTopDDF(varBook);

      set(BOOK, varBook);
View Full Code Here

        type = Book.Type.COMBINED;
        break;
      }
      final SizeValue size = LIMIT;
      // TODO ValueConverter
      final Price tempStep = instrument.tickSize();
      final PriceValue step = ValueBuilder.newPrice(tempStep.mantissa(),
          tempStep.exponent());

      final VarBookDDF varBook = new VarBookDDF(instrument, type, size, step);
      final VarBookTopDDF varBookTop = new VarBookTopDDF(varBook);

      set(BOOK, varBook);
View Full Code Here

    if (instrument.isNull()) {
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

TOP

Related Classes of com.barchart.util.value.api.Price

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.