Package com.opengamma.livedata.server

Examples of com.opengamma.livedata.server.FieldHistoryStore


    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.80);
    msg.add(MarketDataRequirementNames.ASK, 50.90);
    msg.add(MarketDataRequirementNames.LAST, 50.89);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(4, normalized.getAllFields().size());
    assertEquals(50.85, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here


   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.80);
    msg.add(MarketDataRequirementNames.ASK, 50.90);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(3, normalized.getAllFields().size());
    assertEquals(50.85, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here

    MarketValueCalculator calculator = new MarketValueCalculator();
   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.LAST, 50.89);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(2, normalized.getAllFields().size());
    assertEquals(50.89, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here

    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.0);
    msg.add(MarketDataRequirementNames.ASK, 100.0);
    msg.add(MarketDataRequirementNames.LAST, 55.12);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(4, normalized.getAllFields().size());
    assertEquals(55.12, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here

    MarketValueCalculator calculator = new MarketValueCalculator();
   
    MutableFudgeMsg historicalMsg = OpenGammaFudgeContext.getInstance().newMessage();
    historicalMsg.add(MarketDataRequirementNames.LAST, 45); // Should never use this
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(historicalMsg);
   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.0);
    msg.add(MarketDataRequirementNames.ASK, 100.0);
    msg.add(MarketDataRequirementNames.LAST, 50.52);
View Full Code Here

    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.0);
    msg.add(MarketDataRequirementNames.ASK, 100.0);
    msg.add(MarketDataRequirementNames.LAST, 44.50);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(4, normalized.getAllFields().size());
    assertEquals(50.0, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here

    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 50.0);
    msg.add(MarketDataRequirementNames.ASK, 100.0);
    msg.add(MarketDataRequirementNames.LAST, 120.0);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(4, normalized.getAllFields().size());
    assertEquals(100.0, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here

    MutableFudgeMsg historicalMsg = OpenGammaFudgeContext.getInstance().newMessage();
    historicalMsg.add(MarketDataRequirementNames.BID, 50.0);
    historicalMsg.add(MarketDataRequirementNames.ASK, 51.0);
    historicalMsg.add(MarketDataRequirementNames.MARKET_VALUE, 50.52);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(historicalMsg);
   
    MutableFudgeMsg newMsg = OpenGammaFudgeContext.getInstance().newMessage();
    newMsg.add(MarketDataRequirementNames.LAST, 50.89);
   
    MutableFudgeMsg normalized = calculator.apply(newMsg, "123", store);
View Full Code Here

    MarketValueCalculator calculator = new MarketValueCalculator();
   
    MutableFudgeMsg historicalMsg = OpenGammaFudgeContext.getInstance().newMessage();
    historicalMsg.add(MarketDataRequirementNames.MARKET_VALUE, 50.52);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(historicalMsg);
   
    MutableFudgeMsg newMsg = OpenGammaFudgeContext.getInstance().newMessage();
   
    MutableFudgeMsg normalized = calculator.apply(newMsg, "123", store);
    assertEquals(1, normalized.getAllFields().size());
View Full Code Here

  }

  public void noMarketValueAvailable() {
    MarketValueCalculator calculator = new MarketValueCalculator();
   
    FieldHistoryStore store = new FieldHistoryStore();
   
    MutableFudgeMsg newMsg = OpenGammaFudgeContext.getInstance().newMessage();
   
    MutableFudgeMsg normalized = calculator.apply(newMsg, "123", store);
    assertEquals(0, normalized.getAllFields().size());
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.server.FieldHistoryStore

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.