|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.quote.IDQuoteBundle
public class IDQuoteBundle
When a task requires intra-day stock quotes, it should create an instance of this class
which represents all the task's required quotes. The task can then access quotes
from this class, which in turn reads its stock quotes from the global intra-day quote
cache - IDQuoteCache
. To be notified of new intra-day quotes call
IDQuoteCache.addQuoteListener(org.mov.quote.QuoteListener)
.
Example:
IDQuoteBundle quoteBundle = new IDQuoteBundle("CBA"); try { double = quoteBundle.getQuote("CBA", Quote.ASK, 0); } catch(QuoteNotLoadedException e) { //... }
IDQuote
,
IDQuoteCache
,
EODQuoteBundle
,
Symbol
Constructor Summary | |
---|---|
IDQuoteBundle(java.util.List symbols)
Create a new intra-day quote bundle containing all today's quotes for the given symbols. |
Method Summary | |
---|---|
int |
getFirstOffset()
Return the fast access offset for the earliest quote in the bundle. |
int |
getLastOffset()
Return the fast access offset for the latest quote in the bundle. |
int |
getOffset(Quote quote)
Retrieve the fast access offset from the given quote. |
Quote |
getQuote(Symbol symbol,
int timeOffset)
Get a stock quote. |
double |
getQuote(Symbol symbol,
int quoteType,
int timeOffset)
Get a stock quote. |
double |
getQuote(Symbol symbol,
int quoteType,
int now,
int timeOffset)
Get a stock quote. |
TradingDate |
offsetToDate(int timeOffset)
Convert between a fast access offset to an actual date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IDQuoteBundle(java.util.List symbols)
symbols
- the quote symbolsMethod Detail |
---|
public double getQuote(Symbol symbol, int quoteType, int now, int timeOffset) throws EvaluationException, MissingQuoteException
QuoteBundle
getQuote
in interface QuoteBundle
symbol
- the stock symbolquoteType
- the quote type, e.g. Quote.DAY_OPEN
, Quote.DAY_CLOSE
,
Quote.DAY_LOW
, Quote.DAY_HIGH
, Quote.DAY_VOLUME
now
- fast access offset of current quote, for end-of-day quotes this
is the fast access date offset (see EODQuoteCache
). For
intra-day quotes, it is the fast access time offset (see
IDQuoteCache
).timeOffset
- modifier offset to fast access offset
EvaluationException
- if the script isn't allow access to the quote.
MissingQuoteException
- if the quote was not foundpublic double getQuote(Symbol symbol, int quoteType, int timeOffset) throws MissingQuoteException
QuoteBundle
getQuote
in interface QuoteBundle
symbol
- the stock symbolquoteType
- the quote type, one of Quote.DAY_OPEN
, Quote.DAY_CLOSE
,
Quote.DAY_LOW
, Quote.DAY_HIGH
, Quote.DAY_VOLUME
timeOffset
- fast access offset of current quote, for end-of-day quotes this
is the fast access date offset (see EODQuoteCache
). For
intra-day quotes, it is the fast access time offset (see
IDQuoteCache
).
MissingQuoteException
- if the quote was not foundpublic Quote getQuote(Symbol symbol, int timeOffset) throws MissingQuoteException
QuoteBundle
getQuote
in interface QuoteBundle
symbol
- the stock symboltimeOffset
- fast access offset of current quote, for end-of-day quotes this
is the fast access date offset (see EODQuoteCache
). For
intra-day quotes, it is the fast access time offset (see
IDQuoteCache
).
MissingQuoteException
- if the quote was not foundpublic TradingDate offsetToDate(int timeOffset)
QuoteBundle
offsetToDate
in interface QuoteBundle
timeOffset
- fast access offset, see EODQuoteCache
public int getOffset(Quote quote)
getOffset
in interface QuoteBundle
quote
- quote
public int getFirstOffset()
getFirstOffset
in interface QuoteBundle
public int getLastOffset()
getLastOffset
in interface QuoteBundle
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |