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

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


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

    market.clearChanges();

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

    /** Update top of book */
    {

      final PriceValue priceBid = message.getPriceBid();
View Full Code Here


      final MarketDo market, final DDF_Indicator indicator,
      final boolean forceSettle) {

    market.clearChanges();

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

    final PriceValue settle = message.getPriceSettle();
    BooleanValue settled = null;

    // Check settled flag
View Full Code Here

    market.clearChanges();

    final DDF_MessageType tradeType = message.getMessageType();

    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();
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

    text.append(exchangeCode());
    text.append(SPACE);

    addSpreadComponents(text);

    final TimeValue expire = ValueBuilder.newTime(lifetime().stop().millisecond());
    if (!expire.isNull()) {

      text.append(display.timeMonthFull(expire));
      text.append(SPACE);

      text.append(display.timeYearFull(expire));
View Full Code Here

  }

  @Override
  public final boolean equals(final Object thatTime) {
    if (thatTime instanceof TimeValue) {
      final TimeValue that = (TimeValue) thatTime;
      return this.compareTo(that) == 0;
    }
    return false;
  }
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.