Package com.barchart.util.value.api

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


        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


    builder.setDescription(inst.description());
   
    builder.setRecordCreateTime(System.currentTimeMillis());
    builder.setRecordUpdateTime(System.currentTimeMillis());
   
    final Price tickSize = inst.tickSize();
   
    builder.setMinimumPriceIncrement(Decimal.newBuilder()
        .setMantissa(tickSize.mantissa())
        .setExponent(tickSize.exponent()));
   
    final Fraction frac = inst.displayFraction();
   
    builder.setDisplayBase((int) frac.base());
    builder.setDisplayExponent(frac.exponent());
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

        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

  }

  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

    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

  }

  @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

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.