Venice 0.7beta

org.mov.quote
Interface QuoteSource

All Known Implementing Classes:
DatabaseQuoteSource, FileQuoteSource

public interface QuoteSource

Provides a generic interface in which we can query stock quotes from multiple sources. The source could either be directly from files, a database, a unique internal format or from the internet.

Author:
Andrew Leppard

Method Summary
 boolean containsDate(TradingDate date)
          Returns whether the source contains any quotes for the given date.
 int getAdvanceDecline(TradingDate date)
          Return the advance/decline for the given date.
 java.util.List getDates()
          Return all the dates which we have quotes for.
 java.util.List getExchangeRates(Currency sourceCurrency, Currency destinationCurrency)
          Return all the stored exchange rates between the two currencies.
 TradingDate getFirstDate()
          Return the earliest date we have any stock quotes for.
 TradingDate getLastDate()
          Return the latest date we have any stock quotes for.
 Symbol getSymbol(java.lang.String partialCompanyName)
          Returns the symbol associated with the given company.
 java.lang.String getSymbolName(Symbol symbol)
          Returns the company name associated with the given symbol.
 boolean isMarketIndex(Symbol symbol)
          Is the given symbol a market index?
 boolean loadQuoteRange(EODQuoteRange quoteRange)
          Load the given quote range into the quote cache.
 void shutdown()
          Shutdown the quote source.
 boolean symbolExists(Symbol symbol)
          Returns whether we have any quotes for the given symbol.
 

Method Detail

getSymbolName

java.lang.String getSymbolName(Symbol symbol)
Returns the company name associated with the given symbol.

Parameters:
symbol - the stock symbol
Returns:
the company name

getSymbol

Symbol getSymbol(java.lang.String partialCompanyName)
Returns the symbol associated with the given company.

Parameters:
partialCompanyName - a partial company name
Returns:
the company symbol

symbolExists

boolean symbolExists(Symbol symbol)
Returns whether we have any quotes for the given symbol.

Parameters:
symbol - the symbol we are searching for
Returns:
whether the symbol was found or not

getLastDate

TradingDate getLastDate()
Return the latest date we have any stock quotes for.

Returns:
the most recent quote date

getFirstDate

TradingDate getFirstDate()
Return the earliest date we have any stock quotes for.

Returns:
the oldest quote date

loadQuoteRange

boolean loadQuoteRange(EODQuoteRange quoteRange)
Load the given quote range into the quote cache.

Parameters:
quoteRange - the range of quotes to load
Returns:
TRUE if the operation suceeded
See Also:
EODQuoteCache

containsDate

boolean containsDate(TradingDate date)
Returns whether the source contains any quotes for the given date.

Parameters:
date - the date
Returns:
wehther the source contains the given date

getDates

java.util.List getDates()
Return all the dates which we have quotes for.

Returns:
a vector of dates

isMarketIndex

boolean isMarketIndex(Symbol symbol)
Is the given symbol a market index?

Parameters:
symbol - to test
Returns:
yes or no

getAdvanceDecline

int getAdvanceDecline(TradingDate date)
                      throws MissingQuoteException
Return the advance/decline for the given date. This returns the number of all ordinary stocks that rose (day close > day open) - the number of all ordinary stocks that fell.

Parameters:
date - the date
Throws:
throws - MissingQuoteException if the date wasn't in the source
MissingQuoteException

getExchangeRates

java.util.List getExchangeRates(Currency sourceCurrency,
                                Currency destinationCurrency)
Return all the stored exchange rates between the two currencies.

Parameters:
sourceCurrency - the currency to convert from
destinationCurrency - the currency to convert to
Returns:
the exchange rate being the number of destinationCurrency that you can buy per sourceCurrency

shutdown

void shutdown()
Shutdown the quote source.


Venice 0.7beta