Package quickfix.fix44

Examples of quickfix.fix44.MarketDataSnapshotFullRefresh


    Ticker oldTicker = getTicker();

    String messageData = getMessageData("X.txt");

    MarketDataIncrementalRefresh message = new MarketDataIncrementalRefresh();
    message.fromString(messageData, dataDictionary, true);

    log.debug(message.toXML(dataDictionary));

    Ticker ticker = BTCChinaFIXAdapters.adaptUpdate(oldTicker, message);

    assertEquals(CurrencyPair.BTC_CNY, ticker.getCurrencyPair());
    assertEquals(1413482716000L, ticker.getTimestamp().getTime());
View Full Code Here


    return marketDataRequest(symbol, SubscriptionRequestType.DISABLE_PREVIOUS_SNAPSHOT_PLUS_UPDATE_REQUEST);
  }

  private static Message marketDataRequest(String symbol, char subscriptionRequestType) {

    MarketDataRequest tickerRequest = new MarketDataRequest();

    NoRelatedSym noRelatedSym = new NoRelatedSym();
    noRelatedSym.set(new Symbol(symbol));
    tickerRequest.addGroup(noRelatedSym);

    tickerRequest.set(new MDReqID("123")); // any value
    tickerRequest.set(new SubscriptionRequestType(subscriptionRequestType));
    tickerRequest.set(new MarketDepth(0));

    addMDType(tickerRequest, MDEntryType.BID);
    addMDType(tickerRequest, MDEntryType.OFFER);
    addMDType(tickerRequest, MDEntryType.TRADE);
    addMDType(tickerRequest, MDEntryType.INDEX_VALUE);
View Full Code Here

    return tickerRequest;
  }

  private static void addMDType(MarketDataRequest tickerRequest, char type) {

    NoMDEntryTypes g = new NoMDEntryTypes();
    g.set(new MDEntryType(type));
    tickerRequest.addGroup(g);
  }
View Full Code Here

  private static Message marketDataRequest(String symbol, char subscriptionRequestType) {

    MarketDataRequest tickerRequest = new MarketDataRequest();

    NoRelatedSym noRelatedSym = new NoRelatedSym();
    noRelatedSym.set(new Symbol(symbol));
    tickerRequest.addGroup(noRelatedSym);

    tickerRequest.set(new MDReqID("123")); // any value
    tickerRequest.set(new SubscriptionRequestType(subscriptionRequestType));
    tickerRequest.set(new MarketDepth(0));
View Full Code Here

  private Ticker getTicker() throws IOException, InvalidMessage, FieldNotFound {

    String messageData = getMessageData("W.txt");

    MarketDataSnapshotFullRefresh message = new MarketDataSnapshotFullRefresh();
    message.fromString(messageData, dataDictionary, true);

    log.debug(message.toXML(dataDictionary));

    Ticker ticker = BTCChinaFIXAdapters.adaptTicker(message);
    return ticker;
  }
View Full Code Here

            exchange.getIn().setHeader(QuickfixjEndpoint.SESSION_ID_KEY, sessionID);
            exchange.getIn().setBody(data);
           
            Message message = exchange.getIn().getBody(Message.class);
           
            NoHops hop = new NoHops();
            message.getHeader().getGroup(1, hop);
            assertEquals("FOO", hop.getString(HopCompID.FIELD));
            message.getHeader().getGroup(2, hop);
            assertEquals("BAR", hop.getString(HopCompID.FIELD));

        } finally {
            quickfixjEngine.stop();
        }
    }
View Full Code Here

            exchange.setProperty(QuickfixjEndpoint.DATA_DICTIONARY_KEY, new DataDictionary("FIX44.xml"));
            exchange.getIn().setBody(data);
           
            Message message = exchange.getIn().getBody(Message.class);
           
            NoHops hop = new NoHops();
            message.getHeader().getGroup(1, hop);
            assertEquals("FOO", hop.getString(HopCompID.FIELD));
            message.getHeader().getGroup(2, hop);
            assertEquals("BAR", hop.getString(HopCompID.FIELD));

        } finally {
            quickfixjEngine.stop();
        }
    }
View Full Code Here

            exchange.setProperty(QuickfixjEndpoint.DATA_DICTIONARY_KEY, "FIX44.xml");
            exchange.getIn().setBody(data);
           
            Message message = exchange.getIn().getBody(Message.class);
           
            NoHops hop = new NoHops();
            message.getHeader().getGroup(1, hop);
            assertEquals("FOO", hop.getString(HopCompID.FIELD));
            message.getHeader().getGroup(2, hop);
            assertEquals("BAR", hop.getString(HopCompID.FIELD));

        } finally {
            quickfixjEngine.stop();
        }
    }
View Full Code Here

            exchange.getIn().setHeader(QuickfixjEndpoint.SESSION_ID_KEY, sessionID);
            exchange.getIn().setBody(data);
           
            Message message = exchange.getIn().getBody(Message.class);
           
            NoHops hop = new NoHops();
            message.getHeader().getGroup(1, hop);
            assertEquals("FOO", hop.getString(HopCompID.FIELD));
            message.getHeader().getGroup(2, hop);
            assertEquals("BAR", hop.getString(HopCompID.FIELD));

        } finally {
            quickfixjEngine.stop();
        }
    }
View Full Code Here

            exchange.setProperty(QuickfixjEndpoint.DATA_DICTIONARY_KEY, new DataDictionary("FIX44.xml"));
            exchange.getIn().setBody(data);
           
            Message message = exchange.getIn().getBody(Message.class);
           
            NoHops hop = new NoHops();
            message.getHeader().getGroup(1, hop);
            assertEquals("FOO", hop.getString(HopCompID.FIELD));
            message.getHeader().getGroup(2, hop);
            assertEquals("BAR", hop.getString(HopCompID.FIELD));

        } finally {
            quickfixjEngine.stop();
        }
    }
View Full Code Here

TOP

Related Classes of quickfix.fix44.MarketDataSnapshotFullRefresh

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.