OpenMAMA
Wombat::MamdaOptionContract Class Reference

A class that represents a single option contract. More...

#include <MamdaOptionContract.h>

Public Member Functions

 MamdaOptionContract (const char *symbol, const char *exchange, const MamaDateTime &expireDate, double strikePrice, MamdaOptionPutCall putCall)
 Constructor from expiration date, strike price, and put/call indicator. More...
 
 MamdaOptionContract (const char *symbol, const char *exchange)
 Constructor without expiration date, strike price, and put/call indicator. More...
 
 ~MamdaOptionContract ()
 Destructor. More...
 
void setExpireDate (const MamaDateTime &expireDate)
 Set the expiration date. More...
 
void setStrikePrice (double strikePrice)
 Set the strike price. More...
 
void setPutCall (MamdaOptionPutCall putCall)
 Set the put/call indicator. More...
 
void setOpenInterest (uint32_t openInterest)
 Set the open interest size. More...
 
void setExerciseStyle (MamdaOptionExerciseStyle exerciseStyle)
 Set the exercise style. More...
 
void setRecapRequired (bool recapRequired)
 Set the recap required field. More...
 
const char * getSymbol () const
 Return the OPRA contract symbol. More...
 
const char * getExchange () const
 Return the exchange. More...
 
const MamaDateTime & getExpireDate () const
 Return the expiration date. More...
 
const char * getExpireDateStr () const
 Return the expiration date as a string. More...
 
bool gotExpireDate () const
 Return whether or not expiration date has been set. More...
 
double getStrikePrice () const
 Return the strike price. More...
 
bool gotStrikePrice () const
 Return whether or not strike price has been set. More...
 
MamdaOptionPutCall getPutCall () const
 Return the put/call indicator. More...
 
bool gotPutCall () const
 Return whether or not put call has been set. More...
 
uint32_t getOpenInterest () const
 Return the level of interest at opening. More...
 
bool gotOpenInterest () const
 Return whether or not open interest has been set. More...
 
MamdaOptionExerciseStyle getExerciseStyle () const
 Return the style indicator - American(A)/European(E)/Capped(C). More...
 
bool gotExerciseStyle () const
 Return whether or not exercise style has been set. More...
 
bool getRecapRequired () const
 Get the recap required field. More...
 
void addMsgListener (MamdaMsgListener *listener)
 Add a generic MamdaMsgListener to this option contract. More...
 
void addTradeHandler (MamdaTradeHandler *handler)
 Add a MamdaTradeHandler for handling trade updates to this option contract. More...
 
void addQuoteHandler (MamdaQuoteHandler *handler)
 Add a MamdaQuoteHandler for handling quote updates to this option contract. More...
 
void addFundamentalHandler (MamdaFundamentalHandler *handler)
 Add a MamdaFundamentalHandler for handling fundamental data fields. More...
 
void setCustomObject (void *object)
 Add a custom object to this option contract. More...
 
MamdaTradeRecapgetTradeInfo () const
 Return the current trade fields. More...
 
MamdaQuoteRecapgetQuoteInfo () const
 Return the current quote fields. More...
 
MamdaFundamentalsgetFundamentalsInfo () const
 Return the current fundamentals fields. More...
 
void * getCustomObject () const
 Return the custom object. More...
 
std::vector< MamdaMsgListener * > & getMsgListeners ()
 Return the vector of message listeners. More...
 
MamdaTradeListenergetTradeListener ()
 Return the trade listener. More...
 
MamdaQuoteListenergetQuoteListener ()
 Return the quote listener. More...
 
MamdaFundamentalListenergetFundamentalListener ()
 Return the fundamental listener. More...
 
void setInView (bool inView)
 Set whether this contract is in the "view" within the option chain. More...
 
bool getInView ()
 Return whether this contract is in the "view" within the option chain. More...
 
int64_t getSeqNum ()
 
void setSeqNum (int64_t num)
 

Detailed Description

A class that represents a single option contract.

Instances of this object are typically created by the MamdaOptionChainListener. Applications may attach a custom object to each instance of MamdaOptionContract.

Note: User applications can be notified of creation of MamdaOptionContract instances via the MamdaOptionChainListener.onOptionContractCreate() method.

Note: It is possible to provide individual MamdaTradeHandler and MamdaQuoteHandler handlers for trades and quotes, even though the MamdaOptionChainHandler also provides a general callback interface for updates to individual contracts.

Constructor & Destructor Documentation

Wombat::MamdaOptionContract::MamdaOptionContract ( const char *  symbol,
const char *  exchange,
const MamaDateTime &  expireDate,
double  strikePrice,
MamdaOptionPutCall  putCall 
)

Constructor from expiration date, strike price, and put/call indicator.

Parameters
symbolThe option symbol.
exchangeThe exchange identifier.
expireDateThe options expiration date.
strikePriceThe options strike price.
putCallWhether this is a put or call option.
Wombat::MamdaOptionContract::MamdaOptionContract ( const char *  symbol,
const char *  exchange 
)

Constructor without expiration date, strike price, and put/call indicator.

Parameters
symbolThe option symbol.
exchangeThe exchange identifier.
Wombat::MamdaOptionContract::~MamdaOptionContract ( )

Destructor.

Member Function Documentation

void Wombat::MamdaOptionContract::setExpireDate ( const MamaDateTime &  expireDate)

Set the expiration date.

Parameters
expireDateThe options expiration date.
void Wombat::MamdaOptionContract::setStrikePrice ( double  strikePrice)

Set the strike price.

Parameters
strikePriceThe options strike price.
void Wombat::MamdaOptionContract::setPutCall ( MamdaOptionPutCall  putCall)

Set the put/call indicator.

Parameters
putCallWhether this is a put or call option.
void Wombat::MamdaOptionContract::setOpenInterest ( uint32_t  openInterest)

