Package com.barchart.util.values.api

Examples of com.barchart.util.values.api.PriceValue


    MarketCuvol cuvol = get(CUVOL);

    if (cuvol.isFrozen()) {

      // TODO Value Converter
      final PriceValue priceStep = ValueBuilder.newPrice(
          instrument.tickSize().mantissa(),
          instrument.tickSize().exponent());

      final VarCuvol varCuvol = new VarCuvol(instrument, priceStep);
      final VarCuvolLast varCuvolLast = new VarCuvolLast(varCuvol);
View Full Code Here


      }

      final SizeValue size = LIMIT; // inst.get(BOOK_SIZE);
     
      // ValueConverter
      final PriceValue step = ValueBuilder.newPrice(
          instrument.tickSize().mantissa(),
          instrument.tickSize().exponent());

      final VarBook varBook = new VarBook(instrument, type, size, step);
      final VarBookLast varBookLast = new VarBookLast(varBook);
View Full Code Here

  }

  protected final boolean isValidPrice(final PriceValue price) {

    //TODO Value Converter
    final PriceValue priceStep = ValueBuilder.newPrice(
        instrument.tickSize().mantissa(),
        instrument.tickSize().exponent());

    if (!price.equalsScale(priceStep)) {
      log.error("not normalized");
      return false;
    }

    final long count = price.count(priceStep);

    final PriceValue priceTest = priceStep.mult(count);

    if (!price.equals(priceTest)) {
      log.error("does not fit step");
      return false;
    }
View Full Code Here

      builder.setExchangeCode(inst.get(EXCHANGE_CODE).toString());
    }

    /* price step / increment size / tick size */
    if (inst.contains(TICK_SIZE)) {
      final PriceValue step = inst.get(TICK_SIZE).norm();
      builder.setMinimumPriceIncrement(build(step));
    }

    /* value of a future contract / stock share */
    if (inst.contains(POINT_VALUE)) {
      final PriceValue val = inst.get(POINT_VALUE).norm();
      builder.setContractPointValue(build(val));
    }

    /* display fraction base : decimal(10) vs binary(2), etc. */
    if (inst.contains(DISPLAY_FRACTION)) {
View Full Code Here

        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);
View Full Code Here

    return get(InstrumentField.EXCHANGE_CODE).toString();
  }

  @Override
  public Price tickSize() {
    final PriceValue temp = get(InstrumentField.TICK_SIZE);
    return factory.newPrice(temp.mantissa(), temp.exponent());
  }
View Full Code Here

    return factory.newPrice(temp.mantissa(), temp.exponent());
  }

  @Override
  public Price pointValue() {
    final PriceValue temp = get(InstrumentField.POINT_VALUE);
    return factory.newPrice(temp.mantissa(), temp.exponent());
  }
View Full Code Here

  }

  @Override
  public final MarketCuvolEntry getLastEntry() {

    final PriceValue price = priceLast;

    if (price == null) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }
   
View Full Code Here

  }
 
  @Override
  public PriceValue priceGap() {

    final PriceValue priceBid = priceTop(Book.Side.BID);
    if (priceBid.isNull()) {
      return ValueConst.NULL_PRICE;
    }

    final PriceValue priceAsk = priceTop(Book.Side.ASK);
    if (priceAsk.isNull()) {
      return ValueConst.NULL_PRICE;
    }

    return priceAsk.sub(priceBid);

  }
View Full Code Here

    MarketCuvol cuvol = get(CUVOL);
   
    if (cuvol.isFrozen()) {

      // TODO Value Converter
      final PriceValue priceStep = ValueBuilder.newPrice(
          instrument.tickSize().mantissa(),
          instrument.tickSize().exponent());

      if(priceStep.mantissa() == 0) {
        System.out.println();
      }
     
      final VarCuvol varCuvol = new VarCuvol(instrument, priceStep);
      final VarCuvolLast varCuvolLast = new VarCuvolLast(varCuvol);
View Full Code Here

TOP

Related Classes of com.barchart.util.values.api.PriceValue

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.