Python API

Our Python API is a direct exposure of the C++ API to Python. Implicit conversions are supported between C++ standard containers and their Python counterparts. For example, C++ std::map is automatically converted to and from Python dictionaries, while std::vector is converted to and from Python lists. Additionally, conversions are supported between C++ boost::posix_time::ptime and Python’s datetime.datetime, as well as between C++ boost::gregorian::date and Python’s datetime.date, among others.

class otyca_cpp.AlphaStable

Bases: TimeChangeProcess

Represents an Alpha-Stable time change process.

property alpha

Stability parameter (0 < alpha <= 2)

class otyca_cpp.AutoStochasticProcessPricer

Bases: StochasticProcessPricer

A stochastic process pricer that automatically selects specialized pricers based on input. This class extends StochasticProcessPricer and manages a collection of specialized pricers internally. It delegates pricing, derivative calculation, implied volatility computation, and PDF evaluation to the appropriate pricer for each case.

class otyca_cpp.BimodalGaussian

Bases: StochasticProcess

A stochastic jump process exhibiting bimodal behavior with a mean and a standard deviation parameter. The BimodalGaussian jump process can be used to model events, e.g. stock earning announcements. The model is parameterized by: mu: the mean of the jump sigma: the standard deviation of the jump

property mu

Mean of the Gaussian distribution.

property sigma

Standard deviation of the Gaussian distribution.

class otyca_cpp.BimodalGaussianBoundedSchedule

Bases: instance

A schedule that maps bounded time intervals to values of type T. The type of T is BimodalGaussian.

add_centered_on((BimodalGaussianBoundedSchedule)arg1, (object)arg2, (int)arg3, (BimodalGaussian)arg4) bool :

Adds an entry to the schedule using a center reference time and a symmetric business-day window.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time.

  • business_days (int) – The number of business days before and after the reference time.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

add_with_bounds((BimodalGaussianBoundedSchedule)arg1, (object)arg2, (BimodalGaussian)arg3) bool :

Adds an entry to the schedule using an explicit start and end time.

Parameters:
  • bounds (const std::pair<boost::posix_time::ptime, boost::posix_time::ptime> &) – A pair representing the start and end time of the entry.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

size((BimodalGaussianBoundedSchedule)arg1) int
to_dict((BimodalGaussianBoundedSchedule)arg1) object :

Converts the object to a map.

Returns:

A std::map mapping pairs of boost::posix_time::ptime to values of type T. Each key is a (start_time, end_time) pair associated with a corresponding value.

Return type:

std::map<std::pair<boost::posix_time::ptime, boost::posix_time::ptime>, T>

class otyca_cpp.BrownianMotion

Bases: LevyProcess

Standard Brownian motion process. Represents a continuous-time stochastic process with independent, normally distributed increments. Inherits from the LevyProcess base class.

property sigma

diffusion volatility

class otyca_cpp.CGMY

Bases: LevyProcess

Represents the CGMY stochastic process model. The CGMY process is a pure-jump Lévy process widely used in financial modeling, particularly for capturing asset returns with jumps and heavy tails. It is characterized by four parameters: C: Activity level of small jumps G: Decay rate of positive jumps M: Decay rate of negative jumps Y: Tail heaviness (or jump intensity) parameter The CGMY process generalizes several well-known models, including the Variance Gamma process (when Y=0) and the stable process (when Y∈(0,2) and C is constant). This class provides methods for evaluating process characteristics, simulating paths, and computing relevant quantities for applications such as option pricing and risk management. The process reduces to a Brownian motion in the appropriate parameter limits. “Carr, P., Geman, H., Madan, D.B., and Yor, M. The Fine Structure of Asset Returns: An Empirical Investigation, Journal of Business, 2002” for more detailed background.

property c

c parameter of CGMY model

property g

g parameter of CGMY model

property m

m parameter of CGMY model

property y

y parameter of CGMY model

class otyca_cpp.CIR

Bases: LCIR

Represents a CIR (Cox-Ingersoll-Ross) process. The CIR class models a Cox-Ingersoll-Ross (CIR) process

class otyca_cpp.ClaimFourierTransform

Bases: FourierTransform

Fourier transform of call put or covered call.

class otyca_cpp.CompositeLevyProcess

Bases: LevyProcess

A Levy process composed of multiple LevyProcess components. This class aggregates several LevyProcess instances and combines their characteristic exponents, parameters, and derivatives. The characteristic exponent of the composite process is the sum of the characteristic exponents of its components.

add_component((CompositeLevyProcess)arg1, (LevyProcess)arg2) None :

Add a Levy process component to the composite.

Parameters:

component (std::shared_ptr<LevyProcess>) – Shared pointer to a LevyProcess to be added.

get_levy_components((CompositeLevyProcess)arg1) object :

Get a const reference to the internal list of Levy process components.

Returns:

Vector of shared pointers to LevyProcess.

Return type:

const std::vector<std::shared_ptr<LevyProcess>> &

class otyca_cpp.CompositeStochasticProcess

Bases: StochasticProcess

A composite stochastic process combining multiple StochasticProcess components. This class represents a collection of stochastic processes, allowing the user to build complex models by combining simpler components. Each component can contribute to the overall characteristic function and its derivatives.

add_component((CompositeStochasticProcess)arg1, (StochasticProcess)arg2) None :

Add a component process to the composite.

Parameters:

component (std::shared_ptr<StochasticProcess>) – Shared pointer to a StochasticProcess instance.

get_components((CompositeStochasticProcess)arg1) object :

Get all components in this composite process.

Returns:

Vector of shared pointers to the component processes.

Return type:

std::vector<std::shared_ptr<StochasticProcess>>

class otyca_cpp.CompositeStochasticProcessConfig

Bases: instance

Configuration parameters for a composite stochastic process calibration.

property max_n_event

Maximum number of events (e.g., jumps) allowed in the process.

property max_tenor

Maximum tenor (time to maturity) over which the process is applied.

property min_tenor

Minimum tenor (time to maturity) over which the process is applied.

property specification

Specification string of the process. See CompositeStochasticProcessFactory.

class otyca_cpp.CompositeStochasticProcessFactory

Bases: instance

Factory class for creating composite stochastic processes from string specifications. This factory provides a static method to create complex time-changed Lévy processes based on a textual specification. Each term in the specification corresponds to a stochastic process, and multiple processes can be combined using the + operator. Example specification: “lcir(mt+bm) + lcir(cgmy) + kou” This creates a composite process consisting of: An LCIR time-changed Merton plus BrownianMotion process. An LCIR time-changed CGMY process. A Kou process.

create_composite_stochastic_process((str)arg1) CompositeStochasticProcess :

Create a CompositeStochasticProcess from a string specification.

Parameters:

specification (const std::string &) – A textual specification describing the composite process. The format follows a functional expression with nested components, such as “lcir(mt+bm)+kou”.

Returns:

A shared pointer to the constructed CompositeStochasticProcess.

Return type:

std::shared_ptr<CompositeStochasticProcess>

class otyca_cpp.CubicSpline

Bases: Model1

A one-dimensional spline model with lazy recalculation support. Inherits from Model to provide a generic modeling interface and privately from Scatter to reuse scattered data functionality.

add_knot((CubicSpline)arg1, (float)arg2, (float)arg3) bool :

Adds a new knot (x, y) to the spline.

Parameters:
  • x (double) – The x-coordinate of the knot.

  • y (double) – The y-coordinate of the knot.

Returns:

true if the knot was added successfully.

Return type:

bool

class otyca_cpp.DirectIntegrationPricer

Bases: StochasticProcessPricer

Option pricer using direct integration in the Fourier domain. This class implements a numerically efficient option pricing technique based on Fourier inversion, as proposed by Kilin (2007) and Attari (2004). It computes option prices, derivatives, implied volatilities, and PDFs using the characteristic function of a given stochastic process.

class otyca_cpp.Dividend

Bases: instance

Represents a dividend with both fixed and proportional components. The Dividend class models a dividend with a fixed amount and a proportional yield. It supports common arithmetic operations, equality checks, and formatting for output.

get_fixed((Dividend)arg1) float :

Gets the fixed component of the dividend.

Returns:

The fixed component of the dividend.

Return type:

double

get_proportional((Dividend)arg1) float :

Gets the proportional component of the dividend.

Returns:

The proportional component of the dividend.

Return type:

double

set_fixed((Dividend)arg1, (float)arg2) None :

Sets the fixed component of the dividend.

Parameters:

fixed (double) – The fixed component to set.

set_proportional((Dividend)arg1, (float)arg2) None :

Sets the proportional component of the dividend.

Parameters:

proportional (double) – The proportional component to set.

class otyca_cpp.DividendBoundedSchedule

Bases: instance

A schedule that maps bounded time intervals to values of type T. The type of T is Dividend.

add_centered_on((DividendBoundedSchedule)arg1, (object)arg2, (int)arg3, (Dividend)arg4) bool :

Adds an entry to the schedule using a center reference time and a symmetric business-day window.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time.

  • business_days (int) – The number of business days before and after the reference time.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

add_with_bounds((DividendBoundedSchedule)arg1, (object)arg2, (Dividend)arg3) bool :

Adds an entry to the schedule using an explicit start and end time.

Parameters:
  • bounds (const std::pair<boost::posix_time::ptime, boost::posix_time::ptime> &) – A pair representing the start and end time of the entry.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

size((DividendBoundedSchedule)arg1) int
to_dict((DividendBoundedSchedule)arg1) object :

Converts the object to a map.

Returns:

A std::map mapping pairs of boost::posix_time::ptime to values of type T. Each key is a (start_time, end_time) pair associated with a corresponding value.

Return type:

std::map<std::pair<boost::posix_time::ptime, boost::posix_time::ptime>, T>

class otyca_cpp.DividendFlexibleSchedule

Bases: TimeDeltaDividendSchedule

A schedule that associates a value with a flexible time duration. This class extends Schedule and allows each value to be associated with a time duration, offering the ability to convert into a BoundedSchedule where each entry is bounded by its duration. The type of T is Dividend.

to_bounded_schedule((DividendFlexibleSchedule)arg1) DividendBoundedSchedule :

Converts the flexible schedule into a bounded schedule. Each entry in the flexible schedule is transformed into a bounded range by subtracting and adding the duration from the key, forming an interval.

Returns:

A shared pointer to the resulting BoundedSchedule .

Return type:

std::shared_ptr<BoundedSchedule<T>>

class otyca_cpp.DividendScatter

Bases: instance

A container for managing scattered data points with unique numeric keys. The Scatter class is a specialized map that provides additional functionalities such as adding points, retrieving values, computing minimum spacing, and summing values. The type of T is Dividend.

add((DividendScatter)arg1, (float)arg2, (Dividend)arg3) bool :

Adds a data point to the scatter collection.

Parameters:
  • x (double) – The x-coordinate.

  • y (const T &) – The y-coordinate.

Returns:

true if the point was inserted, false if it already exists.

Return type:

bool

class otyca_cpp.DividendSchedule

Bases: instance

A template class that represents a schedule with time points as keys. This class stores values of type T, indexed by time, and provides methods to add, generate, accumulate, extrapolate, and scatter values. The type of T is Dividend.

add((DividendSchedule)arg1, (object)arg2, (Dividend)arg3) bool :

Add a value at a specific time point.

Parameters:
  • t (const boost::posix_time::ptime &) – The time point at which the value is added.

  • v (const T &) – The value to be added.

Returns:

True if the value was added successfully, false otherwise.

Return type:

bool

extrapolate((DividendSchedule)arg1, (object)arg2) None :

Extrapolate values to a specified end time using a given gap.

Parameters:
  • end (const boost::posix_time::ptime &) – The end time to extrapolate to.

  • gap (const boost::posix_time::time_duration &) – The time gap between each extrapolated value.

  • value (const T &) – The value to be assigned to the extrapolated time points.

scatter((DividendSchedule)arg1, (object)arg2, (TenorCalculator)arg3, (DividendScatter)arg4) None :

Scatter values based on a reference time using a tenor calculator. This method calculates the tenor between the reference time and each time point, adding the corresponding value to the output scatter.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time used to calculate tenor.

  • f (const TenorCalculator *) – The tenor calculator.

  • out (Scatter<T> &) – The scatter object where the results are stored.

size((DividendSchedule)arg1) int
to_dict((DividendSchedule)arg1) object :

Convert the schedule to a regular map.

Returns:

A map with time points as keys and values of type T.

Return type:

std::map<boost::posix_time::ptime, T>

