Classes Files

com::wombat::mamda::options::MamdaOptionChain

More…

Public Functions

  Name
  MamdaOptionChain(String symbol)
void setSymbol(String symbol)
String getSymbol()
void setUnderlyingQuoteListener(MamdaQuoteListener quoteListener)
void setUnderlyingTradeListener(MamdaTradeListener tradeListener)
MamdaQuoteListener getUnderlyingQuoteListener()
MamdaTradeListener getUnderlyingTradeListener()
MamdaOptionContract getContract(String contractSymbol)
SortedSet getExchanges()
SortedSet getStrikePrices()
void addContract(String contractSymbol, MamdaOptionContract contract)
void removeContract(String contractSymbol)
double getAtTheMoney(short compareType)
boolean getIsPriceWithinPercentOfMoney(double price, double percentage, short compareType)
SortedSet getStrikesWithinPercent(double percentage, short compareType)
SortedSet getStrikesWithinRangeSize(int rangeLength, short compareType)
Iterator callIterator()
Iterator putIterator()
MamdaOptionExpirationDateSet getAllExpirations()
void dump()

Detailed Description

class com::wombat::mamda::options::MamdaOptionChain;

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.

Public Functions Documentation

function MamdaOptionChain

inline MamdaOptionChain(
    String symbol
)

Parameters:

  • symbol The underlying symbol.

MamdaOptionChain Constructor.

function setSymbol

inline void setSymbol(
    String symbol
)

Parameters:

  • symbol The underlying symbol.

Set the underlying symbol for the option chain.

function getSymbol

inline String getSymbol()

Return: String The underlying symbol for the option chain.

Get the underlying symbol for the option chain.

function setUnderlyingQuoteListener

inline void setUnderlyingQuoteListener(
    MamdaQuoteListener quoteListener
)

Parameters:

  • quoteListener The quote listener for the chain.

Set the underlying quote listener information. MamdaOptionChain does not use this class itself, but related classes might (e.g., MamdaOptionChainView).

function setUnderlyingTradeListener

inline void setUnderlyingTradeListener(
    MamdaTradeListener tradeListener
)

Parameters:

  • tradeListener The trade listener for the chain.

Set the underlying trade listener information. MamdaOptionChain uses this class to implement the atTheMoney() method. Related classes might (e.g., MamdaOptionChainView) use it for other reasons.

function getUnderlyingQuoteListener

inline MamdaQuoteListener getUnderlyingQuoteListener()

Return: MamdaQuoteListener The quote listener for the chain.

Make the underlying quote listener available externally.

function getUnderlyingTradeListener

inline MamdaTradeListener getUnderlyingTradeListener()

Return: MamdaTradeListener The trade listener for the chain.

Make the underlying trade listener available externally.

function getContract

inline MamdaOptionContract getContract(
    String contractSymbol
)

Parameters:

  • contractSymbol The option symbol.

Return: MamdaOptionContract The contract object representing the option.

Find an option contract by OPRA symbol.

function getExchanges

inline SortedSet getExchanges()

Return: SortedSet Set of regional exchange identifiers.

Return the superset of regional exchange identifiers for any option in this chain. Each element in the set is a String object.

function getStrikePrices

inline SortedSet getStrikePrices()

Return: SortedSet Set of strike prices for the chain.

Return the superset of strike prices for this chain. Each element in the set is a Double object.

function addContract

inline void addContract(
    String contractSymbol,
    MamdaOptionContract contract
)

Parameters:

  • contractSymbol The option instrument symbol.
  • contract The Mamda option contract representation.

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.

function removeContract

inline void removeContract(
    String 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.

function getAtTheMoney

inline double getAtTheMoney(
    short compareType
)

Parameters:

  • compareType The mode of calculation ([MamdaOptionAtTheMoneyCompareType](classcom_1_1wombat_1_1mamda_1_1options_1_1MamdaOptionAtTheMoneyCompareType.html))

See: MamdaOptionAtTheMoneyCompareType

Return: double The price of the underlying.

Get the price of the option underlying. Determine the underlying price (“at the money”), based on the mode of calculation.

function getIsPriceWithinPercentOfMoney

inline boolean getIsPriceWithinPercentOfMoney(
    double price,
    double percentage,
    short compareType
)

Parameters:

  • price The strike price to check.
  • percentage What % to check the strike price against.
  • compareType What price we are checking against (see [MamdaOptionAtTheMoneyCompareType](classcom_1_1wombat_1_1mamda_1_1options_1_1MamdaOptionAtTheMoneyCompareType.html))

See: MamdaOptionAtTheMoneyCompareType

Return: boolean Whether the proce is within % of the money.

Return whether the price within a % of the money. Determine whether some price (e.g. a strike price) is within a given percentage range of the underlying (at the money) price.

function getStrikesWithinPercent

inline SortedSet getStrikesWithinPercent(
    double percentage,
    short compareType
)

Parameters:

  • percentage The percentage range of the underlying price.
  • compareType Which underlying price to compare to.

See: MamdaOptionAtTheMoneyCompareType

Return: SortedSet Set of strike prices.

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 both strike prices are set to zero.

function getStrikesWithinRangeSize

inline SortedSet getStrikesWithinRangeSize(
    int rangeLength,
    short compareType
)

Parameters:

  • rangeLength Number of strike prices to include in result.
  • compareType What underlying price to use as a comparator.

See: MamdaOptionAtTheMoneyCompareType

Return: SortedSet Resulting set of strike prices.

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.

function callIterator

inline Iterator callIterator()

Return: Iterator The iterator of call options.

Return an iterator over all call option contracts. The type of object that Iterator.next() returns is [MamdaOptionContract](classcom_1_1wombat_1_1mamda_1_1options_1_1MamdaOptionContract.html).

function putIterator

inline Iterator putIterator()

Return: Iterator The iterator of put options.

Return an iterator over all put option contracts. The type of object that Iterator.next() returns is MamdaOptionContract.

function getAllExpirations

inline MamdaOptionExpirationDateSet getAllExpirations()

Return: MamdaOptionExpirationDateSet Set of expiration dates.

Return a set of MamdaOptionExpirationDateSet.

function dump

inline void dump()

Print the contents of the chain to standard out.


Updated on 2023-03-31 at 15:30:37 +0100