OpenMAMA
Wombat::MamdaOptionChain Class Reference

MamdaOptionChain is a specialized class to represent market data option chains. More...

#include <MamdaOptionChain.h>

Classes

class  const_iterator
 
class  iterator
 

Public Member Functions

 MamdaOptionChain (const char *symbol)
 MamdaOptionChain Constructor. More...
 
 ~MamdaOptionChain ()
 MamdaOptionChain Destructor. More...
 
void setSymbol (const char *symbol)
 Set the underlying symbol for the option chain. More...
 
const char * getSymbol () const
 Get the underlying symbol for the option chain. More...
 
void setUnderlyingQuoteListener (const MamdaQuoteListener *quoteListener)
 Set the underlying quote information. More...
 
void setUnderlyingTradeListener (const MamdaTradeListener *tradeListener)
 Set the underlying trade information. More...
 
const MamdaQuoteListenergetUnderlyingQuoteListener () const
 Get the underlying quote information. More...
 
const MamdaTradeListenergetUnderlyingTradeListener () const
 Get the underlying trade information. More...
 
void addContract (const char *contractSymbol, MamdaOptionContract *contract)
 Add an option contract. More...
 
void processNewContractDetails (const char *contractSymbol, MamdaOptionContract *contract)
 Add the contract to value-added-structures such as Put and Call side mappings and expiration by strike set, etc. More...
 
void removeContract (const char *contractSymbol)
 Remove an option contract. More...
 
double getAtTheMoney (MamdaOptionAtTheMoneyCompareType compareType)
 Determine the underlying price ("at the money"), based on the mode of calculation. More...
 
void getStrikesWithinPercent (StrikeSet &strikeSet, double percentage, MamdaOptionAtTheMoneyCompareType compareType)
 Determine the set of strike prices that are included in a given percentage range of the underlying price. More...
 
void getStrikesWithinRangeSize (StrikeSet &strikeSet, int rangeLength, MamdaOptionAtTheMoneyCompareType compareType)
 Determine the set of strike prices that are included in a given fixed size range of strikes surrounding the underlying price. More...
 
