Class OptionStrike

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< OptionStrike >

Class Documentation

class OptionStrike : public std::enable_shared_from_this<OptionStrike>

Represents the call and put option with the same strike price within a given expiration.

Public Functions

OptionStrike(double strike, const std::shared_ptr<UnderlyingDataset> &underlying_dataset, const std::shared_ptr<OptionExpiration> &option_expiration)

Constructs an OptionStrike object.

Parameters:
  • strike – The strike price of the option.

  • underlying_dataset – The underlying dataset associated with the option.

  • option_expiration – The expiration object associated with this strike.

std::shared_ptr<Option> create_option(OptionType type)

Creates an option of the specified type.

Parameters:

type – The type of option (call or put).

Returns:

A shared pointer to the created option.

inline double distance_to_forward(double forward) const

Computes the distance between the strike price and a given forward price.

Parameters:

forward – The forward price.

Returns:

The absolute difference between the strike and forward price.

double synthetic_forward() const

Computes the synthetic forward price.

Returns:

The synthetic forward price.

double synthetic_forward_spread() const

Computes the synthetic forward spread.

Returns:

The synthetic forward spread value.

double call_put_disparity() const

Computes the call-put parity disparity.

Returns:

The disparity value.

inline boost::posix_time::ptime get_expiration() const

Gets the expiration that it belongs to.

Returns:

The expiration.

inline double get_strike() const

Gets the strike price.

Returns:

The strike price.

inline void set_strike(double strike)

Sets the strike price.

Parameters:

strike – The new strike price.

inline bool finite_call_put_bid_ask_volatility() const

Checks if both call and put bid-ask volatilities are finite.

Returns:

True if both call and put bid-ask volatilities are finite, false otherwise.

inline Estimate get_strike_volatility() const

Gets the strike volatility estimate.

Returns:

The strike volatility estimate.

inline double get_strike_volatility_value() const

Gets the value of the strike volatility.

Returns:

The strike volatility value.

inline double get_strike_volatility_uncertainty() const

Gets the uncertainty of the strike volatility.

Returns:

The strike volatility uncertainty.

inline double get_average_volatility_value() const

Gets the value of the average volatility.

Returns:

The average volatility value.

inline double get_average_volatility_uncertainty() const

Gets the uncertainty of the average volatility.

Returns:

The average volatility uncertainty.

inline double get_fair_volatility() const

Gets the fair volatility.

Returns:

The fair volatility value.

inline double get_stochastic_process_volatility() const

Gets stochastic process implied volatility.

Returns:

The stochastic process implied volatility.

inline Estimate get_implied_forward() const

Gets the implied forward estimate.

Returns:

The implied forward estimate.

inline double get_implied_forward_value() const

Returns the value of the implied forward price.

Returns:

The implied forward price as a double.

inline double get_implied_forward_uncertainty() const

Returns the uncertainty of the implied forward price.

Returns:

The uncertainty of the implied forward price as a double.

inline double get_standard_price_value() const

Returns the value of the standard price.

Returns:

The standard price as a double.

inline double get_standard_price_uncertainty() const

Returns the uncertainty of the standard price.

Returns:

The uncertainty of the standard price as a double.

inline std::vector<std::shared_ptr<Option>> get_options() const

Returns a vector of shared pointers to the call and put options.

Returns:

A std::vector containing shared pointers to the call and put Option objects.

inline bool effective_european() const
inline OptionStyle get_style() const
std::shared_ptr<Option> otm_option() const

Returns the out-of-the-money (OTM) option by comparing the spot price with the strike price.

Returns:

A shared pointer to the OTM option.

std::shared_ptr<Option> itm_option() const

Returns the in-the-money (ITM) option by comparing the spot price with the strike price.

Returns:

A shared pointer to the ITM option.

inline std::shared_ptr<Option> get_call() const

Gets the call option.

Returns:

A shared pointer to the call option.

