Class Option

Inheritance Relationships

Base Type

Class Documentation

class Option : public otyca::Security

Represents a financial option with various pricing attributes.

Public Functions

Option(OptionType type, double bid, double ask, const std::shared_ptr<UnderlyingDataset> &underlying_dataset, const std::shared_ptr<OptionExpiration> &option_expiration, const std::shared_ptr<OptionStrike> &option_strike)

Constructs an Option with given parameters.

Parameters:
  • type – The type of the option (CALL or PUT)

  • bid – The bid price

  • ask – The ask price

  • underlying_dataset – Pointer to the underlying dataset

  • option_expiration – Pointer to the option expiration

  • option_strike – Pointer to the option strike

Option(OptionType type, const std::shared_ptr<UnderlyingDataset> &underlying_dataset, const std::shared_ptr<OptionExpiration> &option_expiration, const std::shared_ptr<OptionStrike> &option_strike)

Constructs an Option without bid and ask prices.

Parameters:
  • type – The type of the option (CALL or PUT)

  • underlying_dataset – Pointer to the underlying dataset

  • option_expiration – Pointer to the option expiration

  • option_strike – Pointer to the option strike

inline void set_strike_and_type(const std::shared_ptr<OptionCalculator<>> &option_calculator) const

Set the option strike and option type for a given option calculator.

Parameters:

option_calculator – A shared pointer to an OptionCalculator with underlying and expiration configured

double mid_implied_volatility(const std::shared_ptr<OptionCalculator<>> &option_calculator) const

Computes the mid price implied volatility and returns it.

Parameters:

option_calculator – A shared pointer to an OptionCalculator with underlying and expiration configured

Returns:

the mid price implied volatility

inline double get_mid_volatility()

Calculates and gets the mid-price implied volatility.

inline double get_mid_delta()

Calculate and gets the delta of the option priced at mid price implied volatility.

bool bid_ask_within_bounds(std::shared_ptr<OptionCalculator<>> option_calculator) const

Check if bid is above price lower bound and ask is below price upper bound.

Parameters:

option_calculator – A shared pointer to an OptionCalculator with underlying and expiration configured

Returns:

true if bid is above price lower bound and ask is below price upper bound, otherwise false

inline double intrinsic(double spot) const

Calculate intrinsic value for the given underlying price.

Parameters:

spot – underlying spot price for intrinsic calculation.

Returns:

intrinsic value for the given underlying price.

inline bool mid_above_intrinsic(double spot) const

Determines whether mid-price is above intrinsic value for the given underlying price.

Parameters:

spot – underlying spot price for intrinsic calculation.

Returns:

True if mid-price exceed intrinsic value, false otherwise.

inline bool bid_above_intrinsic(double spot) const

Determines whether bid price is above intrinsic value for the given underlying price.

Parameters:

spot – underlying spot price for intrinsic calculation.

Returns:

True if bid price exceed intrinsic value, false otherwise.

inline double get_bid_ask_volatility_spread() const

Gets the bid-ask volatility spread.

inline std::string get_osi_sub() const

Generates the OSI sub symbol (OSI without the root) for the option.

inline std::string get_osi(const std::string &root) const

Generates the full OSI symbol including root symbol.

inline double get_ask_volatility() const

Calculates and gets the ask volatility.

inline double get_bid_volatility() const

Calculates and gets the bid volatility.

boost::posix_time::ptime get_expiration() const

Retrieves the option expiration date.

double get_strike() const

Retrieves the option strike price.

OptionStyle get_style() const

Retrieves the option style.

inline OptionType get_type() const

Retrieves the option type.

inline void set_type(OptionType _Type)

Sets the option type.

inline double get_premium()

Calculate and gets option premium using fitted volatility.

inline double get_delta()

Calculate and gets option delta using fitted volatility.

inline double get_gamma()

Calculate and gets option Gamma using fitted volatility.

inline double get_theta()

Calculate and gets option Theta using fitted volatility.

inline double get_vega()

Calculate and gets option Vega using fitted volatility.

inline double get_vanna()

Calculate and gets option Vanna using fitted volatility.

inline double get_volga()

Calculate and gets option Volga using fitted volatility.

inline double get_phi()

Calculate and gets option phi using fitted volatility.

inline double get_rho()

Calculate and gets option Rho using fitted volatility.

inline double get_delta_decay()

Calculate and gets option Delta decay using fitted volatility.

inline double get_fugit()

Calculate and gets option fugit using fitted volatility.

void reset()

Resets internal state.

Public Static Functions

static inline std::vector<ObjectGetter<double, Option>> get_pricer_result_getters()

Retrieves a list of pricing result getters.

static inline std::vector<std::string> get_pricer_result_labels()

Retrieves labels for pricing results.

Friends

friend std::ostream &operator<<(std::ostream &out, const Option &rhs)

Overloads the stream output operator.