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

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


    market.clearChanges();
    market.setChange(Component.BOOK_COMBINED);
   
    final MarketDoBookEntry[] entries = message.entries();

    final TimeValue time = message.getTime();

    market.setBookSnapshot(entries, time);
   
    return null;
  }
View Full Code Here


    /* Update changed comonents */
    market.clearChanges();
    market.setChange(Component.BOOK_COMBINED);
   
    final TimeValue time = message.getTime();

    applyTop(message.entry(market.instrument(), Book.Side.BID), time, market);

    applyTop(message.entry(market.instrument(), Book.Side.ASK), time, market);

View Full Code Here

    market.clearChanges();
    market.setChange(Component.CUVOL);
   
    final MarketDoCuvolEntry[] entries = message.entries();

    final TimeValue time = message.getTime();

    market.setCuvolSnapshot(entries, time);
   
    return null;
  }
View Full Code Here

  @Override
  public Void visit(final DDF_MarketParameter message, final MarketDo market) {

    final DDF_ParamType param = message.getParamType();

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

    final DDF_ParamType.Kind kind = param.kind;

    final PriceValue price;
    final SizeValue size;
View Full Code Here

    // ### process session

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

    // ### process snapshot

    final DDF_MarketSnapshot snapshot = message;
    final DDF_Indicator indicator = message.getIndicator();
View Full Code Here

  @Override
  public Void visit(final DDF_MarketSnapshot message, final MarketDo market) {

    market.clearChanges();
   
    final TimeValue time = message.getTime();

    /** Update SETTLE State */
    {

      final PriceValue priceSettle = message.getPriceSettle();
View Full Code Here

      if (isClear(size) || isEmpty(size)) {
        size = ValueConst.NULL_SIZE;
      }

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

      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);

    }
View Full Code Here

    final MarketDoBar bar = loadBar(barType.field);

    eventAdd(barType.event);

    // Reset current bar if session day changes
    final TimeValue prevDate = bar.get(TRADE_DATE);

    if (session == DEFAULT && !prevDate.isNull() && !date.equals(prevDate)) {

      log.debug("New day code: old=" + prevDate + "; new=" + date);

      bar.set(MarketBarField.OPEN, price);
      bar.set(MarketBarField.HIGH, price);
View Full Code Here

  @Override
  public MarketBarType ensureBar(final TimeValue date) {

    final MarketDoBar bar = loadBar(MarketBarType.CURRENT.field);

    final TimeValue currDate = bar.get(MarketBarField.TRADE_DATE);

    if (currDate.equals(date)) {
      return MarketBarType.CURRENT;
    }

    final MarketDoBar prev = loadBar(MarketBarType.PREVIOUS.field);

    // Check for new trading session
    if (currDate.asMillisUTC() < date.asMillisUTC()) {

      // log.debug("New session: old=" + currDate + "; new=" + date);

      // Roll values to previous
      prev.copy(bar);

      // Reset current
      bar.clear();
      bar.set(MarketBarField.TRADE_DATE, date);
      // Copy last updated time from previous session for continuity
      bar.set(MarketBarField.BAR_TIME, prev.get(MarketBarField.BAR_TIME));

      // Reset extended
      loadBar(MarketBarType.CURRENT_EXT.field).copy(bar);

      // Notify change tracking
      setBar(MarketBarType.PREVIOUS, prev);
      setBar(MarketBarType.CURRENT, bar);

      return MarketBarType.CURRENT;

    }

    // Check previous bar
    final TimeValue prevDate = prev.get(MarketBarField.TRADE_DATE);

    if (prevDate.isNull()) {
      prev.set(MarketBarField.TRADE_DATE, date);
      return MarketBarType.PREVIOUS;
    } else if (prevDate.equals(date)) {
      return MarketBarType.PREVIOUS;
    }

    // No match, nothing to update
    return MarketBarType.NULL_BAR_TYPE;
View Full Code Here

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

    market.clearChanges();

    final MarketDoBookEntry[] entries = message.entries();
    final TimeValue time = message.getTime();

    market.setBookSnapshot(entries, time);

    return null;
  }
View Full Code Here

TOP

Related Classes of com.barchart.feed.base.values.api.TimeValue

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.