class otyca_cpp.DividendTable

Bases: DividendScatter

A class representing a table of Dividends indexed by time to Dividend, inheriting from Scatter . The DividendTable class is used to handle and process dividend data in pricing. It supports functions for calculating fixed present value, yields, adapting to given time grid, and checking equality between tables, etc.

fixed_present_value((DividendTable)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :
Parameters:
  • countinous_compounding_rate (double) – The countinous compounding interest rate.

  • reference_time (double) – The reference time to which the values are discounted to.

  • timel (double) – The lower bound of the time interval.

  • timeu (double) – The upper bound of the time interval.

Returns:

The present value of all fixed dividends between timel and timeu.

Return type:

double

class otyca_cpp.DoubleScatter

Bases: instance

A container for managing scattered data points with unique numeric keys. The Scatter class is a specialized map that provides additional functionalities such as adding points, retrieving values, computing minimum spacing, and summing values. The type of T is Double.

add((DoubleScatter)arg1, (float)arg2, (float)arg3) bool :

Adds a data point to the scatter collection.

Parameters:
  • x (double) – The x-coordinate.

  • y (const T &) – The y-coordinate.

Returns:

true if the point was inserted, false if it already exists.

Return type:

bool

class otyca_cpp.Estimate

Bases: instance

Represents a numerical estimate with an associated uncertainty. The Estimate class stores a value along with its uncertainty and provides operations for weighted averaging, arithmetic updates, and comparisons.

get_uncertainty((Estimate)arg1) float :

Gets the uncertainty associated with the estimate.

Returns:

The uncertainty value.

Return type:

double

get_value((Estimate)arg1) float :

Gets the estimated value.

Returns:

The estimate’s value.

Return type:

double

class otyca_cpp.EstimateScatter

Bases: instance

A container for managing scattered data points with unique numeric keys. The Scatter class is a specialized map that provides additional functionalities such as adding points, retrieving values, computing minimum spacing, and summing values. The type of T is Estimate.

add((EstimateScatter)arg1, (float)arg2, (Estimate)arg3) bool :

Adds a data point to the scatter collection.

Parameters:
  • x (double) – The x-coordinate.

  • y (const T &) – The y-coordinate.

Returns:

true if the point was inserted, false if it already exists.

Return type:

bool

class otyca_cpp.EstimateSchedule

Bases: instance

A template class that represents a schedule with time points as keys. This class stores values of type T, indexed by time, and provides methods to add, generate, accumulate, extrapolate, and scatter values. The type of T is Estimate.

add((EstimateSchedule)arg1, (object)arg2, (Estimate)arg3) bool :

Add a value at a specific time point.

Parameters:
  • t (const boost::posix_time::ptime &) – The time point at which the value is added.

  • v (const T &) – The value to be added.

Returns:

True if the value was added successfully, false otherwise.

Return type:

bool

extrapolate((EstimateSchedule)arg1, (object)arg2) None :

Extrapolate values to a specified end time using a given gap.

Parameters:
  • end (const boost::posix_time::ptime &) – The end time to extrapolate to.

  • gap (const boost::posix_time::time_duration &) – The time gap between each extrapolated value.

  • value (const T &) – The value to be assigned to the extrapolated time points.

scatter((EstimateSchedule)arg1, (object)arg2, (TenorCalculator)arg3, (EstimateScatter)arg4) None :

Scatter values based on a reference time using a tenor calculator. This method calculates the tenor between the reference time and each time point, adding the corresponding value to the output scatter.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time used to calculate tenor.

  • f (const TenorCalculator *) – The tenor calculator.

  • out (Scatter<T> &) – The scatter object where the results are stored.

size((EstimateSchedule)arg1) int
to_dict((EstimateSchedule)arg1) object :

Convert the schedule to a regular map.

Returns:

A map with time points as keys and values of type T.

Return type:

std::map<boost::posix_time::ptime, T>

class otyca_cpp.Event

Bases: instance

Represents a market event characterized by tenor, variance, and significance.

property significance

A numeric measure of the event’s statistical significance, similar to number of standard deviations.

property tenor

The event measured in terms of extra tenor (time to expiration), expressed in the unit of years.

property variance

Represents a market event characterized by tenor, variance, and significance.

class otyca_cpp.EventBoundedSchedule

Bases: instance

A schedule that maps bounded time intervals to values of type T. The type of T is Event.

add_centered_on((EventBoundedSchedule)arg1, (object)arg2, (int)arg3, (Event)arg4) bool :

Adds an entry to the schedule using a center reference time and a symmetric business-day window.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time.

  • business_days (int) – The number of business days before and after the reference time.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

add_with_bounds((EventBoundedSchedule)arg1, (object)arg2, (Event)arg3) bool :

Adds an entry to the schedule using an explicit start and end time.

Parameters:
  • bounds (const std::pair<boost::posix_time::ptime, boost::posix_time::ptime> &) – A pair representing the start and end time of the entry.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

size((EventBoundedSchedule)arg1) int
to_dict((EventBoundedSchedule)arg1) object :

Converts the object to a map.

Returns:

A std::map mapping pairs of boost::posix_time::ptime to values of type T. Each key is a (start_time, end_time) pair associated with a corresponding value.

Return type:

std::map<std::pair<boost::posix_time::ptime, boost::posix_time::ptime>, T>

class otyca_cpp.FFTPricer

Bases: FourierTransformPricer

Option pricer using Fast Fourier Transform (FFT). This class implements a numerically efficient option pricing technique based on Fast Fourier Transform (FFT), as proposed by Peter Carr and Dilip B. Madan (1999): “Option valuation using the fast Fourier transform” It computes option prices, derivatives, implied volatilities, and PDFs using the characteristic function of a given stochastic process.

class otyca_cpp.FRFTPricer

Bases: FourierTransformPricer

Option pricer using Fraction Fast Fourier Transform (FRFT). This class implements a numerically efficient option pricing technique based on Fractional Fast Fourier Transform (FRFT), as proposed by Peter Carr and Dilip B. Madan (1999): “Option valuation using the fast Fourier transform” It computes option prices, derivatives, implied volatilities, and PDFs using the characteristic function of a given stochastic process.

class otyca_cpp.FloatBoundedSchedule

Bases: instance

A schedule that maps bounded time intervals to values of type T. The type of T is Float.

add_centered_on((FloatBoundedSchedule)arg1, (object)arg2, (int)arg3, (float)arg4) bool :

Adds an entry to the schedule using a center reference time and a symmetric business-day window.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time.

  • business_days (int) – The number of business days before and after the reference time.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

add_with_bounds((FloatBoundedSchedule)arg1, (object)arg2, (float)arg3) bool :

Adds an entry to the schedule using an explicit start and end time.

Parameters:
  • bounds (const std::pair<boost::posix_time::ptime, boost::posix_time::ptime> &) – A pair representing the start and end time of the entry.

  • value (const T &) – The value associated with the time range.

Returns:

True if the insertion was successful, false otherwise.

Return type:

bool

size((FloatBoundedSchedule)arg1) int
to_dict((FloatBoundedSchedule)arg1) object :

Converts the object to a map.

Returns:

A std::map mapping pairs of boost::posix_time::ptime to values of type T. Each key is a (start_time, end_time) pair associated with a corresponding value.

Return type:

std::map<std::pair<boost::posix_time::ptime, boost::posix_time::ptime>, T>

class otyca_cpp.FloatFlexibleSchedule

Bases: TimeDeltaFloatSchedule

A schedule that associates a value with a flexible time duration. This class extends Schedule and allows each value to be associated with a time duration, offering the ability to convert into a BoundedSchedule where each entry is bounded by its duration. The type of T is Float.

to_bounded_schedule((FloatFlexibleSchedule)arg1) FloatBoundedSchedule :

Converts the flexible schedule into a bounded schedule. Each entry in the flexible schedule is transformed into a bounded range by subtracting and adding the duration from the key, forming an interval.

Returns:

A shared pointer to the resulting BoundedSchedule .

Return type:

std::shared_ptr<BoundedSchedule<T>>

class otyca_cpp.FloatSchedule

Bases: instance

A template class that represents a schedule with time points as keys. This class stores values of type T, indexed by time, and provides methods to add, generate, accumulate, extrapolate, and scatter values. The type of T is Float.

add((FloatSchedule)arg1, (object)arg2, (float)arg3) bool :

Add a value at a specific time point.

Parameters:
  • t (const boost::posix_time::ptime &) – The time point at which the value is added.

  • v (const T &) – The value to be added.

Returns:

True if the value was added successfully, false otherwise.

Return type:

bool

extrapolate((FloatSchedule)arg1, (object)arg2) None :

Extrapolate values to a specified end time using a given gap.

Parameters:
  • end (const boost::posix_time::ptime &) – The end time to extrapolate to.

  • gap (const boost::posix_time::time_duration &) – The time gap between each extrapolated value.

  • value (const T &) – The value to be assigned to the extrapolated time points.

scatter((FloatSchedule)arg1, (object)arg2, (TenorCalculator)arg3, (DoubleScatter)arg4) None :

Scatter values based on a reference time using a tenor calculator. This method calculates the tenor between the reference time and each time point, adding the corresponding value to the output scatter.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time used to calculate tenor.

  • f (const TenorCalculator *) – The tenor calculator.

  • out (Scatter<T> &) – The scatter object where the results are stored.

size((FloatSchedule)arg1) int
to_dict((FloatSchedule)arg1) object :

Convert the schedule to a regular map.

Returns:

A map with time points as keys and values of type T.

Return type:

std::map<boost::posix_time::ptime, T>

class otyca_cpp.ForwardVolatilityCRROptionCalculator

Bases: instance

american_grid_premium((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((ForwardVolatilityCRROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((ForwardVolatilityCRROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((ForwardVolatilityCRROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((ForwardVolatilityCRROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((ForwardVolatilityCRROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((ForwardVolatilityCRROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((ForwardVolatilityCRROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((ForwardVolatilityCRROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((ForwardVolatilityCRROptionCalculator)arg1) float
rho((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((ForwardVolatilityCRROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((ForwardVolatilityCRROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((ForwardVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((ForwardVolatilityCRROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((ForwardVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((ForwardVolatilityCRROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((ForwardVolatilityCRROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((ForwardVolatilityCRROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((ForwardVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((ForwardVolatilityCRROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((ForwardVolatilityCRROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((ForwardVolatilityCRROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((ForwardVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((ForwardVolatilityCRROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((ForwardVolatilityCRROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.ForwardVolatilityDCRROptionCalculator

Bases: instance

american_grid_premium((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((ForwardVolatilityDCRROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((ForwardVolatilityDCRROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((ForwardVolatilityDCRROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((ForwardVolatilityDCRROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((ForwardVolatilityDCRROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((ForwardVolatilityDCRROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((ForwardVolatilityDCRROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((ForwardVolatilityDCRROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((ForwardVolatilityDCRROptionCalculator)arg1) float
rho((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((ForwardVolatilityDCRROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((ForwardVolatilityDCRROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((ForwardVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((ForwardVolatilityDCRROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((ForwardVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((ForwardVolatilityDCRROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((ForwardVolatilityDCRROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((ForwardVolatilityDCRROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((ForwardVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((ForwardVolatilityDCRROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((ForwardVolatilityDCRROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((ForwardVolatilityDCRROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((ForwardVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((ForwardVolatilityDCRROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((ForwardVolatilityDCRROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.ForwardVolatilityJROptionCalculator

Bases: instance

american_grid_premium((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((ForwardVolatilityJROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((ForwardVolatilityJROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((ForwardVolatilityJROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((ForwardVolatilityJROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((ForwardVolatilityJROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((ForwardVolatilityJROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((ForwardVolatilityJROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((ForwardVolatilityJROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((ForwardVolatilityJROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((ForwardVolatilityJROptionCalculator)arg1) float
rho((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((ForwardVolatilityJROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((ForwardVolatilityJROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((ForwardVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((ForwardVolatilityJROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((ForwardVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((ForwardVolatilityJROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((ForwardVolatilityJROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((ForwardVolatilityJROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((ForwardVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((ForwardVolatilityJROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((ForwardVolatilityJROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((ForwardVolatilityJROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((ForwardVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((ForwardVolatilityJROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((ForwardVolatilityJROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.ForwardVolatilityLROptionCalculator

Bases: instance

american_grid_premium((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((ForwardVolatilityLROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((ForwardVolatilityLROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((ForwardVolatilityLROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((ForwardVolatilityLROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((ForwardVolatilityLROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((ForwardVolatilityLROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((ForwardVolatilityLROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((ForwardVolatilityLROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((ForwardVolatilityLROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((ForwardVolatilityLROptionCalculator)arg1) float
rho((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((ForwardVolatilityLROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((ForwardVolatilityLROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((ForwardVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((ForwardVolatilityLROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((ForwardVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((ForwardVolatilityLROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((ForwardVolatilityLROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((ForwardVolatilityLROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((ForwardVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((ForwardVolatilityLROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((ForwardVolatilityLROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((ForwardVolatilityLROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((ForwardVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((ForwardVolatilityLROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((ForwardVolatilityLROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.ForwardVolatilityTIANOptionCalculator

Bases: instance

american_grid_premium((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((ForwardVolatilityTIANOptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((ForwardVolatilityTIANOptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((ForwardVolatilityTIANOptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((ForwardVolatilityTIANOptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((ForwardVolatilityTIANOptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((ForwardVolatilityTIANOptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((ForwardVolatilityTIANOptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((ForwardVolatilityTIANOptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((ForwardVolatilityTIANOptionCalculator)arg1) float
rho((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((ForwardVolatilityTIANOptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((ForwardVolatilityTIANOptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((ForwardVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((ForwardVolatilityTIANOptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((ForwardVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((ForwardVolatilityTIANOptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((ForwardVolatilityTIANOptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((ForwardVolatilityTIANOptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((ForwardVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((ForwardVolatilityTIANOptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((ForwardVolatilityTIANOptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((ForwardVolatilityTIANOptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((ForwardVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((ForwardVolatilityTIANOptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((ForwardVolatilityTIANOptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.FourierTransform

Bases: instance

Abstract base class for Fourier transformation of various claims(payoffs). This class defines the interface for Fourier-based option pricing methods. It provides interfaces for evaluating the Fourier integrand and its derivatives of various claims(payoffs).

class otyca_cpp.FourierTransformPricer

Bases: StochasticProcessPricer

Option pricer using Fourier Transform. This class implements a numerically efficient option pricing technique based on Fourier transform, as introduced by Peter Carr and Dilip B. Madan (1999) in “Option Valuation Using the Fast Fourier Transform.” It computes option prices, derivatives, implied volatilities, and PDFs using the characteristic function of a given stochastic process.

set_fourier_transform((FourierTransformPricer)arg1, (FourierTransform)arg2) None
class otyca_cpp.Gamma

Bases: TimeChangeProcess

property mu
property nu
class otyca_cpp.ImpliedVarianceTenorCalculator

Bases: TenorCalculator

A class that calculates implied variance time based on the original time calculator. This class extends TimeCalculator and provides functionality to calculate the fraction of the year between two given times, as well as manage the reference expiration and valuation times. It also manages a variance schedule and its associated term structure.

set_original_time_calculator((ImpliedVarianceTenorCalculator)arg1, (TenorCalculator)arg2) None :

Sets the original time calculator used for time computations. This method allows setting an original time calculator, which may be used for more accurate or base calculations of time-related values.

Parameters:

original (std::shared_ptr<TenorCalculator>) – A shared pointer to the original TimeCalculator.

set_reference_expiration((ImpliedVarianceTenorCalculator)arg1, (object)arg2) None :

Sets the reference expiration time. This method allows setting the reference expiration time, which is used in calculating implied variance.

Parameters:

reference_expiration (const boost::posix_time::ptime &) – The reference expiration time to set.

set_valuation_time((ImpliedVarianceTenorCalculator)arg1, (object)arg2) None :

Sets the valuation time. This method allows setting the valuation time, which is used in variance-related calculations.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The valuation time to set.

set_variance_schedule((ImpliedVarianceTenorCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the variance schedule. This method allows setting the schedule of variance estimates used for implied variance calculations.

Parameters:

vars (const Schedule<Estimate> &) – The variance schedule to set.

tenor((ImpliedVarianceTenorCalculator)arg1, (object)arg2, (object)arg3) float :

Calculates the year fraction between two given times. This method calculates the fraction of a year between the begin and end times provided. It uses the underlying time calculator to compute this value.

Parameters:
  • begin (const boost::posix_time::ptime &) – The start time.

  • end (const boost::posix_time::ptime &) – The end time.

Returns:

The year fraction between begin and end.

Return type:

double

class otyca_cpp.InterestRateCurve

Bases: instance

Manages a collection of interest rate instruments (spots, futures, swaps) and builds a yield curve. The InterestRateCurve class allows for the creation and storage of different types of interest rate instruments, such as spot rates, futures, and swaps. It provides functionality to construct a piecewise yield curve based on these instruments. The yield curve is automatically updated when new instruments are added.

create_interest_rate_future((InterestRateCurve)arg1, (object)arg2, (float)arg3, (float)arg4) InterestRateFuture :

Creates and adds an interest rate future.

Parameters:
  • expiration (const boost::gregorian::date &) – Expiration date of the future.

  • bid (double) – Bid price of the future.

  • ask (double) – Ask price of the future.

Returns:

A shared pointer to the created InterestRateFuture.

Return type:

std::shared_ptr<InterestRateFuture>

create_interest_rate_spot((InterestRateCurve)arg1, (float)arg2, (float)arg3) InterestRateSpot :

Creates and adds an interest rate spot.

Parameters:
  • days (double) – Maturity in days.

  • rate (double) – Interest rate.

Returns:

A shared pointer to the created InterestRateSpot.

Return type:

std::shared_ptr<InterestRateSpot>

create_interest_rate_swap((InterestRateCurve)arg1, (float)arg2, (float)arg3, (float)arg4) InterestRateSwap :

Creates and adds an interest rate swap.

Parameters:
  • years (double) – Maturity of the swap in years.

  • bid (double) – Bid rate of the swap.

  • ask (double) – Ask rate of the swap.

Returns:

A shared pointer to the created InterestRateSwap.

Return type:

std::shared_ptr<InterestRateSwap>

get_yield_curve((InterestRateCurve)arg1) PieceWiseYieldCurve :

Returns the constructed piecewise yield curve.

Returns:

A shared pointer to the PieceWiseYieldCurve.

Return type:

std::shared_ptr<PieceWiseYieldCurve>

class otyca_cpp.InterestRateFuture

Bases: Security

Represents an interest rate futures contract. The InterestRateFuture class models a futures contract on short-term interest rates. It provides methods to access the expiration date and to calculate the implied interest rate based on the futures price.

class otyca_cpp.InterestRateSpot

Bases: instance

Represents a simple point on an interest rate curve, defined by a maturity (in days) and a rate.

class otyca_cpp.InterestRateSwap

Bases: Security

Represents an interest rate swap contract. The InterestRateSwap class models a fixed-for-floating interest rate swap. It provides methods to access the swap’s tenor and to calculate the implied fixed rate.

class otyca_cpp.InverseGaussian

Bases: TimeChangeProcess

property mu
property sigma
class otyca_cpp.Kou

Bases: LevyProcess

Represents the double exponential jump diffusion (Kou) stochastic process. The Kou jump process models asset prices by a stochastic jump, where the jump sizes follow a double exponential distribution. The jump size distribution is characterized by: Probability p for an upward jump with mean jump size 1/eta1, Probability 1-p for a downward jump with mean jump size -1/eta2$. This model allows for asymmetric jump behavior, capturing realistic market features like a tendency for large downward moves (crashes) and smaller upward corrections. A Jump-Diffusion Model for Option Pricing, S.G.Kou 2002

property eta1

Controls the mean size of upward jumps. The mean upward jump size is 1/_eta1. _eta1>1.

property eta2

Controls the mean size of downward jumps. The mean downward jump size is 1/_eta2. _eta2>0.

get_lambda((Kou)arg1) float
property lambda

Governs the frequency of jumps per unit time. Higher values mean more frequent jumps.

property p

Defines the probability that a jump is upward.

class otyca_cpp.LCIR

Bases: TimeChangeProcess

Represents a CIR (Cox-Ingersoll-Ross) process with leverage. The LCIR class models a Cox-Ingersoll-Ross (CIR) process with an additional correlation (leverage) between the CIR process and an external source of randomness, such as an underlying asset return process. CIR process, stochastic volatility modeling, Heston model

property kappa

Mean reversion rate. Determines the speed at which the process reverts to the long-term mean $ heta $.

property omega

Volatility coefficient. Controls the magnitude of random fluctuations in the process, scaled by the square root of the current state.

property rho

Correlation coefficient (leverage parameter). Measures the instantaneous correlation between the Brownian motion driving the CIR process and the Brownian motion driving the underlying asset or external process.

property sigma

Long-term mean level. The value toward which the CIR process tends to revert over time.

property v0

Current value of the CIR process. Represents the instantaneous level of the time-change process at the current time. Must remain non-negative.

class otyca_cpp.LevyProcess

Bases: StochasticProcess

Abstract base class for Lévy processes. A Lévy process is a stochastic process with stationary, independent increments, and is fully characterized by its characteristic exponent. This class defines the interface for Lévy processes used in Fourier-based option pricing.

class otyca_cpp.LevyProcessFactory

Bases: instance

Factory class for creating instances of Lévy processes by name. This class provides a static interface for constructing different types of Lévy process objects based on a string identifier.

create_levy_process((str)arg1) LevyProcess :

Create a Lévy process instance. Given the name of a Lévy process, this function returns a shared pointer to a newly created instance of that process. The exact list of supported process names is defined in the implementation.

Parameters:

name (const std::string &) – A string identifier for the desired Lévy process type. These are the supported Lévy processes:

Returns:

A shared pointer to the created Lévy process.

Return type:

std::shared_ptr<LevyProcess>

class otyca_cpp.LogLevel

Bases: enum

Debug = otyca_cpp.LogLevel.Debug
Error = otyca_cpp.LogLevel.Error
Info = otyca_cpp.LogLevel.Info
Warning = otyca_cpp.LogLevel.Warning
names = {'Debug': otyca_cpp.LogLevel.Debug, 'Error': otyca_cpp.LogLevel.Error, 'Info': otyca_cpp.LogLevel.Info, 'Warning': otyca_cpp.LogLevel.Warning}
values = {0: otyca_cpp.LogLevel.Debug, 1: otyca_cpp.LogLevel.Info, 2: otyca_cpp.LogLevel.Warning, 3: otyca_cpp.LogLevel.Error}
class otyca_cpp.Logger

Bases: instance

static log((LogLevel)arg1, (str)arg2) None :

Logs a message using the configured callback, if the level is sufficient.

Parameters:
  • level (LogLevel) – The severity level of the message.

  • message (const std::string &) – The message to be logged.

static set_log_callback((object)arg1) None :

Sets the global logging callback.

Parameters:

callback (LogCallback) – The function to call when logging messages.

static set_log_level((LogLevel)arg1) None :

Sets the minimum log level to be reported.

Parameters:

level (LogLevel) – The minimum severity level to log.

class otyca_cpp.Merton

Bases: LevyProcess

Represents the jump component of the Merton jump diffusion process. In the Merton model, jumps occur at random times determined by a Poisson process. The jump size follows Gaussian distribution. This jump mechanism allows the model to capture sudden large moves in asset prices, both upward and downward. The continuous part (diffusion) is governed by separate parameters and is not described here.

get_lambda((Merton)arg1) float
property lambda

The expected number of jumps per unit time. Higher values indicate more frequent jumps.

property mu

The mean size of the jump.

property sigma

The standard deviation of the jump size.

class otyca_cpp.Model1

Bases: ModelBase

calibrate((Model1)arg1, (Model1CalibrationInput)arg2, (Model1CalibrationConfig)arg3) None
evaluate((Model1)arg1, (object)arg2) float

evaluate( (Model1)arg1, (object)arg2) -> object

get_last_calibration_iterations((Model1)arg1) int
get_last_calibration_reduced_chi2((Model1)arg1) float
get_last_calibration_residuals((Model1)arg1) int
ukf((Model1)arg1, (Model1CalibrationInput)arg2) None
class otyca_cpp.Model1CalibrationConfig

Bases: instance

property epsfcn
property factor
property ftol
property gtol
property maxfev
property xtol
class otyca_cpp.Model1CalibrationInput

Bases: instance

property dy
property x
property y
class otyca_cpp.Model1CalibrationStatus

Bases: instance

aic((Model1CalibrationStatus)arg1) float
bic((Model1CalibrationStatus)arg1) float
property chi2
property cost2
property info
property iterations
message((Model1CalibrationStatus)arg1) str
property parameters
reduced_chi2((Model1CalibrationStatus)arg1) float
property residuals
class otyca_cpp.Model2

Bases: ModelBase

calibrate((Model2)arg1, (Model2CalibrationInput)arg2, (Model2CalibrationConfig)arg3) None
evaluate((Model2)arg1, (object)arg2) float

evaluate( (Model2)arg1, (object)arg2) -> object

get_last_calibration_iterations((Model2)arg1) int
get_last_calibration_reduced_chi2((Model2)arg1) float
get_last_calibration_residuals((Model2)arg1) int
ukf((Model2)arg1, (Model2CalibrationInput)arg2) None
class otyca_cpp.Model2CalibrationConfig

Bases: instance

property epsfcn
property factor
property ftol
property gtol
property maxfev
property xtol
class otyca_cpp.Model2CalibrationInput

Bases: instance

property dy
property x
property y
class otyca_cpp.Model2CalibrationStatus

Bases: instance

aic((Model2CalibrationStatus)arg1) float
bic((Model2CalibrationStatus)arg1) float
property chi2
property cost2
property info
property iterations
message((Model2CalibrationStatus)arg1) str
property parameters
reduced_chi2((Model2CalibrationStatus)arg1) float
property residuals
class otyca_cpp.ModelBase

Bases: instance

Abstract base class for parametric models supporting calibration. This class provides a generic interface for models that expose parameter access, transformation for calibration, and other utilities like parameter naming and printing.

get_calibration_parameters((ModelBase)arg1) object :

get the parameters for calibration.

Returns:

the parameters for calibration

Return type:

std::vector<double>

get_parameter_names((ModelBase)arg1) object :

Get the names of the model parameters.

Returns:

A vector of parameter names. Default implementation assigns names as “p1”, “p2”, etc.

Return type:

std::vector<std::string>

get_parameters((ModelBase)arg1) object :

Get the model’s raw parameters.

Returns:

A vector containing the model’s parameters.

Return type:

std::vector<double>

name((ModelBase)arg1) str :

Get the model’s name.

Returns:

A string representing the name of the model.

Return type:

std::string

class otyca_cpp.NelsonSiegel

Bases: Model1

Implements the Nelson-Siegel yield curve model. The Nelson-Siegel model is commonly used for fitting yield curves. It consists of four parameters: level, slope, curvature, and tau.

property curvature

Medium-term curvature parameter.

property level

Long-term level parameter.

property slope

Short-term slope parameter.

property tau

Decay factor controlling the shape.

class otyca_cpp.NelsonSiegelSvensson

Bases: NelsonSiegel

Extended Nelson-Siegel model with an additional curvature term. This class implements the Nelson-Siegel-Svensson model which adds a second curvature term to the original Nelson-Siegel formulation to better fit the term structure of interest rates.

property curvature2

Second curvature term (Svensson extension).

property tau2

Time-decay constant for the second curvature term.

class otyca_cpp.Option

Bases: Security

Represents a financial option with various pricing attributes.

get_ask_volatility((Option)arg1) float :

Calculates and gets the ask volatility.

get_bid_volatility((Option)arg1) float :

Calculates and gets the bid volatility.

get_delta((Option)arg1) float :

Calculate and gets option delta using fitted volatility.

get_delta_decay((Option)arg1) float :

Calculate and gets option Delta decay using fitted volatility.

get_expiration((Option)arg1) object :

Retrieves the option expiration date.

get_fugit((Option)arg1) float :

Calculate and gets option fugit using fitted volatility.

get_gamma((Option)arg1) float :

Calculate and gets option Gamma using fitted volatility.

get_mid_volatility((Option)arg1) float :

Calculates and gets the mid-price implied volatility.

get_osi_sub((Option)arg1) str :

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

get_phi((Option)arg1) float :

Calculate and gets option phi using fitted volatility.

get_premium((Option)arg1) float :

Calculate and gets option premium using fitted volatility.

get_rho((Option)arg1) float :

Calculate and gets option Rho using fitted volatility.

get_strike((Option)arg1) float :

Retrieves the option strike price.

get_style((Option)arg1) OptionStyle :

Retrieves the option style.

get_theta((Option)arg1) float :

Calculate and gets option Theta using fitted volatility.

get_type((Option)arg1) OptionType :

Retrieves the option type.

get_vanna((Option)arg1) float :

Calculate and gets option Vanna using fitted volatility.

get_vega((Option)arg1) float :

Calculate and gets option Vega using fitted volatility.

get_volga((Option)arg1) float :

Calculate and gets option Volga using fitted volatility.

class otyca_cpp.OptionExpiration

Bases: instance

atm_volatility((OptionExpiration)arg1, (StochasticProcess)arg2) float :

For a given stochastic process, calculate forward ATM volatility.

Returns:

Forward ATM volatility

Return type:

double

get_accumulated_fixed_dividend((OptionExpiration)arg1) float :

Retrieves the accumulated fixed dividend upto this expiration.

Returns:

The accumulated fixed dividend as a double.

Return type:

double

get_accumulated_proportional_dividend((OptionExpiration)arg1) float :

Retrieves the accumulated proportional dividend upto this expiration.

Returns:

The accumulated proportional dividend as a double.

Return type:

double

get_atm_volatility_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the at-the-money (ATM) volatility.

Returns:

The ATM volatility uncertainty as a double.

Return type:

double

get_atm_volatility_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the ATM volatility.

Returns:

The ATM volatility value as a double.

Return type:

double

get_borrow_rate_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the borrow rate estimate.

Returns:

The uncertainty in the borrow rate as a double.

Return type:

double

get_borrow_rate_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the borrow rate.

Returns:

The borrow rate value as a double.

Return type:

double

get_expiration((OptionExpiration)arg1) object :

Gets the expiration time.

Returns:

The expiration time.

Return type:

boost::posix_time::ptime

get_fair_atm_volatility((OptionExpiration)arg1) float :

Retrieves the fair at-the-money (ATM) volatility.

Returns:

The fair ATM volatility as a double.

Return type:

double

get_fair_volatility_model_reduced_chi2((OptionExpiration)arg1) float :

Retrieves the fair volatility model fitting chi2.

Returns:

The fair volatility model fitting chi2 as a double.

Return type:

double

get_fair_volatility_skew((OptionExpiration)arg1) float :

Retrieves the fair volatility skew.

Returns:

The fair volatility skew as a double.

Return type:

double

get_forward((OptionExpiration)arg1) Estimate :

Gets the estimated forward price.

Returns:

The forward price estimate.

Return type:

Estimate

get_forward_uncertainty((OptionExpiration)arg1) float :

Gets the forward price uncertainty.

Returns:

The forward price uncertainty.

Return type:

double

get_forward_value((OptionExpiration)arg1) float :

Gets the forward price value.

Returns:

The forward price value.

Return type:

double

get_hedge_tenor((OptionExpiration)arg1) float :

Retrieves the hedge tenor.

Returns:

The hedge tenor as a double.

Return type:

double

get_implied_borrow_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the implied borrow rate estimate.

Returns:

The uncertainty in the implied borrow rate as a double.

Return type:

double

get_implied_borrow_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the implied borrow rate.

Returns:

The implied borrow rate value as a double.

Return type:

double

get_implied_forward_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the implied forward estimate.

Returns:

The uncertainty in the implied forward as a double.

Return type:

double

get_implied_forward_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the implied forward.

Returns:

The implied forward value as a double.

Return type:

double

get_implied_interest_borrow((OptionExpiration)arg1) object :

Retrieves the implied interest and borrow rate estimates.

Returns:

A pair containing the implied interest and borrow rate estimates.

Return type:

std::pair<Estimate, Estimate>

get_implied_interest_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the implied interest rate estimate.

Returns:

The uncertainty in the implied interest rate as a double.

Return type:

double

get_implied_interest_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the implied interest rate.

Returns:

The implied interest rate value as a double.

Return type:

double

get_interest_rate_uncertainty((OptionExpiration)arg1) float :

Retrieves the uncertainty of the interest rate estimate.

Returns:

The uncertainty in the interest rate as a double.

Return type:

double

get_interest_rate_value((OptionExpiration)arg1) float :

Retrieves the numerical value of the interest rate.

Returns:

The interest rate value as a double.

Return type:

double

get_option_strike_dataframe((OptionExpiration)arg1) object :

Retrieves a structured representation of option strike data.

Returns:

A tuple containing vectors of option strike values, labels, and additional data.

Return type:

std::tuple<std::vector<double>, std::vector<std::string>, std::vector<std::vector<double>>>

get_option_strikes((OptionExpiration)arg1[, (object)arg2]) object
get_stochastic_process_atm_volatility((OptionExpiration)arg1) float :

Retrieves the stochastic process ATM volatility.

Returns:

The stochastic process ATM volatility as a double.

Return type:

double

get_variance_tenor((OptionExpiration)arg1) float :

Retrieves the variance tenor.

Returns:

The variance tenor as a double.

Return type:

double

get_variance_term_structure_model_value((OptionExpiration)arg1) float :

Retrieves the variance term structure model value.

Returns:

The variance term structure model value as a double.

Return type:

double

get_vix_style_volatility((OptionExpiration)arg1) float :

Retrieves the VIX-style volatility.

Returns:

The VIX-style volatility as a double.

Return type:

double

variance((OptionExpiration)arg1, (StochasticProcess)arg2) float :

For a given stochastic process, calculate variance.

Returns:

variance

Return type:

double

class otyca_cpp.OptionStrike

Bases: instance

get_call((OptionStrike)arg1) Option
get_expiration((OptionStrike)arg1) object :

Gets the expiration that it belongs to.

Returns:

The expiration.

Return type:

boost::posix_time::ptime

get_fair_volatility((OptionStrike)arg1) float :

Gets the fair volatility.

Returns:

The fair volatility value.

Return type:

double

get_implied_forward_uncertainty((OptionStrike)arg1) float :

Returns the uncertainty of the implied forward price.

Returns:

The uncertainty of the implied forward price as a double.

Return type:

double

get_implied_forward_value((OptionStrike)arg1) float :

Gets the implied forward estimate.

Returns:

The implied forward estimate.

Return type:

Estimate

get_options((OptionStrike)arg1) object :

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.

Return type:

std::vector<std::shared_ptr<Option>>

get_put((OptionStrike)arg1) Option
get_relative_strike((OptionStrike)arg1) float :

Gets the relative strike.

Returns:

The relative strike value.

Return type:

double

get_stochastic_process_volatility((OptionStrike)arg1) float
get_strike((OptionStrike)arg1) float :

Gets the strike price.

Returns:

The strike price.

Return type:

double

get_strike_volatility((OptionStrike)arg1) Estimate :

Gets the strike volatility estimate.

Returns:

The strike volatility estimate.

Return type:

Estimate

get_strike_volatility_uncertainty((OptionStrike)arg1) float :

Gets the strike volatility estimate.

Returns:

The strike volatility estimate.

Return type:

Estimate

get_strike_volatility_value((OptionStrike)arg1) float :

Gets the value of the strike volatility.

Returns:

The strike volatility value.

Return type:

double

get_volatility_model_outputs((OptionStrike)arg1) object
class otyca_cpp.OptionStyle

Bases: enum

AMERICAN = otyca_cpp.OptionStyle.AMERICAN
EUROPEAN = otyca_cpp.OptionStyle.EUROPEAN
names = {'AMERICAN': otyca_cpp.OptionStyle.AMERICAN, 'EUROPEAN': otyca_cpp.OptionStyle.EUROPEAN}
values = {0: otyca_cpp.OptionStyle.EUROPEAN, 1: otyca_cpp.OptionStyle.AMERICAN}
class otyca_cpp.OptionType

Bases: enum

CALL = otyca_cpp.OptionType.CALL
PUT = otyca_cpp.OptionType.PUT
names = {'CALL': otyca_cpp.OptionType.CALL, 'PUT': otyca_cpp.OptionType.PUT}
values = {-1: otyca_cpp.OptionType.PUT, 1: otyca_cpp.OptionType.CALL}
class otyca_cpp.PieceWiseTermStructure

Bases: TermStructure, EstimateScatter

A piecewise implementation of a term structure. This class inherits from both TermStructure and Scatter to represent term structure data in a piecewise form. Interpolation between time points allows the term structure to provide estimates at arbitrary times.

term_estimate((PieceWiseTermStructure)arg1, (float)arg2) Estimate :

Returns the term estimate at time x. This function should interpolate between known points stored in the Scatter base class.

Parameters:

x (double) – The time for which the estimate is requested.

Returns:

Estimate at time x.

Return type:

Estimate

class otyca_cpp.PieceWiseYieldCurve

Bases: PieceWiseTermStructure, YieldCurve

A piecewise implementation of a yield curve. Combines the behavior of a yield curve and a piecewise term structure to model interest rates or discount factors in a flexible, segment-wise fashion. Inherits from: PieceWiseTermStructure: to provide interpolation between known time-value points. YieldCurve: to expose discount and growth factor computations.

class otyca_cpp.Poisson

Bases: TimeChangeProcess

property lambda
class otyca_cpp.RealizedVarianceTenorCalculator

Bases: TenorCalculator

set_variance_weights((RealizedVarianceTenorCalculator)arg1, (float)arg2, (float)arg3, (float)arg4) None
tenor((RealizedVarianceTenorCalculator)arg1, (object)arg2, (object)arg3) float
class otyca_cpp.Security

Bases: instance

Represents a financial security with bid/ask prices and sizes. The Security class provides methods to access and modify market pricing data, such as bid and ask prices and their respective sizes. It also provides utility methods to compute the mid-price and spread.

get_ask_price((Security)arg1) float :

Gets the ask price.

Returns:

Ask price.

Return type:

double

get_bid_price((Security)arg1) float :

Gets the bid price.

Returns:

Bid price.

Return type:

double

id((Security)arg1) int :

Gets the ID.

Returns:

ID.

Return type:

size_t

mid((Security)arg1) float :

Computes the mid-price. If the bid price is positive, returns the weighted mid; otherwise, simple mid.

Returns:

Mid-price of the security.

Return type:

double

set_bid_ask((Security)arg1, (float)arg2, (int)arg3, (float)arg4, (int)arg5) None :

Sets bid/ask prices and sizes. If any input is negative, or if bid >= ask, values are invalidated.

Parameters:
  • bid_price (double) – The bid price.

  • bid_size (int) – The bid size.

  • ask_price (double) – The ask price.

  • ask_size (int) – The ask size.

simple_mid((Security)arg1) float :

Computes the simple (unweighted) mid-price.

Returns:

Simple mid-price.

Return type:

double

spread((Security)arg1) float :

Computes the spread between ask and bid.

Returns:

The spread.

Return type:

double

weighted_mid((Security)arg1) float :

Computes the inverse-size-weighted mid-price.

Returns:

Weighted mid-price.

Return type:

double

class otyca_cpp.SpotVolatilityCRROptionCalculator

Bases: instance

american_grid_premium((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((SpotVolatilityCRROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((SpotVolatilityCRROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((SpotVolatilityCRROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((SpotVolatilityCRROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((SpotVolatilityCRROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((SpotVolatilityCRROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((SpotVolatilityCRROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((SpotVolatilityCRROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((SpotVolatilityCRROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((SpotVolatilityCRROptionCalculator)arg1) float
rho((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((SpotVolatilityCRROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((SpotVolatilityCRROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((SpotVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((SpotVolatilityCRROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((SpotVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((SpotVolatilityCRROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((SpotVolatilityCRROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((SpotVolatilityCRROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((SpotVolatilityCRROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((SpotVolatilityCRROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((SpotVolatilityCRROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((SpotVolatilityCRROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((SpotVolatilityCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((SpotVolatilityCRROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((SpotVolatilityCRROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.SpotVolatilityDCRROptionCalculator

Bases: instance

american_grid_premium((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((SpotVolatilityDCRROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((SpotVolatilityDCRROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((SpotVolatilityDCRROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((SpotVolatilityDCRROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((SpotVolatilityDCRROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((SpotVolatilityDCRROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((SpotVolatilityDCRROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((SpotVolatilityDCRROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((SpotVolatilityDCRROptionCalculator)arg1) float
rho((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((SpotVolatilityDCRROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((SpotVolatilityDCRROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((SpotVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((SpotVolatilityDCRROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((SpotVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((SpotVolatilityDCRROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((SpotVolatilityDCRROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((SpotVolatilityDCRROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((SpotVolatilityDCRROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((SpotVolatilityDCRROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((SpotVolatilityDCRROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((SpotVolatilityDCRROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((SpotVolatilityDCRROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((SpotVolatilityDCRROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((SpotVolatilityDCRROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.SpotVolatilityJROptionCalculator

Bases: instance

american_grid_premium((SpotVolatilityJROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((SpotVolatilityJROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((SpotVolatilityJROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((SpotVolatilityJROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((SpotVolatilityJROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((SpotVolatilityJROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((SpotVolatilityJROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((SpotVolatilityJROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((SpotVolatilityJROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((SpotVolatilityJROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((SpotVolatilityJROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((SpotVolatilityJROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((SpotVolatilityJROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((SpotVolatilityJROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((SpotVolatilityJROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((SpotVolatilityJROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((SpotVolatilityJROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((SpotVolatilityJROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((SpotVolatilityJROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((SpotVolatilityJROptionCalculator)arg1) float
rho((SpotVolatilityJROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((SpotVolatilityJROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((SpotVolatilityJROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((SpotVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((SpotVolatilityJROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((SpotVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((SpotVolatilityJROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((SpotVolatilityJROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((SpotVolatilityJROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((SpotVolatilityJROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((SpotVolatilityJROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((SpotVolatilityJROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((SpotVolatilityJROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((SpotVolatilityJROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((SpotVolatilityJROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((SpotVolatilityJROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((SpotVolatilityJROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((SpotVolatilityJROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((SpotVolatilityJROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((SpotVolatilityJROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.SpotVolatilityLROptionCalculator

Bases: instance

american_grid_premium((SpotVolatilityLROptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((SpotVolatilityLROptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((SpotVolatilityLROptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((SpotVolatilityLROptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((SpotVolatilityLROptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((SpotVolatilityLROptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((SpotVolatilityLROptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((SpotVolatilityLROptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((SpotVolatilityLROptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((SpotVolatilityLROptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((SpotVolatilityLROptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((SpotVolatilityLROptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((SpotVolatilityLROptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((SpotVolatilityLROptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((SpotVolatilityLROptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((SpotVolatilityLROptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((SpotVolatilityLROptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((SpotVolatilityLROptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((SpotVolatilityLROptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((SpotVolatilityLROptionCalculator)arg1) float
rho((SpotVolatilityLROptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((SpotVolatilityLROptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((SpotVolatilityLROptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((SpotVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((SpotVolatilityLROptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((SpotVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((SpotVolatilityLROptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((SpotVolatilityLROptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((SpotVolatilityLROptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((SpotVolatilityLROptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((SpotVolatilityLROptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((SpotVolatilityLROptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((SpotVolatilityLROptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((SpotVolatilityLROptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((SpotVolatilityLROptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((SpotVolatilityLROptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((SpotVolatilityLROptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((SpotVolatilityLROptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((SpotVolatilityLROptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((SpotVolatilityLROptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.SpotVolatilityTIANOptionCalculator

Bases: instance

american_grid_premium((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the premium of an American option using a grid-based numerical method.

Returns:

The computed American option premium.

Return type:

double

carry_tenor((SpotVolatilityTIANOptionCalculator)arg1) float :

Gets the carry tenor.

Returns:

The carry tenor (in years).

Return type:

double

delta((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the delta of the option.

Returns:

The delta.

Return type:

double

delta_decay((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the decay in delta due to passage of time.

Returns:

The delta decay.

Return type:

double

early_exercise_premium((SpotVolatilityTIANOptionCalculator)arg1) float :

Computes the early exercise premium of an American option.

Returns:

The early exercise premium.

Return type:

double

european_dual_delta((SpotVolatilityTIANOptionCalculator)arg1) float :

Computes the dual delta (sensitivity to strike) of a European option.

Returns:

The European dual delta.

Return type:

double

european_grid_premium((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the premium of an European option using a grid-based numerical method.

Returns:

The computed option premium.

Return type:

double

european_premium((SpotVolatilityTIANOptionCalculator)arg1) float :

Computes the premium of a European option.

Returns:

The European option premium.

Return type:

double

european_vega((SpotVolatilityTIANOptionCalculator)arg1) float :

Computes the vega (sensitivity to volatility) of a European option.

Returns:

The European vega.

Return type:

double

forward((SpotVolatilityTIANOptionCalculator)arg1) float :

Computes and returns the forward price of the underlying asset.

Returns:

The forward price.

Return type:

double

forward_intrinsic((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the intrinsic value using the forward price.

Returns:

The forward intrinsic value.

Return type:

double

fugit((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the fugit (expected life) of the option.

Returns:

The fugit.

Return type:

double

gamma((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the gamma of the option.

Returns:

The gamma.

Return type:

double

hedge_tenor((SpotVolatilityTIANOptionCalculator)arg1) float :

Gets the hedge tenor.

Returns:

The hedge tenor (in years).

Return type:

double

implied_volatility((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5) float :

Computes the implied volatility that matches a given option price. Uses numerical methods to solve for the volatility that, when input into a pricing model, produces the specified option price.

Parameters:
  • price (double) – The observed option price to match.

  • volatility_tolerance (double) – The tolerance for volatility convergence (default = 1e-4).

  • guess (double) – The initial guess for the implied volatility (default = 0.25).

  • relative_price_tolerance (double) – The tolerance for price convergence relative to input price (default = 1e-4).

Returns:

The implied volatility.

Return type:

double

intrinsic((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the intrinsic value of the option. For a call, this is max(S - K, 0); for a put, max(K - S, 0), where S is the underlying asset price.

overwrite((SpotVolatilityTIANOptionCalculator)arg1, (DividendTable)arg2, (float)arg3, (float)arg4, (float)arg5) None :

Overwrites core market assumptions for pricing calculations. Instead of calculating time to dividends, carry time to expiration, hedge time to expiration and variance time to expiration, use these values.

Parameters:
  • dividend_table (const DividendTable &) – A new DividendTable to use.

  • carry_tenor (double) – The tenor (in years) for carry cost estimation.

  • hedge_tenor (double) – The tenor for delta hedging.

  • variance_tenor (double) – The tenor used for implied volatility input.

phi((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the phi of the option.

Returns:

The phi.

Return type:

double

premium((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the premium (price) of the option.

Returns:

The option premium.

Return type:

double

premium_function_cost_in_seconds((SpotVolatilityTIANOptionCalculator)arg1) float
rho((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the rho of the option.

Returns:

The rho.

Return type:

double

set_borrow_rate((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding borrowing rate.

Parameters:

annualized_continuous_compounding_borrow_rate (double) – The new borrowing rate.

set_ctrl_smooth((SpotVolatilityTIANOptionCalculator)arg1, (bool)arg2) None
set_dividend_schedule((SpotVolatilityTIANOptionCalculator)arg1, (DividendSchedule)arg2) None :

Sets the dividend schedule.

Parameters:

dividend_schedule (const std::shared_ptr<Schedule<Dividend>> &) – The new dividend schedule.

set_exercise_settlement_lag((SpotVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

exercise_settlement_lag (int) – The new exercise settlement lag.

set_expiration((SpotVolatilityTIANOptionCalculator)arg1, (object)arg2) None :

Sets the expiration date of the option.

Parameters:

expiration (const boost::posix_time::ptime &) – The new expiration date.

set_interest_rate((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized continuous compounding interest rate.

Parameters:

annualized_continuous_compounding_interest_rate (double) – The new interest rate.

set_option_settlement_lag((SpotVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The new option settlement lag.

set_option_style((SpotVolatilityTIANOptionCalculator)arg1, (OptionStyle)arg2) None :

Sets the style of the option (e.g., European, American).

Parameters:

style (OptionStyle) – The option style.

set_option_type((SpotVolatilityTIANOptionCalculator)arg1, (OptionType)arg2) None :

Sets the type of the option (e.g., Call or Put).

Parameters:

type (OptionType) – The option type.

set_precision((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the numerical precision used in internal calculations.

Parameters:

precision (double) – The new precision value. Recommend 1 for standard precision.

set_strike((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the strike price of the option.

Parameters:

strike (double) – The new strike price.

set_trading_calendar((SpotVolatilityTIANOptionCalculator)arg1, (TradingCalendar)arg2) None :

Sets the trading calendar used to determine business days and holidays.

Parameters:

trading_calendar (const std::shared_ptr<TradingCalendar> &) – Shared pointer to a TradingCalendar instance.

set_underlying_price((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the underlying asset price.

Parameters:

underlying_price (double) – The new underlying asset price.

set_underlying_settlement_lag((SpotVolatilityTIANOptionCalculator)arg1, (int)arg2) None :

Sets the underlying settlement lag.

Parameters:

underlying_settlement_lag (int) – The new underlying settlement lag.

set_valuation_time((SpotVolatilityTIANOptionCalculator)arg1, (object)arg2) None :

Sets the valuation time.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_schedule((SpotVolatilityTIANOptionCalculator)arg1, (EstimateSchedule)arg2) None :

Sets the schedule of estimated variances to be used in computations.

Parameters:

variance_schedule (const std::shared_ptr<Schedule<Estimate>> &) – Shared pointer to a Schedule containing Estimate objects.

set_variance_tenor_calculator((SpotVolatilityTIANOptionCalculator)arg1, (TenorCalculator)arg2) None :

Sets the tenor calculator used to compute time intervals for variance calculations.

Parameters:

tenor_calculator (const std::shared_ptr<TenorCalculator> &) – Shared pointer to a TenorCalculator instance.

set_volatility((SpotVolatilityTIANOptionCalculator)arg1, (float)arg2) None :

Sets the annualized volatility used in pricing and risk calculations.

Parameters:

annualized_volatility (double) – The annualized volatility.

theta((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the theta of the option.

Returns:

The theta.

Return type:

double

time_value((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the time value of the option.

Returns:

The time value.

Return type:

double

vanna((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the vanna of the option.

Returns:

The vanna.

Return type:

double

variance_tenor((SpotVolatilityTIANOptionCalculator)arg1) float :

Gets the variance tenor.

Returns:

The variance tenor (in years).

Return type:

double

vega((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the vega of the option.

Returns:

The vega.

Return type:

double

volga((SpotVolatilityTIANOptionCalculator)arg1) float :

Returns the volga (or vomma) of the option.

Returns:

The volga.

Return type:

double

class otyca_cpp.StochasticProcess

Bases: Model2

get_parameter_names((StochasticProcess)arg1) object
specification((StochasticProcess)arg1) str
variance((StochasticProcess)arg1, (float)arg2) float
volatility((StochasticProcess)arg1, (float)arg2) float

volatility( (StochasticProcess)arg1, (float)arg2, (float)arg3) -> float

class otyca_cpp.StochasticProcessPricer

Bases: instance

Abstract base class for pricing instruments under a stochastic process.

implied_volatility((StochasticProcessPricer)arg1, (StochasticProcess)process, (object)expirations, (object)strikes[, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE[, (float)tolerance=0.0001]]) object

implied_volatility( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (object)strikes [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE [, (float)tolerance=0.0001]]) -> object

implied_volatility( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (float)strike [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE [, (float)tolerance=0.0001]]) -> float

name((StochasticProcessPricer)arg1) str :

Returns the name of the pricer.

Returns:

The name as a string.

Return type:

std::string

pdf((StochasticProcessPricer)arg1, (StochasticProcess)process, (object)expirations, (object)strikes[, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) object

pdf( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (object)strikes [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) -> object

pdf( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (float)strike [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) -> float

price((StochasticProcessPricer)arg1, (StochasticProcess)process, (object)expirations, (object)strikes[, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) object :

Prices for multiple tenors and strike sets.

stochastic_processconst StochasticProcess *

Pointer to the stochastic process model.

tenorsconst std::vector<double> &

Vector of tenors.

strikesconst std::vector<std::vector<double>> &

2D vector of strikes (per tenor).

strike_typeStrikeType

Type of strike to use. See StrikeType for available options.

std::vector<std::vector<double>>

2D vector of prices.

price( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (object)strikes [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) -> object :

Prices for multiple tenors and strike sets.

stochastic_processconst StochasticProcess *

Pointer to the stochastic process model.

tenorsconst std::vector<double> &

Vector of tenors.

strikesconst std::vector<std::vector<double>> &

2D vector of strikes (per tenor).

strike_typeStrikeType

Type of strike to use. See StrikeType for available options.

std::vector<std::vector<double>>

2D vector of prices.

price( (StochasticProcessPricer)arg1, (StochasticProcess)process, (float)expiration, (float)strike [, (StrikeType)strike_type=otyca_cpp.StrikeType.LOG_STRIKE]) -> float :

Prices for multiple tenors and strike sets.

stochastic_processconst StochasticProcess *

Pointer to the stochastic process model.

tenorsconst std::vector<double> &

Vector of tenors.

strikesconst std::vector<std::vector<double>> &

2D vector of strikes (per tenor).

strike_typeStrikeType

Type of strike to use. See StrikeType for available options.

std::vector<std::vector<double>>

2D vector of prices.

class otyca_cpp.StrikeType

Bases: enum

DELTA = otyca_cpp.StrikeType.DELTA
LOG_STRIKE = otyca_cpp.StrikeType.LOG_STRIKE
STDEV = otyca_cpp.StrikeType.STDEV
STRIKE = otyca_cpp.StrikeType.STRIKE
names = {'DELTA': otyca_cpp.StrikeType.DELTA, 'LOG_STRIKE': otyca_cpp.StrikeType.LOG_STRIKE, 'STDEV': otyca_cpp.StrikeType.STDEV, 'STRIKE': otyca_cpp.StrikeType.STRIKE}
values = {0: otyca_cpp.StrikeType.LOG_STRIKE, 1: otyca_cpp.StrikeType.STRIKE, 2: otyca_cpp.StrikeType.DELTA, 3: otyca_cpp.StrikeType.STDEV}
class otyca_cpp.TenorCalculator

Bases: instance

tenor((TenorCalculator)arg1, (object)arg2, (object)arg3) float
class otyca_cpp.TermStructure

Bases: instance

Abstract base class representing a term structure of rates. A TermStructure provides methods to retrieve term and forward estimates or rates as a function of time. Derived classes must implement the term_estimate function.

forward_rate((TermStructure)arg1, (float)arg2, (float)arg3) float :

Returns the forward rate (value of the forward estimate) between two times. This is a convenience method that calls forward_estimate(t1, t2) and returns its value.

Parameters:
  • t1 (double) – The start time.

  • t2 (double) – The end time.

Returns:

The forward rate value between t1 and t2.

Return type:

double

term_rate((TermStructure)arg1, (float)arg2) float :

Returns the term rate (value of the term estimate) at a given time. This is a convenience method that calls term_estimate(t) and returns its value.

Parameters:

t (double) – The time at which to evaluate the term rate.

Returns:

The rate value at time t.

Return type:

double

class otyca_cpp.TimeBoundedBimodalGaussian

Bases: TimeBoundedJump, BimodalGaussian

class otyca_cpp.TimeBoundedJump

Bases: instance

property tau_hi
property tau_lo
class otyca_cpp.TimeChangeProcess

Bases: ModelBase

Abstract base class for time change processes. A time change process is a mathematical model that modifies time or time steps in Levy processes. This class defines the interface for time change processes used in pricing and risk management.

compare_d_phi_d_p((TimeChangeProcess)arg1, (object)arg2, (object)arg3, (object)arg4, (float)arg5, (float)arg6) bool :

Compare the derivative of the Laplace transform with respect to parameters against a finite difference approximation. This method checks if the analytical derivative of the Laplace transform with respect to parameters matches the finite difference approximation within a specified tolerance.

Parameters:
  • t (const arma::rowvec &) – The time vector for which the Laplace transform is computed.

  • u (const arma::cx_colvec &) – Complex-valued column vector of Fourier arguments.

  • psi (const arma::cx_colvec &) – The characteristic exponent.

  • h (double) – The step size for finite differences (default: 1e-6).

  • tolerance (double) – The tolerance for comparison (default: 1e-6).

Returns:

true if the derivatives are within the tolerance, false otherwise.

Return type:

bool

compare_d_phi_d_psi((TimeChangeProcess)arg1, (object)arg2, (object)arg3, (object)arg4, (float)arg5, (float)arg6) bool :

Compare the derivative of the Laplace transform with respect to psi against a finite difference approximation. This method checks if the analytical derivative of the Laplace transform with respect to psi matches the finite difference approximation within a specified tolerance.

Parameters:
  • t (const arma::rowvec &) – The time vector.

  • u (const arma::cx_colvec &) – Complex-valued column vector of Fourier arguments.

  • psi (const arma::cx_colvec &) – The characteristic exponent.

  • h (double) – The step size for finite differences (default: 1e-6).

  • tolerance (double) – The tolerance for comparison (default: 1e-6).

Returns:

true if the derivatives are within the tolerance, false otherwise.

Return type:

bool

d_phi_d_p_finite_difference((TimeChangeProcess)arg1, (object)arg2, (object)arg3, (object)arg4, (float)arg5) object :

Compute the derivative of the Laplace transform with respect to parameters using finite differences. This method approximates the derivative of the Laplace transform with respect to parameters using finite differences.

Parameters:
  • t (const arma::rowvec &) – The time vector for which the Laplace transform is computed.

  • u (const arma::cx_colvec &) – Complex-valued column vector of Fourier arguments.

  • psi (const arma::cx_colvec &) – The characteristic exponent.

  • h (double) – The step size for finite differences (default: 1e-6).

Returns:

A vector that contains the finite difference approximations of the derivatives of characteristic function with respect to parameters.

Return type:

std::vector<arma::cx_mat>

d_phi_d_psi_finite_difference((TimeChangeProcess)arg1, (object)arg2, (object)arg3, (object)arg4, (float)arg5) object :

Compute the derivative of the Laplace transform with respect to psi using finite differences. This method approximates the derivative of the Laplace transform with respect to psi using finite differences.

Parameters:
  • t (const arma::rowvec &) – The time vector for which the Laplace transform is computed.

  • u (const arma::cx_colvec &) – Complex-valued column vector of Fourier arguments.

  • psi (const arma::cx_colvec &) – The characteristic exponent.

  • h (double) – The step size for finite differences (default: 1e-6).

Returns:

The finite difference approximation of the derivative of characteristic function with respect to psi.

Return type:

arma::cx_mat

class otyca_cpp.TimeChangeProcessFactory

Bases: instance

A factory class to create instances of TimeChangeProcess. The TimeChangeProcessFactory class provides a static method to create instances of the TimeChangeProcess class based on the specification of the time change process. TimeChangeProcess

create_time_change_process((str)arg1) TimeChangeProcess :

Creates a TimeChangeProcess object based on a string specification. This static method creates a new TimeChangeProcess object based on the given string that specifies the time change process.

Parameters:

time_change (const std::string &) – A string that defines the time change process. supported time change procsses are:

Returns:

A shared pointer to a new TimeChangeProcess object.

Return type:

std::shared_ptr<TimeChangeProcess>

class otyca_cpp.TimeChangedLevyProcess

Bases: StochasticProcess

Represents a time-changed Lévy process, where a base Lévy process is evaluated at a stochastic clock. This class composes a Lévy process with a time change process to model a wider range of stochastic behaviors. It supports computing characteristic functions, their derivatives, and various parameter manipulations.

get_levy_process((TimeChangedLevyProcess)arg1) LevyProcess :

Get the underlying Lévy process.

Returns:

A shared pointer to the Lévy process.

Return type:

std::shared_ptr<LevyProcess>

get_time_change((TimeChangedLevyProcess)arg1) TimeChangeProcess :

Get the time change process.

Returns:

A shared pointer to the time change process.

Return type:

std::shared_ptr<TimeChangeProcess>

set_levy_process((TimeChangedLevyProcess)arg1, (LevyProcess)arg2) None :

Set the underlying Lévy process.

Parameters:

p (std::shared_ptr<LevyProcess>) – Shared pointer to the new Lévy process.

set_time_change((TimeChangedLevyProcess)arg1, (TimeChangeProcess)arg2) None :

Set the time change process.

Parameters:

p (std::shared_ptr<TimeChangeProcess>) – Shared pointer to the new time change process.

class otyca_cpp.TimeChangedLevyProcessFactory

Bases: instance

create_time_changed_levy_process((object)arg1, (str)arg2) TimeChangedLevyProcess :

Create process with levy components and time change

create_time_changed_levy_process( (str)arg1) -> TimeChangedLevyProcess :

Create process with specification

class otyca_cpp.TimeDeltaDividendSchedule

Bases: instance

A template class that represents a schedule with time points as keys. This class stores values of type T, indexed by time, and provides methods to add, generate, accumulate, extrapolate, and scatter values. The type of T is TimeDeltaDividend.

add((TimeDeltaDividendSchedule)arg1, (object)arg2, (object)arg3) bool :

Add a value at a specific time point.

Parameters:
  • t (const boost::posix_time::ptime &) – The time point at which the value is added.

  • v (const T &) – The value to be added.

Returns:

True if the value was added successfully, false otherwise.

Return type:

bool

extrapolate((TimeDeltaDividendSchedule)arg1, (object)arg2) None :

Extrapolate values to a specified end time using a given gap.

Parameters:
  • end (const boost::posix_time::ptime &) – The end time to extrapolate to.

  • gap (const boost::posix_time::time_duration &) – The time gap between each extrapolated value.

  • value (const T &) – The value to be assigned to the extrapolated time points.

scatter((TimeDeltaDividendSchedule)arg1, (object)arg2, (TenorCalculator)arg3, (object)arg4) None :

Scatter values based on a reference time using a tenor calculator. This method calculates the tenor between the reference time and each time point, adding the corresponding value to the output scatter.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time used to calculate tenor.

  • f (const TenorCalculator *) – The tenor calculator.

  • out (Scatter<T> &) – The scatter object where the results are stored.

size((TimeDeltaDividendSchedule)arg1) int
to_dict((TimeDeltaDividendSchedule)arg1) object :

Convert the schedule to a regular map.

Returns:

A map with time points as keys and values of type T.

Return type:

std::map<boost::posix_time::ptime, T>

class otyca_cpp.TimeDeltaFloatSchedule

Bases: instance

A template class that represents a schedule with time points as keys. This class stores values of type T, indexed by time, and provides methods to add, generate, accumulate, extrapolate, and scatter values. The type of T is TimeDeltaFloat.

add((TimeDeltaFloatSchedule)arg1, (object)arg2, (object)arg3) bool :

Add a value at a specific time point.

Parameters:
  • t (const boost::posix_time::ptime &) – The time point at which the value is added.

  • v (const T &) – The value to be added.

Returns:

True if the value was added successfully, false otherwise.

Return type:

bool

extrapolate((TimeDeltaFloatSchedule)arg1, (object)arg2) None :

Extrapolate values to a specified end time using a given gap.

Parameters:
  • end (const boost::posix_time::ptime &) – The end time to extrapolate to.

  • gap (const boost::posix_time::time_duration &) – The time gap between each extrapolated value.

  • value (const T &) – The value to be assigned to the extrapolated time points.

scatter((TimeDeltaFloatSchedule)arg1, (object)arg2, (TenorCalculator)arg3, (object)arg4) None :

Scatter values based on a reference time using a tenor calculator. This method calculates the tenor between the reference time and each time point, adding the corresponding value to the output scatter.

Parameters:
  • reference_time (const boost::posix_time::ptime &) – The reference time used to calculate tenor.

  • f (const TenorCalculator *) – The tenor calculator.

  • out (Scatter<T> &) – The scatter object where the results are stored.

size((TimeDeltaFloatSchedule)arg1) int
to_dict((TimeDeltaFloatSchedule)arg1) object :

Convert the schedule to a regular map.

Returns:

A map with time points as keys and values of type T.

Return type:

std::map<boost::posix_time::ptime, T>

class otyca_cpp.TimeFixedBimodalGaussian

Bases: TimeFixedJump, BimodalGaussian

class otyca_cpp.TimeFixedJump

Bases: instance

property tau
class otyca_cpp.TimeValueFourierTransform

Bases: FourierTransform

Fourier transform of option time value.

class otyca_cpp.TradingCalendar

Bases: instance

Utility class for determining trading days, holidays, and related calendar computations.

calendar_days((object)arg1, (object)arg2) int :

Computes the total number of calendar days between two dates.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

Returns:

Total number of calendar days.

Return type:

int

day_of_week_days((object)arg1, (object)arg2, (int)arg3) int :

Counts the number of specific weekday occurrences between two dates.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

  • day_of_week (int) – 0 = Sunday, …, 6 = Saturday.

Returns:

Number of days matching the specified weekday.

Return type:

int

effective_dividend_time_for_early_exercise((object)arg1) object :

Returns the effective dividend time relevant for early exercise logic.

Parameters:

d (const boost::gregorian::date &) – The reference date.

Returns:

The timestamp representing the dividend time.

Return type:

boost::posix_time::ptime

get_holidays() object :

Returns the list of holiday dates.

Returns:

Vector of holiday dates.

Return type:

std::vector<boost::gregorian::date>

half_trade_day((object)arg1) bool :

Checks if a date is a half trading day.

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if the date is a half trading day.

Return type:

bool

holiday((object)arg1) bool :

Checks whether a date is a recognized holiday.

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if the date is a holiday.

Return type:

bool

next_to_non_trade_day((object)arg1) bool :

Checks if a given day is adjacent to a non-trading day.

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if the previous or next day is a non-trade day.

Return type:

bool

non_trade_day((object)arg1) bool :

Checks whether a given day is a non-trade day (weekend or holiday).

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if the date is a non-trade day.

Return type:

bool

non_trade_days((object)arg1, (object)arg2) int :

Computes the number of non-trading days between two dates.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

Returns:

The number of non-trading days.

Return type:

int

post_holidays((object)arg1, (object)arg2) int :

Counts the number of days immediately after holidays in a range.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

Returns:

Number of post-holiday days.

Return type:

int

pre_holidays((object)arg1, (object)arg2) int :

Counts the number of days immediately before holidays in a range.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

Returns:

Number of pre-holiday days.

Return type:

int

previous_trade_date((object)arg1) object :

Gets the last trading day before a given date.

Parameters:

d (const boost::gregorian::date &) – The reference date.

Returns:

The previous trading day.

Return type:

boost::gregorian::date

previous_trade_day_cutoff((object)arg1) object :

Gets the market cutoff time on the previous trading day before the given date.

Parameters:

d (const boost::gregorian::date &) – The reference date.

Returns:

Time of market close on the previous trade day.

Return type:

boost::posix_time::ptime

set_holidays((TradingCalendar)arg1, (object)arg2) None :

Sets the holiday calendar and sorts it.

Parameters:

holidays (const std::vector<boost::gregorian::date> &) – List of dates to set as holidays.

trade_dates((object)arg1, (object)arg2) object :

Retrieves a list of all trade dates between two dates.

Parameters:
  • start (const boost::gregorian::date &) – Start date (inclusive).

  • end (const boost::gregorian::date &) – End date (exclusive).

Returns:

Vector of trade dates.

Return type:

std::vector<boost::gregorian::date>

trade_day((object)arg1) bool :

Checks if a given day is a valid trade day.

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if the date is not a weekend or holiday.

Return type:

bool

trade_day_offset((object)arg1, (int)arg2) object :

Returns the trade day that is a given number of trade days from the specified day.

Parameters:
  • day (const boost::gregorian::date &) – The reference date.

  • trade_offset (int) – The number of trade days to offset.

Returns:

The resulting trade date.

Return type:

boost::gregorian::date

trade_days((object)arg1, (object)arg2) int :

Computes the number of trading days between two dates.

Parameters:
  • first_day (const boost::gregorian::date &) – Start date (inclusive).

  • last_day (const boost::gregorian::date &) – End date (exclusive).

Returns:

Number of trading days.

Return type:

int

trade_days_to_calendar_days((object)arg1, (int)arg2) int :

Converts a trade day offset into calendar day offset.

Parameters:
  • day (const boost::gregorian::date &) – Starting date.

  • trade_offset (int) – Number of trade days to move.

Returns:

Number of calendar days between start and resulting trade day.

Return type:

int

weekend((object)arg1) bool :

Checks if a date is a weekend (Saturday or Sunday).

Parameters:

day (const boost::gregorian::date &) – The date to check.

Returns:

True if it’s Saturday or Sunday.

Return type:

bool

class otyca_cpp.TreeType

Bases: enum

CRR = otyca_cpp.TreeType.CRR
DCRR = otyca_cpp.TreeType.DCRR
JR = otyca_cpp.TreeType.JR
LR = otyca_cpp.TreeType.LR
TIAN = otyca_cpp.TreeType.TIAN
names = {'CRR': otyca_cpp.TreeType.CRR, 'DCRR': otyca_cpp.TreeType.DCRR, 'JR': otyca_cpp.TreeType.JR, 'LR': otyca_cpp.TreeType.LR, 'TIAN': otyca_cpp.TreeType.TIAN}
values = {0: otyca_cpp.TreeType.CRR, 1: otyca_cpp.TreeType.JR, 2: otyca_cpp.TreeType.TIAN, 3: otyca_cpp.TreeType.LR, 4: otyca_cpp.TreeType.DCRR}
class otyca_cpp.UnderlyingDataset

Bases: instance

A comprehensive dataset for option pricing and analysis on an underlying security. The UnderlyingDataset class provides a complete framework for managing, analyzing, and modeling option data for a specific underlying security. It stores and processes: Underlying security price information Dividend schedules and projections Option expirations and strikes Interest rate and borrowing cost curves Volatility term structures and models Stochastic processes for option pricing Event schedules for market events This class serves as the central repository for all data required for sophisticated option pricing, volatility surface modeling, and risk analysis. This class uses the POSIX time library for handling dates and times. It implements the enable_shared_from_this pattern for safe shared_ptr management.

add_composite_stochastic_process_config((UnderlyingDataset)arg1, (CompositeStochasticProcessConfig)arg2) int :

Adds a composite stochastic process configuration.

Parameters:

config (const CompositeStochasticProcessConfig &) – The composite stochastic process configuration.

Returns:

The ID of the added configuration.

Return type:

size_t

add_projected_dividend((UnderlyingDataset)arg1, (object)arg2, (float)arg3, (float)arg4, (int)arg5) None :

Adds a projected dividend to the dataset.

Parameters:
  • ex_date (const boost::gregorian::date &) – The ex-dividend date.

  • fixed (double) – The fixed dividend amount.

  • proportional (double) – The proportional dividend amount (default: 0).

  • ex_date_uncertainty (int) – The uncertainty in the ex-dividend date (default: 0).

create_option((UnderlyingDataset)arg1, (object)arg2, (float)arg3, (OptionType)arg4) Option :

Creates an option contract with the specified parameters.

Parameters:
  • expiration (const boost::posix_time::ptime &) – The expiration date of the option.

  • strike (double) – The strike price of the option.

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

Returns:

A shared pointer to the created option.

Return type:

std::shared_ptr<Option>

create_underlying((UnderlyingDataset)arg1) Security :

Creates the underlying security.

Returns:

A shared pointer to the created security.

Return type:

std::shared_ptr<Security>

get_bounded_bimodal_gaussian((UnderlyingDataset)arg1) object :

Retrieves the bounded bimodal Gaussian model.

Returns:

A shared pointer to the bounded bimodal Gaussian model.

Return type:

std::shared_ptr<BoundedSchedule<std::shared_ptr<TimeBoundedBimodalGaussian>>>

get_composite_stochastic_process((UnderlyingDataset)arg1, (int)arg2) CompositeStochasticProcess :

Retrieves the composite stochastic process associated with the given ID.

Parameters:

id (size_t) – The ID of the stochastic process.

Returns:

A shared pointer to the composite stochastic process.

Return type:

std::shared_ptr<CompositeStochasticProcess>

get_composite_stochastic_process_volatility_grid((UnderlyingDataset)arg1, (int)arg2) object :

Gets the volatility grid for the specified composite stochastic process.

Parameters:

id (size_t) – The ID of the stochastic process.

Returns:

A 2D vector containing the volatility grid values.

Return type:

std::vector<std::vector<double>>

get_composite_stochastic_process_volatility_grids((UnderlyingDataset)arg1) object :

Retrieves the composite stochastic process volatility grids.

Returns:

A 3D vector containing volatility grids. The first dimension is in stochastic processes. The second dimension is in tenors. The third dimension is in deltas.

Return type:

std::vector<std::vector<std::vector<double>>>

get_composite_stochastic_processes((UnderlyingDataset)arg1) object :

Retrieves all composite stochastic processes.

Returns:

A vector of shared pointers to composite stochastic processes.

Return type:

std::vector<std::shared_ptr<CompositeStochasticProcess>>

get_dividend_schedule((UnderlyingDataset)arg1) DividendSchedule :

Retrieves the dividend schedule.

Returns:

A shared pointer to the schedule of dividends.

Return type:

std::shared_ptr<Schedule<Dividend>>

get_expiration_volatility_model_dataframe((UnderlyingDataset)arg1) object :

Retrieves the expiration volatility model data.

Returns:

A tuple containing vectors of expiration dates, labels, and a 2D vector of volatility model values.

Return type:

std::tuple<std::vector<boost::posix_time::ptime>, std::vector<std::string>, std::vector<std::vector<double>>>

get_expirations((UnderlyingDataset)arg1) object :

Retrieves the list of option expiration datetime.

Returns:

A vector of expiration datetime.

Return type:

std::vector<boost::posix_time::ptime>

get_implied_event_schedule((UnderlyingDataset)arg1) EventBoundedSchedule :

Retrieves the implied event schedule.

Returns:

A shared pointer to the implied event schedule.

Return type:

std::shared_ptr<BoundedSchedule<Event>>

get_implied_interest_borrow_dataframe((UnderlyingDataset)arg1) object :

Retrieves the implied interest and borrow rate data.

Returns:

A tuple containing vectors of dates, labels, and a 2D vector of implied interest and borrow rate values.

Return type:

std::tuple<std::vector<boost::posix_time::ptime>, std::vector<std::string>, std::vector<std::vector<double>>>

get_option_bid_ask_implied_volatility_dataframe((UnderlyingDataset)arg1) object :

Retrieves the bid-ask implied volatility data for options.

Returns:

A tuple containing vectors of column names, row names, and a 2D vector of bid-ask implied volatilities.

Return type:

std::tuple<std::vector<std::string>, std::vector<std::string>, std::vector<std::vector<double>>>

get_option_expiration((UnderlyingDataset)arg1, (object)arg2) OptionExpiration :

Retrieves the option expiration object for a given expiration datetime.

Parameters:

expiration (const boost::posix_time::ptime &) – The expiration datetime.

Returns:

A shared pointer to the corresponding OptionExpiration object.

Return type:

std::shared_ptr<OptionExpiration>

get_option_expiration_dataframe((UnderlyingDataset)arg1) object :

Retrieves the option expiration data in a structured format.

Returns:

A tuple containing vectors of expiration dates, labels, and a 2D vector of expiration-related values.

Return type:

std::tuple<std::vector<boost::posix_time::ptime>, std::vector<std::string>, std::vector<std::vector<double>>>

get_option_expirations((UnderlyingDataset)arg1[, (object)arg2]) object
get_option_pricing_dataframe((UnderlyingDataset)arg1) object :

Retrieves the option pricing data in a structured format.

Returns:

A tuple containing vectors of column names, row names, and a 2D vector of option pricing values.

Return type:

std::tuple<std::vector<std::string>, std::vector<std::string>, std::vector<std::vector<double>>>

get_option_strikes((UnderlyingDataset)arg1) object :

Retrieves all option strikes in the dataset.

Returns:

A vector of shared pointers to OptionStrike objects.

Return type:

std::vector<std::shared_ptr<OptionStrike>>

get_options((UnderlyingDataset)arg1) object :

Retrieves all option contracts associated with the dataset.

Returns:

A vector of shared pointers to Option objects.

Return type:

std::vector<std::shared_ptr<Option>>

get_stochastic_process_option_expiration_dataframe((UnderlyingDataset)arg1, (CompositeStochasticProcess)arg2) object :

Retrieves the option expiration data for a stochastic process.

Parameters:

stochastic_process (std::shared_ptr<const StochasticProcess>) – A shared pointer to the stochastic process.

Returns:

A tuple containing vectors of expiration dates, labels, and a 2D vector of expiration-related values.

Return type:

std::tuple<std::vector<boost::posix_time::ptime>, std::vector<std::string>, std::vector<std::vector<double>>>

get_stochastic_process_option_expiration_volatility_grid_dataframe((UnderlyingDataset)arg1, (CompositeStochasticProcess)arg2) object :

Retrieves the volatility grid for option expirations of a stochastic process.

Parameters:

stochastic_process (std::shared_ptr<const StochasticProcess>) – A shared pointer to the stochastic process.

Returns:

A tuple containing vectors of expiration dates, labels, and a 2D vector of volatility values.

Return type:

std::tuple<std::vector<boost::posix_time::ptime>, std::vector<std::string>, std::vector<std::vector<double>>>

get_stochastic_process_option_strike_volatilities((UnderlyingDataset)arg1, (StochasticProcess)arg2) object :

Retrieves option strike volatilities for a given stochastic process.

Parameters:

stochastic_process (const std::shared_ptr<StochasticProcess>) – A shared pointer to the stochastic process.

Returns:

A map associating option strikes with their corresponding volatilities.

Return type:

std::map<std::shared_ptr<OptionStrike>, double>

get_stochastic_process_volatility_grid_dataframe((UnderlyingDataset)arg1, (CompositeStochasticProcess)arg2) object :

Retrieves the stochastic process volatility grid for a given stochastic process.

Parameters:

stochastic_process (std::shared_ptr<const StochasticProcess>) – A shared pointer to the stochastic process.

Returns:

A tuple containing vectors of column names, row names, and a 2D vector of volatility values.

Return type:

std::tuple<std::vector<std::string>, std::vector<std::string>, std::vector<std::vector<double>>>

get_underlying((UnderlyingDataset)arg1) Security :

Gets the underlying security.

Returns:

A shared pointer to the underlying security.

Return type:

std::shared_ptr<Security>

get_underlying_price((UnderlyingDataset)arg1) float :

Retrieves the price of the underlying asset.

Returns:

The underlying price.

Return type:

double

get_variance_schedule((UnderlyingDataset)arg1) EstimateSchedule :

Retrieves the variance schedule.

Returns:

A shared pointer to the variance schedule.

Return type:

std::shared_ptr<Schedule<Estimate>>

get_variance_tenor_calculator((UnderlyingDataset)arg1) TenorCalculator :

Gets the variance tenor calculator.

Returns:

A shared pointer to the TenorCalculator instance.

Return type:

std::shared_ptr<TenorCalculator>

get_variance_term_structure_model((UnderlyingDataset)arg1) object :

Retrieves the variance term structure model.

Returns:

A shared pointer to the variance term structure model.

Return type:

std::shared_ptr<BumpModel>

get_yield_curve((UnderlyingDataset)arg1) PieceWiseYieldCurve :

Retrieves the yield curve.

Returns:

A shared pointer to the yield curve.

Return type:

std::shared_ptr<PieceWiseYieldCurve>

set_borrow_curve((UnderlyingDataset)arg1, (PieceWiseYieldCurve)arg2) None :

Sets the borrow curve.

Parameters:

borrow_curve (std::shared_ptr<PieceWiseYieldCurve>) – A shared pointer to the new borrow curve.

set_exercise_settlement_lag((UnderlyingDataset)arg1, (int)arg2) None :

Sets the exercise settlement lag.

Parameters:

lag (int) – The exercise settlement lag in days.

set_option_settlement_lag((UnderlyingDataset)arg1, (int)arg2) None :

Sets the option settlement lag.

Parameters:

option_settlement_lag (int) – The settlement lag in days.

set_option_style((UnderlyingDataset)arg1, (OptionStyle)arg2) None :

Sets the option style (e.g., European, American).

Parameters:

style (OptionStyle) – The option style to be set.

set_underlying((UnderlyingDataset)arg1, (Security)arg2) None :

Sets the underlying security.

Parameters:

und (const std::shared_ptr<Security> &) – A shared pointer to the underlying security.

set_underlying_settlement_lag((UnderlyingDataset)arg1, (int)arg2) None :

Sets the underlying asset settlement lag.

Parameters:

underlying_settlement_lag (int) – The settlement lag in days.

set_valuation_time((UnderlyingDataset)arg1, (object)arg2) None :

Sets the valuation time. Change of valuation time does NOT automatically change the settlement lags.

Parameters:

valuation_time (const boost::posix_time::ptime &) – The new valuation time.

set_variance_tenor_calculator((UnderlyingDataset)arg1, (TenorCalculator)arg2) None :

Sets the variance tenor calculator.

Parameters:

variance_tenor_calculator (std::shared_ptr<TenorCalculator>) – A shared pointer to the TenorCalculator instance.

set_yield_curve((UnderlyingDataset)arg1, (PieceWiseYieldCurve)arg2) None :

Sets the yield curve.

Parameters:

yield_curve (std::shared_ptr<PieceWiseYieldCurve>) – A shared pointer to the new yield curve.

setup((UnderlyingDataset)arg1) None :

Performs setup operations for the object. Need to be called after all setters and before all getters.

class otyca_cpp.VarianceGamma

Bases: LevyProcess

Represents the Variance Gamma (VG) stochastic process. The Variance Gamma process is a pure jump process with infinite activity and finite variation, used to model returns with heavy tails and skewness, beyond what standard Brownian motion allows. The VG process can be constructed by evaluating Brownian motion with drift at random times given by a Gamma process. The Variance Gamma process has no diffusion component; all randomness comes from jumps. The Variance Gamma Process and Option Pricing, Dilip B. Madan, Peter P. Carr, Eric C. Chang, 1998

property nu

variance rate of the gamma time change.

property sigma

brownian motion variance, controls the spread (scale) of returns.

property theta

brownian motion drift, controls the asymmetry (skewness) of the return distribution.

class otyca_cpp.VolatilityType

Bases: enum

FORWARD_VOLATILITY = otyca_cpp.VolatilityType.FORWARD_VOLATILITY
SPOT_VOLATILITY = otyca_cpp.VolatilityType.SPOT_VOLATILITY
names = {'FORWARD_VOLATILITY': otyca_cpp.VolatilityType.FORWARD_VOLATILITY, 'SPOT_VOLATILITY': otyca_cpp.VolatilityType.SPOT_VOLATILITY}
values = {0: otyca_cpp.VolatilityType.SPOT_VOLATILITY, 1: otyca_cpp.VolatilityType.FORWARD_VOLATILITY}
class otyca_cpp.YieldCurve

Bases: TermStructure

Represents a yield curve, modeling the relationship between term and interest rates. Inherits from the TermStructure base class and provides methods to compute discount and growth factors based on the term rate.

discount_factor((YieldCurve)arg1, (float)arg2) float :

Computes the discount factor for a given time to maturity. The discount factor is calculated using the formula: D(t) = exp(-r(t) * t) where r(t) is the term rate at time t.

Parameters:

t (double) – Time to maturity.

Returns:

The discount factor.

Return type:

double

growth_factor((YieldCurve)arg1, (float)arg2) float :

Computes the growth factor for a given time to maturity. The growth factor is calculated using the formula: G(t) = exp(r(t) * t) where r(t) is the term rate at time t.

Parameters:

t (double) – Time to maturity.

Returns:

The growth factor.

Return type:

double

otyca_cpp.from_iso_string((str)arg1) object :

From non delimited iso form string

otyca_cpp.from_simple_string((str)arg1) object :

from YYYY-mmm-DD string where mmm is a 3 char month name.

otyca_cpp.from_string((str)arg1) object :

From delimited date string where with order iso standard ordering: year-month-day (eg: 2002-1-25)

otyca_cpp.from_undelimited_string((str)arg1) object :

From iso type date string where with order year-month-day eg: 20020125

otyca_cpp.from_us_string((str)arg1) object :

A delimited date string where with order month-day-year eg: 1-25-2002

otyca_cpp.get_delta_grid() object :

Retrieves the delta grid used for volatility grid.

Returns:

A tuple containing a vector of delta labels (e.g., “10D”, “20D”) and a vector of corresponding numerical delta values.

Return type:

std::tuple<std::vector<std::string>, std::vector<double>>

otyca_cpp.get_tenor_grid() object :

Retrieves the tenor grid used for volatility grid.

Returns:

A tuple containing a vector of tenor labels (e.g., “1w”, “1m”) and a vector of corresponding numerical tenor values in years.

Return type:

std::tuple<std::vector<std::string>, std::vector<double>>

otyca_cpp.time_from_string((str)arg1) object :

From delimited string

otyca_cpp.version() str :

Retrieves the version of the library. This function returns a string representing the current version of the library in this format: “major.minor.patch”

Returns:

A string containing the version of the library.

Return type:

std::string