| 
 | Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 symbols| Method Detail | 
|---|
public double getQuote(Symbol symbol,
                       int quoteType,
                       int now,
                       int timeOffset)
                throws EvaluationException,
                       MissingQuoteException
QuoteBundle
getQuote in interface QuoteBundlesymbol - the stock symbolquoteType - the quote type, e.g. Quote.DAY_OPEN, Quote.DAY_CLOSE,
                  Quote.DAY_LOW, Quote.DAY_HIGH, Quote.DAY_VOLUMEnow - 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 found
public double getQuote(Symbol symbol,
                       int quoteType,
                       int timeOffset)
                throws MissingQuoteException
QuoteBundle
getQuote in interface QuoteBundlesymbol - the stock symbolquoteType - the quote type, one of Quote.DAY_OPEN, Quote.DAY_CLOSE,
                  Quote.DAY_LOW, Quote.DAY_HIGH, Quote.DAY_VOLUMEtimeOffset - 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 found
public Quote getQuote(Symbol symbol,
                      int timeOffset)
               throws MissingQuoteException
QuoteBundle
getQuote in interface QuoteBundlesymbol - 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 QuoteBundletimeOffset - fast access offset, see EODQuoteCache
public int getOffset(Quote quote)
getOffset in interface QuoteBundlequote - quote
public int getFirstOffset()
getFirstOffset in interface QuoteBundlepublic 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 | ||||||||