inline std::shared_ptr<Option> get_put() const

Gets the put option.

Returns:

A shared pointer to the put option.

inline double get_log_relative_strike() const

Gets the logarithm of the relative strike.

Returns:

The log-relative strike value.

inline double get_z2() const
inline double get_relative_strike() const

Gets the relative strike.

Returns:

The relative strike value.

void setup()
inline std::vector<double> get_volatility_model_outputs()
Estimate implied_forward(std::shared_ptr<OptionCalculator<>> oc) const

Computes the implied forward price using the given option calculator which contains pricing information, e.g. underlying price, volatility, interest and borrow estimates, dividends, etc.

Parameters:

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

Returns:

An Estimate representing the implied forward price.

double forward_bias(const std::shared_ptr<OptionCalculator<>> &oc) const

Computes the forward price bias implied by option premiums.

For European options, the bias is calculated as the difference between the model forward (from interest rate and carry tenor) and the forward price implied by put–call parity using mid prices of the call and put.

For American options, the function estimates the bias arising from early exercise premium asymmetry:

  • If the strike is below the underlying spot (OTM put / ITM call), the bias is the difference between the model call premium and the observed call mid price.

  • If the strike is above the underlying spot (OTM call / ITM put), the bias is the difference between the observed put mid price and the model put premium.

Parameters:

oc – Shared pointer to an OptionCalculator instance, used to set strike, volatility, option type, and to compute theoretical premiums and forward values.

Returns:

The forward bias, expressed as the difference between model-implied and market-implied forward measures.

Estimate implied_borrow(const std::shared_ptr<OptionCalculator<>> &oc) const

Estimates the implied borrow (carry) rate from a single option strike.

This method attempts to infer the implied borrow rate by reconciling the observed call/put mid-prices with theoretical forward pricing.

For European options:

  • The forward is backed out from put–call parity using observed mid-prices.

  • The borrow rate is solved numerically (via OptionCalculator::implied_borrow) to match the forward.

For American (or early-exercisable) options:

  • Iteratively adjusts the borrow rate to minimize the forward bias (difference between model forward and implied forward).

  • Stops if sensitivity of bias to borrow becomes too small, which indicates that the ITM option is optimally exercised early (premium no longer sensitive to borrow).

  • If convergence is achieved (bias sufficiently small), returns the borrow rate and a normalized forward spread metric.

Parameters:

oc – Shared pointer to an OptionCalculator configured with market inputs (interest rate, volatility, tenor, etc.).

Returns:

Estimate object containing:

  • First element: the implied borrow rate (or NaN if indeterminate).

  • Second element: normalized forward spread (or NaN if indeterminate).

Estimate implied_interest(const std::shared_ptr<OptionCalculator<>> &oc) const
inline bool bid_ask_within_bounds(std::shared_ptr<OptionCalculator<>> oc) const

Determines whether bid and ask prices are within theoretical bounds for given market data.

Parameters:

oc – A shared pointer to an OptionCalculator that wraps up market data.

Returns:

True if both call and put bid and ask prices are within bounds, false otherwise.

inline bool bid_above_intrinsic(double spot) const

Determines whether bid prices are above intrinsic values for the given underlying price.

Parameters:

spot – underlying spot price for intrinsic calculation.

Returns:

True if both call and put bid prices exceed intrinsic values, false otherwise.

inline bool mid_above_intrinsic(double spot) const

Determines whether bid prices are above intrinsic values for the given underlying price.

Parameters:

spot – underlying spot price for intrinsic calculation.

Returns:

True if both call and put bid prices exceed intrinsic values, false otherwise.

bool put_call_volatility_crossed() const

Checks if the put-call volatilities are crossed.

Returns:

True if volatilities are crossed, false otherwise.

Friends

friend std::ostream &operator<<(std::ostream&, const OptionStrike&)

Overloaded stream insertion operator for OptionStrike.