Set the open interest size.

Parameters
openInterestThe open interest for the option.
void Wombat::MamdaOptionContract::setExerciseStyle ( MamdaOptionExerciseStyle  exerciseStyle)

Set the exercise style.

Parameters
exerciseStyleThe exercise style for the option.
void Wombat::MamdaOptionContract::setRecapRequired ( bool  recapRequired)

Set the recap required field.

Typically only used by the MamdaOptionChainListener

Parameters
recapRequiredWhether a recap is required by the contract.
const char* Wombat::MamdaOptionContract::getSymbol ( ) const

Return the OPRA contract symbol.

Returns
The OPRA contract symbol.
const char* Wombat::MamdaOptionContract::getExchange ( ) const

Return the exchange.

Returns
The exchange identifier.
const MamaDateTime& Wombat::MamdaOptionContract::getExpireDate ( ) const

Return the expiration date.

Returns
The options expiration date.
const char* Wombat::MamdaOptionContract::getExpireDateStr ( ) const

Return the expiration date as a string.

Returns
The options expiration date as a string.
bool Wombat::MamdaOptionContract::gotExpireDate ( ) const

Return whether or not expiration date has been set.

Returns
Whether the contract has an expiration date set.
double Wombat::MamdaOptionContract::getStrikePrice ( ) const

Return the strike price.

Returns
The option contracts strike price.
bool Wombat::MamdaOptionContract::gotStrikePrice ( ) const

Return whether or not strike price has been set.

Returns
Whether the strike price has been set for the contract.
MamdaOptionPutCall Wombat::MamdaOptionContract::getPutCall ( ) const

Return the put/call indicator.

Returns
Indicating whether this is a put or call option contract.
bool Wombat::MamdaOptionContract::gotPutCall ( ) const

Return whether or not put call has been set.

Returns
Whether the put/call indicator has been set for this contract.
uint32_t Wombat::MamdaOptionContract::getOpenInterest ( ) const

Return the level of interest at opening.

Returns
The opening interest for the option contract.
bool Wombat::MamdaOptionContract::gotOpenInterest ( ) const

Return whether or not open interest has been set.

Returns
Whether a value for opening interest has been set for the option contract.
MamdaOptionExerciseStyle Wombat::MamdaOptionContract::getExerciseStyle ( ) const

Return the style indicator - American(A)/European(E)/Capped(C).

Returns
The exercise style for the option contract.
bool Wombat::MamdaOptionContract::gotExerciseStyle ( ) const

Return whether or not exercise style has been set.

Returns
Whether the exercise style for the option contract has been set.
bool Wombat::MamdaOptionContract::getRecapRequired ( ) const

Get the recap required field.

Reserved for use by the MamdaOptionChainListener.

Returns
Whether a recap is required for this contract.
void Wombat::MamdaOptionContract::addMsgListener ( MamdaMsgListener listener)

Add a generic MamdaMsgListener to this option contract.

Parameters
listenerA instance of the listener interface.
void Wombat::MamdaOptionContract::addTradeHandler ( MamdaTradeHandler handler)

Add a MamdaTradeHandler for handling trade updates to this option contract.

Parameters
handlerA trade handler.
void Wombat::MamdaOptionContract::addQuoteHandler ( MamdaQuoteHandler handler)

Add a MamdaQuoteHandler for handling quote updates to this option contract.

Parameters
handlerA quote handler.
void Wombat::MamdaOptionContract::addFundamentalHandler ( MamdaFundamentalHandler handler)

Add a MamdaFundamentalHandler for handling fundamental data fields.

Parameters
handlerA fundamental handler.
void Wombat::MamdaOptionContract::setCustomObject ( void *  object)

Add a custom object to this option contract.

Such an object might contain customer per-contract data.

Parameters
objectAssociate closure data with the option contract.
MamdaTradeRecap& Wombat::MamdaOptionContract::getTradeInfo ( ) const

Return the current trade fields.

Returns
The current trade related fields for the option contract.
MamdaQuoteRecap& Wombat::MamdaOptionContract::getQuoteInfo ( ) const

Return the current quote fields.

Returns
The current quote related fields for the option contract.
MamdaFundamentals& Wombat::MamdaOptionContract::getFundamentalsInfo ( ) const

Return the current fundamentals fields.

Returns
The current fundamental fields for the option contract.
void* Wombat::MamdaOptionContract::getCustomObject ( ) const

Return the custom object.

Returns
The closure.
std::vector<MamdaMsgListener*>& Wombat::MamdaOptionContract::getMsgListeners ( )

Return the vector of message listeners.

Returns
Vector of message listeners registered with the object.
MamdaTradeListener& Wombat::MamdaOptionContract::getTradeListener ( )

Return the trade listener.

Returns
The registered trade listener.
MamdaQuoteListener& Wombat::MamdaOptionContract::getQuoteListener ( )

Return the quote listener.

Returns
The registered quote listener.
MamdaFundamentalListener& Wombat::MamdaOptionContract::getFundamentalListener ( )

Return the fundamental listener.

Returns
The registered fundamental listener.
void Wombat::MamdaOptionContract::setInView ( bool  inView)

Set whether this contract is in the "view" within the option chain.

Parameters
inViewSet whether this contract is in the "view" within the option chain.
See also
MamdaOptionChain
bool Wombat::MamdaOptionContract::getInView ( )

Return whether this contract is in the "view" within the option chain.

Returns
Whether this contract is in the "view" within the option chain.
See also
MamdaOptionChain
int64_t Wombat::MamdaOptionContract::getSeqNum ( )
void Wombat::MamdaOptionContract::setSeqNum ( int64_t  num)

The documentation for this class was generated from the following file:


© 2012 Linux Foundation