Package com.barchart.feed.base.values.api

Examples of com.barchart.feed.base.values.api.SizeValue


    final TimeValue time = message.getTime();
    final TimeValue date = message.getTradeDay().tradeDate();
    final DDF_Session ddfSession = message.getSession();

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

    if (isClear(price) || isEmpty(price)) {
      price = ValueConst.NULL_PRICE;
      size = ValueConst.NULL_SIZE;
    }
View Full Code Here


      final TimeValue time) {

    assert price != null;
    assert size != null;

    SizeValue volume = map.get(price);

    if (volume == null) {
      volume = size;
    } else {
      volume = volume.add(size);
    }

    map.put(price, volume);

    priceLast = price;
View Full Code Here

  public final DefCuvol freeze() {

    final SizeValue[] entries = entries();

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

    final DefCuvol that = new DefCuvol(
        instrument,
        entries,
View Full Code Here

    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) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }

    final SizeValue size = map.get(price);

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

          break;
        case COMBINED:
          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());
View Full Code Here

    final MarketDoBar bar = loadBar(barType.field);

    eventAdd(barType.event);

    final SizeValue volumeOld = bar.get(VOLUME);

    if (volumeOld.isNull()) {
      bar.set(VOLUME, size);
    } else {
      final SizeValue volumeNew = volumeOld.add(size);
      bar.set(VOLUME, volumeNew);
    }

    eventAdd(NEW_VOLUME);
View Full Code Here

  }

  @Override
  public final boolean equals(Object thatSize) {
    if (thatSize instanceof SizeValue) {
      SizeValue that = (SizeValue) thatSize;
      return this.asLong() == that.asLong();
    }
    return false;
  }
View Full Code Here

          break;
        case COMBINED:
          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());
View Full Code Here

    final MarketDoBar bar = loadBar(barType.field);

    eventAdd(barType.event);

    final SizeValue volumeOld = bar.get(VOLUME);

    if (volumeOld.isNull()) {
      bar.set(VOLUME, size);
    } else {
      final SizeValue volumeNew = volumeOld.add(size);
      bar.set(VOLUME, volumeNew);
    }

    eventAdd(NEW_VOLUME);
View Full Code Here

TOP

Related Classes of com.barchart.feed.base.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.