Package org.springframework.nanotrader.data.domain

Examples of org.springframework.nanotrader.data.domain.Quote


  
  public Message<Quote> aggregate(List<Message<?>> messages) {
    log.info("Aggregator released " + messages.size() + " message(s) at: " + new Date(System.currentTimeMillis()));
    //Just use the last message in the List of Messages
    Quote quote = (Quote) messages.get(messages.size() -1).getPayload();
    Message<Quote> aggregatedMessage = MessageBuilder.withPayload(quote).build();
    if (log.isDebugEnabled()) {
      log.debug("QuoteAggregator.aggregate() released aggregate quote = " + quote);
    }
    return aggregatedMessage;
View Full Code Here


  @Autowired
  QuoteRepository quoteRepository;

  @Before
  public void setupMocks() {
    Quote quote = new Quote();
    quote.setSymbol("VMW");
    quote.setPrice(BigDecimal.valueOf(120.0));
    quote.setVolume(BigDecimal.valueOf(1000));
    quote.setOpen1(BigDecimal.valueOf(115.0));
    quote.setHigh(BigDecimal.valueOf(130.0));
    quote.setLow(BigDecimal.valueOf(1.0));
    Mockito.when(quoteRepository.findBySymbol("VMW")).thenReturn(quote);
  }
View Full Code Here

    Holding holding = holdingDataOnDemand.getNewTransientHolding(100);
    holding.setPurchasedate(new java.sql.Date(System.currentTimeMillis()));
    tradingService.saveHolding(holding);
    entityManager.flush();
    entityManager.clear(); // force reload
        Quote quote = new Quote();
        quote.setSymbol("quoteSymbol_100");
        quote.setPrice(BigDecimal.valueOf(50.00));
        quote.setChange1(BigDecimal.valueOf(5.00));
        quote.setVolume( BigDecimal.valueOf(50000));
        quoteService.saveQuote(quote);
        entityManager.flush();
    entityManager.clear(); // force reload
        Assert.assertNotNull("Expected 'Quote' identifier to no longer be null", quote.getQuoteid());
    PortfolioSummary portfolioSummary = tradingService.findPortfolioSummary(100);
    Assert.assertTrue("Expected 'PortfolioSummary' holding count to be equal to 1", portfolioSummary.getNumberOfHoldings() == 1);


  }
View Full Code Here

TOP

Related Classes of org.springframework.nanotrader.data.domain.Quote

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.