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

double implied_european_mid_price(std::shared_ptr<OptionCalculator<>> option_calculator) const

Computes the mid price implied volatility and reprices the option with it as if the option were European style.

Parameters:

option_calculatorOption calculator pointer

Returns:

Equivalent European price of the option repriced at 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.

inline bool bid_above_intrinsic(double spot) const

Checks if the bid price is above intrinsic value.

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.