Venice 0.751beta
Class GPQuoteBundle

All Implemented Interfaces:

public class GPQuoteBundle
extends EODQuoteBundle

This class is a specialised version of the EODQuoteBundle tailored specifically for the GP. It differs from in that it enforces a window of dates. This window prevents the GP expressions from accessing quotes too far in the past which would slow down calculations (e.g. calculating the average value of a stock for the last 3,000 days), and also prevents GP expressions accessing quotes that would be in their future.

Andrew Leppard
See Also:

Field Summary
Fields inherited from class
quoteBundleCache, quoteCache
Constructor Summary
GPQuoteBundle(EODQuoteBundle quoteBundle, int window)
          Create a new quote bundle for the GP.
Method Summary
 double getQuote(Symbol symbol, int quoteType, int today, int offset)
          Get a stock quote.
 void setQuoteRange(EODQuoteRange quoteRange)
          Set the qutoe range which specifies this quote bundle.
Methods inherited from class
containsQuote, containsQuote, dateToOffset, getAllSymbols, getFirstDate, getFirstOffset, getFirstSymbol, getLastDate, getLastOffset, getNearestQuote, getOffset, getQuote, getQuote, getQuote, getQuoteRange, getSymbols, getSymbols, iterator, offsetToDate, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public GPQuoteBundle(EODQuoteBundle quoteBundle,
                     int window)
Create a new quote bundle for the GP.

quoteBundle - wrap the given quote bundle
window - prevent access to quotes this many days before the first quote in the given quote bundle
Method Detail


public double getQuote(Symbol symbol,
                       int quoteType,
                       int today,
                       int offset)
                throws EvaluationException,
Get a stock quote. This function has been primarily created for Gondola scripts. It passes in the current date and the date offset so that specialised QuoteBundle implementations such as GPQuoteBundle can prevent the GP accessing 'future' dates.

Specified by:
getQuote in interface QuoteBundle
getQuote in class EODQuoteBundle
symbol - the stock symbol
quoteType - the quote type, one of Quote.DAY_OPEN, Quote.DAY_CLOSE, Quote.DAY_LOW, Quote.DAY_HIGH, Quote.DAY_VOLUME
today - fast access date offset of current date, see EODQuoteCache
offset - offset from current date
the quote
EvaluationException - if the script isn't allowed access to the quote.
MissingQuoteException - if the quote was not found


public void setQuoteRange(EODQuoteRange quoteRange)
Set the qutoe range which specifies this quote bundle.

setQuoteRange in class EODQuoteBundle
quoteRange - the new quote range

Venice 0.751beta