bool getIsPriceWithinPercentOfMoney (double price, double percentage, MamdaOptionAtTheMoneyCompareType compareType)
 Determine whether some price (e.g. More...
 
iterator callIterator ()
 Obtain an iterator to the beginning of the list of call options. More...
 
iterator putIterator ()
 Obtain an iterator to the beginning of the list of put options. More...
 
const_iterator callIterator () const
 Obtain an iterator to the beginning of the list of call options. More...
 
const_iterator putIterator () const
 Obtain an iterator to the beginning of the list of put options. More...
 
const
MamdaOptionExpirationDateSet
getAllExpirations () const
 Return the set of all expiration dates (which can be iterated over one date at a time). More...
 
void dump ()
 Dump the option chain to standard output. More...
 

Detailed Description

MamdaOptionChain is a specialized class to represent market data option chains.

The class has capabilities to store the current state of an entire option chain, or a subset of the chain.

Constructor & Destructor Documentation

Wombat::MamdaOptionChain::MamdaOptionChain ( const char *  symbol)

MamdaOptionChain Constructor.

Wombat::MamdaOptionChain::~MamdaOptionChain ( )

MamdaOptionChain Destructor.

Member Function Documentation

void Wombat::MamdaOptionChain::setSymbol ( const char *  symbol)

Set the underlying symbol for the option chain.

const char* Wombat::MamdaOptionChain::getSymbol ( ) const

Get the underlying symbol for the option chain.

void Wombat::MamdaOptionChain::setUnderlyingQuoteListener ( const MamdaQuoteListener quoteListener)

Set the underlying quote information.

The MamdaQuoteListener object would likely be an object that gets automatically updated by events handled elsewhere.

void Wombat::MamdaOptionChain::setUnderlyingTradeListener ( const MamdaTradeListener tradeListener)

Set the underlying trade information.

The MamdaTradeListener object would likely be an object that gets automatically updated by events handled elsewhere.

const MamdaQuoteListener* Wombat::MamdaOptionChain::getUnderlyingQuoteListener ( ) const

Get the underlying quote information.

Returns the object provided by setUnderlyingQuoteListener(), if any.

const MamdaTradeListener* Wombat::MamdaOptionChain::getUnderlyingTradeListener ( ) const

Get the underlying trade information.

Returns the object provided by setUnderlyingTradeListener(), if any.

void Wombat::MamdaOptionChain::addContract ( const char *  contractSymbol,
MamdaOptionContract contract 
)

Add an option contract.

This method would not normally be invoked by a user application. Rather, MamdaOptionChainListener would be most likely to call this method.

void Wombat::MamdaOptionChain::processNewContractDetails ( const char *  contractSymbol,
MamdaOptionContract contract 
)

Add the contract to value-added-structures such as Put and Call side mappings and expiration by strike set, etc.

Called by AddContract(const char*, MamdaOptionContract*). Can be called directly on a contract when additional mandatory fields are acquired for the contract that may enable it to be added to value-added-structures it wasn't added to (due to the lack of information) when first added to the chain.

void Wombat::MamdaOptionChain::removeContract ( const char *  contractSymbol)

Remove an option contract.

This method would not normally be invoked by a user application. Rather, MamdaOptionChainListener would be most likely to call this method.

double Wombat::MamdaOptionChain::getAtTheMoney ( MamdaOptionAtTheMoneyCompareType  compareType)

Determine the underlying price ("at the money"), based on the mode of calculation.

void Wombat::MamdaOptionChain::getStrikesWithinPercent ( StrikeSet strikeSet,
double  percentage,
MamdaOptionAtTheMoneyCompareType  compareType 
)

Determine the set of strike prices that are included in a given percentage range of the underlying price.

If there are no strikes within the percentage range, then the set will be empty.

void Wombat::MamdaOptionChain::getStrikesWithinRangeSize ( StrikeSet strikeSet,
int  rangeLength,
MamdaOptionAtTheMoneyCompareType  compareType 
)

Determine the set of strike prices that are included in a given fixed size range of strikes surrounding the underlying price.

If rangeLen is odd, then the strike price nearest to the underlying price is treated as a higher strike price. If rangeLen is even and the underlying price is exactly equal to a strike price, then that strike price is treated as a higher strike price.

bool Wombat::MamdaOptionChain::getIsPriceWithinPercentOfMoney ( double  price,
double  percentage,
MamdaOptionAtTheMoneyCompareType  compareType 
)

Determine whether some price (e.g.

a strike price) is within a given percentage range of the underlying (at the money) price.

iterator Wombat::MamdaOptionChain::callIterator ( )

Obtain an iterator to the beginning of the list of call options.

Use the iterator::hasNext() to test for a subsequent iterator and use iterator::next() method to move to it.

iterator Wombat::MamdaOptionChain::putIterator ( )

Obtain an iterator to the beginning of the list of put options.

Use the iterator::hasNext() to test for a subsequent iterator and use iterator::next() method to move to it.

const_iterator Wombat::MamdaOptionChain::callIterator ( ) const

Obtain an iterator to the beginning of the list of call options.

Use the iterator::hasNext() to test for a subsequent iterator and use iterator::next() method to move to it.

const_iterator Wombat::MamdaOptionChain::putIterator ( ) const

Obtain an iterator to the beginning of the list of put options.

Use the iterator::hasNext() to test for a subsequent iterator and use iterator::next() method to move to it.

const MamdaOptionExpirationDateSet& Wombat::MamdaOptionChain::getAllExpirations ( ) const

Return the set of all expiration dates (which can be iterated over one date at a time).

void Wombat::MamdaOptionChain::dump ( )

Dump the option chain to standard output.


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


© 2012 Linux Foundation