Package com.barchart.util.values.api

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


    final int size = map.size();

    final SizeValue[] entries = new SizeValue[size];

    for (int k = 0; k < size; k++) {
      SizeValue volume = map.get(k);
      if (volume == null) {
        volume = ValueConst.NULL_SIZE;
      } else {
        volume = volume.freeze();
      }
      entries[k] = volume;
    }

    return entries;
View Full Code Here


    if(map.size() == 0) {
      System.out.println("Cuvol Map Was Size 0 for " + instrument.symbol());
      return MarketConst.NULL_CUVOL_ENTRY;
    }

    final SizeValue size = map.get(price);

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

      case COMBINED:
        type = Book.Type.COMBINED;
        break;
      }

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

    final TimeValue date = message.getTradeDay().tradeDate();

    final DDF_ParamType.Kind kind = param.kind;

    final PriceValue price;
    final SizeValue size;

    switch (kind) {
    default:
      log.error("wrong kind; treat as size : {}", kind);
    case SIZE:
View Full Code Here

  public Void visit(final DDF_MarketSession message, final MarketDo market) {

    // ### process session

    // TODO are these trade fields?
    final SizeValue sizeLast = message.getSizeLast();
    final TimeValue timeLast = message.getTimeLast();

    // ### process snapshot

    final DDF_MarketSnapshot snapshot = message;
View Full Code Here

      final PriceValue priceOpen = message.getPriceOpen();
      final PriceValue priceHigh = message.getPriceHigh();
      final PriceValue priceLow = message.getPriceLow();
      final PriceValue priceClose = message.getPriceLast(); // XXX
      final PriceValue priceSettle = message.getPriceSettle();
      final SizeValue sizeVolume = message.getSizeVolume();

      applyBar(bar, MarketBarField.OPEN, priceOpen);
      applyBar(bar, MarketBarField.HIGH, priceHigh);
      applyBar(bar, MarketBarField.LOW, priceLow);
      applyBar(bar, MarketBarField.CLOSE, priceClose);
      applyBar(bar, MarketBarField.SETTLE, priceSettle);
      applyBar(bar, MarketBarField.VOLUME, sizeVolume);

      bar.set(MarketBarField.BAR_TIME, time);

      market.setBar(type, bar);

    }

    /** Update PREVIOUS bar */
    {

      /* Update changed comonents */
      market.setChange(Component.DEFAULT_PREVIOUS);
     
      final MarketBarType type = PREVIOUS;

      final MarketDoBar bar = market.loadBar(type.field);
      final PriceValue priceOpen = message.getPriceOpen();
      final PriceValue priceHigh = message.getPriceHigh();
      final PriceValue priceLow = message.getPriceLow();
      final PriceValue priceClose = message.getPriceLastPrevious();
      final PriceValue priceSettle = message.getPriceSettle();
      final SizeValue sizeVolume = message.getSizeVolumePrevious();
      final SizeValue sizeInterest = message.getSizeInterest(); // XXX

      applyBar(bar, MarketBarField.OPEN, priceOpen);
      applyBar(bar, MarketBarField.HIGH, priceHigh);
      applyBar(bar, MarketBarField.LOW, priceLow);
      applyBar(bar, MarketBarField.CLOSE, priceClose);
View Full Code Here

    final PriceValue priceOpen = message.getPriceOpen();
    final PriceValue priceHigh = message.getPriceHigh();
    final PriceValue priceLow = message.getPriceLow();
    final PriceValue priceClose = message.getPriceLast(); // XXX note: LAST
    final PriceValue priceSettle = message.getPriceSettle();
    final SizeValue sizeVolume = message.getSizeVolume();
    final SizeValue sizeInterest = message.getSizeInterest();

    // apply

    applyBar(bar, MarketBarField.OPEN, priceOpen);
    applyBar(bar, MarketBarField.HIGH, priceHigh);
View Full Code Here

    case TRADE: {

      // message "27" : normal trade

      PriceValue price = message.getPrice();
      SizeValue size = message.getSize();

      // TODO review contract on how to clean partial values
      if (isClear(price) || isEmpty(price)) {
        price = ValueConst.NULL_PRICE;
        size = ValueConst.NULL_SIZE;
View Full Code Here

    if (sizeCombo == 0) {
      entry = null;
    } else {
      final int place = placeFromClue(clue);
      final PriceValue price = keyStep().mult(indexFromClue(clue));
      final SizeValue size = newSize(sizeCombo);
      entry = new DefBookEntry(RET_ACT, side(), RET_TYPE, place, price,
          size);
    }
    return entry;
  }
View Full Code Here

      throws ArithmeticException {
    if (entry == null) {
      safeSet(arrayDefault, clue, 0);
      safeSet(arrayImplied, clue, 0);
    } else {
      final SizeValue entrySize = entry.sizeValue();
      final int value;
      if (entrySize == null) {
        value = 0;
      } else {
        // assume can fit
        value = MathExtra.castLongToInt(entrySize.asLong());
      }
      safeSet(arrayFor(entry.type()), clue, value);
    }
    placeUpdate(clue);
  }
View Full Code Here

TOP

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

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.