Lean  $LEAN_TAG$
QuantConnect.Securities.Option.Option Class Reference

Option Security Object Implementation for Option Assets More...

Inheritance diagram for QuantConnect.Securities.Option.Option:
[legend]

Public Member Functions

 Option (SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, OptionSymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypes)
 Constructor for the option security More...
 
 Option (Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, OptionSymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypes, SecurityCache securityCache, Security underlying)
 Constructor for the option security More...
 
decimal GetAggregateExerciseAmount ()
 Aggregate exercise amount or aggregate contract value. It is the total amount of cash one will pay (or receive) for the shares of the underlying stock if he/she decides to exercise (or is assigned an exercise notice). This amount is not the premium paid or received for an equity option. More...
 
decimal GetExerciseQuantity ()
 Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of all contracts held by this account, taking into account the contract's Right as well as the contract's current ContractUnitOfTrade, which may have recently changed due to a split/reverse split in the underlying security. More...
 
decimal GetExerciseQuantity (decimal exerciseOrderQuantity)
 Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of the specified exerciseOrderQuantity , taking into account the contract's Right as well as the contract's current ContractUnitOfTrade, which may have recently changed due to a split/reverse split in the underlying security. More...
 
bool IsAutoExercised (decimal underlyingPrice)
 Checks if option is eligible for automatic exercise on expiration More...
 
decimal GetIntrinsicValue (decimal underlyingPrice)
 Intrinsic value function of the option More...
 
decimal GetPayOff (decimal underlyingPrice)
 Option payoff function at expiration time More...
 
decimal OutOfTheMoneyAmount (decimal underlyingPrice)
 Option out of the money function More...
 
OptionPriceModelResult EvaluatePriceModel (Slice slice, OptionContract contract)
 For this option security object, evaluates the specified option contract to compute a theoretical price, IV and greeks More...
 
void SetOptionAssignmentModel (PyObject pyObject)
 Sets the automatic option assignment model More...
 
void SetOptionAssignmentModel (IOptionAssignmentModel optionAssignmentModel)
 Sets the automatic option assignment model More...
 
void SetOptionExerciseModel (PyObject pyObject)
 Sets the option exercise model More...
 
void SetOptionExerciseModel (IOptionExerciseModel optionExerciseModel)
 Sets the option exercise model More...
 
void SetFilter (int minStrike, int maxStrike)
 Sets the ContractFilter to a new instance of the filter using the specified min and max strike values. Contracts with expirations further than 35 days out will also be filtered. More...
 
void SetFilter (TimeSpan minExpiry, TimeSpan maxExpiry)
 Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values More...
 
void SetFilter (int minStrike, int maxStrike, TimeSpan minExpiry, TimeSpan maxExpiry)
 Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values More...
 
void SetFilter (int minStrike, int maxStrike, int minExpiryDays, int maxExpiryDays)
 Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values More...
 
void SetFilter (Func< OptionFilterUniverse, OptionFilterUniverse > universeFunc)
 Sets the ContractFilter to a new universe selection function More...
 
void SetFilter (PyObject universeFunc)
 Sets the ContractFilter to a new universe selection function More...
 
override void SetDataNormalizationMode (DataNormalizationMode mode)
 Sets the data normalization mode to be used by this security More...
 
- Public Member Functions inherited from QuantConnect.Securities.Security
 Security (SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypesProvider, SecurityCache cache)
 Construct a new security vehicle based on the user options. More...
 
 Security (Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypesProvider, SecurityCache cache)
 Construct a new security vehicle based on the user options. More...
 
BaseData GetLastData ()
 Get the last price update set to the security if any else null More...
 
virtual void SetLocalTimeKeeper (LocalTimeKeeper localTimeKeeper)
 Sets the LocalTimeKeeper to be used for this Security. This is the source of this instance's time. More...
 
void SetMarketPrice (BaseData data)
 Update any security properties based on the latest market data and time More...
 
void Update (IReadOnlyList< BaseData > data, Type dataType, bool? containsFillForwardData=null)
 Updates all of the security properties, such as price/OHLCV/bid/ask based on the data provided. Data is also stored into the security's data cache More...
 
bool IsCustomData ()
 Returns true if the security contains at least one subscription that represents custom data More...
 
void SetLeverage (decimal leverage)
 Set the leverage parameter for this security More...
 
void RefreshDataNormalizationModeProperty ()
 This method will refresh the value of the DataNormalizationMode property. This is required for backward-compatibility. TODO: to be deleted with the DataNormalizationMode property More...
 
void SetFeeModel (IFeeModel feelModel)
 Sets the fee model More...
 
void SetFeeModel (PyObject feelModel)
 Sets the fee model More...
 
void SetFillModel (IFillModel fillModel)
 Sets the fill model More...
 
void SetFillModel (PyObject fillModel)
 Sets the fill model More...
 
void SetSettlementModel (ISettlementModel settlementModel)
 Sets the settlement model More...
 
void SetSettlementModel (PyObject settlementModel)
 Sets the settlement model More...
 
void SetSlippageModel (ISlippageModel slippageModel)
 Sets the slippage model More...
 
void SetSlippageModel (PyObject slippageModel)
 Sets the slippage model More...
 
void SetVolatilityModel (IVolatilityModel volatilityModel)
 Sets the volatility model More...
 
void SetVolatilityModel (PyObject volatilityModel)
 Sets the volatility model More...
 
void SetBuyingPowerModel (IBuyingPowerModel buyingPowerModel)
 Sets the buying power model More...
 
void SetBuyingPowerModel (PyObject pyObject)
 Sets the buying power model More...
 
void SetMarginInterestRateModel (IMarginInterestRateModel marginInterestRateModel)
 Sets the margin interests rate model More...
 
void SetMarginInterestRateModel (PyObject pyObject)
 Sets the margin interests rate model More...
 
void SetMarginModel (IBuyingPowerModel marginModel)
 Sets the margin model More...
 
void SetMarginModel (PyObject pyObject)
 Sets the margin model More...
 
void SetShortableProvider (PyObject pyObject)
 Set Python Shortable Provider for this Security More...
 
void SetShortableProvider (IShortableProvider shortableProvider)
 Set Shortable Provider for this Security More...
 
void SetDataFilter (PyObject pyObject)
 Set Security Data Filter More...
 
void SetDataFilter (ISecurityDataFilter dataFilter)
 Set Security Data Filter More...
 
override bool TryGetMember (GetMemberBinder binder, out object result)
 This is a DynamicObject override. Not meant for external use. More...
 
override bool TrySetMember (SetMemberBinder binder, object value)
 This is a DynamicObject override. Not meant for external use. More...
 
override bool TryInvokeMember (InvokeMemberBinder binder, object[] args, out object result)
 This is a DynamicObject override. Not meant for external use. More...
 
void Add (string key, object value)
 Adds the specified custom property. This allows us to use the security object as a dynamic object for quick storage. More...
 
bool TryGet< T > (string key, out T value)
 Gets the specified custom property More...
 
Get< T > (string key)
 Gets the specified custom property More...
 
bool Remove (string key)
 Removes a custom property. More...
 
bool Remove< T > (string key, out T value)
 Removes a custom property. More...
 
void Clear ()
 Removes every custom property that had been set. More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Public Attributes

bool IsOptionChain => Symbol.IsCanonical()
 Returns true if this is the option chain security, false if it is a specific option contract More...
 
bool IsOptionContract => !Symbol.IsCanonical()
 Returns true if this is a specific option contract security, false if it is the option chain security More...
 
decimal StrikePrice => Symbol.ID.StrikePrice
 Gets the strike price More...
 
DateTime Expiry => Symbol.ID.Date
 Gets the expiration date More...
 
OptionRight Right => Symbol.ID.OptionRight
 Gets the right being purchased (call [right to buy] or put [right to sell]) More...
 
OptionStyle Style => Symbol.ID.OptionStyle
 Gets the option style More...
 
override decimal BidPrice => Cache.BidPrice
 Gets the most recent bid price if available More...
 
override decimal AskPrice => Cache.AskPrice
 Gets the most recent ask price if available More...
 
- Public Attributes inherited from QuantConnect.Securities.Security
SecurityType Type => Symbol.ID.SecurityType
 Type of the security. More...
 
bool HasData => GetLastData() != null
 There has been at least one datapoint since our algorithm started running for us to determine price. More...
 
virtual bool HoldStock => Holdings.HoldStock
 Read only property that checks if we currently own stock in the company. More...
 
virtual bool Invested => HoldStock
 Alias for HoldStock - Do we have any of this security More...
 
virtual decimal Price => Cache.Price
 Get the current value of the security. More...
 
virtual decimal Leverage => Holdings.Leverage
 Leverage for this Security. More...
 
virtual decimal High => Cache.High == 0 ? Price : Cache.High
 If this uses tradebar data, return the most recent high. More...
 
virtual decimal Low => Cache.Low == 0 ? Price : Cache.Low
 If this uses tradebar data, return the most recent low. More...
 
virtual decimal Close => Cache.Close == 0 ? Price : Cache.Close
 If this uses tradebar data, return the most recent close. More...
 
virtual decimal Open => Cache.Open == 0 ? Price : Cache.Open
 If this uses tradebar data, return the most recent open. More...
 
virtual decimal Volume => Cache.Volume
 Access to the volume of the equity today More...
 
virtual decimal BidPrice => Cache.BidPrice == 0 ? Price : Cache.BidPrice
 Gets the most recent bid price if available More...
 
virtual decimal BidSize => Cache.BidSize
 Gets the most recent bid size if available More...
 
virtual decimal AskPrice => Cache.AskPrice == 0 ? Price : Cache.AskPrice
 Gets the most recent ask price if available More...
 
virtual decimal AskSize => Cache.AskSize
 Gets the most recent ask size if available More...
 
virtual long OpenInterest => Cache.OpenInterest
 Access to the open interest of the security today More...
 

Static Public Attributes

const int DefaultSettlementDays = 1
 The default number of days required to settle an equity sale More...
 
static readonly TimeSpan DefaultSettlementTime = new (8, 0, 0)
 The default time of day for settlement More...
 
- Static Public Attributes inherited from QuantConnect.Securities.Security
const decimal NullLeverage = 0
 A null security leverage value More...
 

Protected Member Functions

 Option (Symbol symbol, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, IVolatilityModel volatilityModel, IBuyingPowerModel buyingPowerModel, ISecurityDataFilter dataFilter, IPriceVariationModel priceVariationModel, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypesProvider, Security underlying)
 Creates instance of the Option class. More...
 
- Protected Member Functions inherited from QuantConnect.Securities.Security
 Security (Symbol symbol, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, IVolatilityModel volatilityModel, IBuyingPowerModel buyingPowerModel, ISecurityDataFilter dataFilter, IPriceVariationModel priceVariationModel, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypesProvider, IMarginInterestRateModel marginInterestRateModel)
 Construct a new security vehicle based on the user options. More...
 
 Security (SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, IVolatilityModel volatilityModel, IBuyingPowerModel buyingPowerModel, ISecurityDataFilter dataFilter, IPriceVariationModel priceVariationModel, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypesProvider, IMarginInterestRateModel marginInterestRateModel)
 Temporary convenience constructor More...
 
virtual void UpdateConsumersMarketPrice (BaseData data)
 Update market price of this Security More...
 

Properties

decimal ScaledStrikePrice [get]
 Gets the strike price multiplied by the strike multiplier More...
 
int ContractUnitOfTrade [get, set]
 When the holder of an equity option exercises one contract, or when the writer of an equity option is assigned an exercise notice on one contract, this unit of trade, usually 100 shares of the underlying security, changes hands. More...
 
int ContractMultiplier [get, set]
 The contract multiplier for the option security More...
 
SettlementType ExerciseSettlement [get, set]
 Specifies if option contract has physical or cash settlement on exercise More...
 
Security Underlying [get, set]
 Gets or sets the underlying security object. More...
 
IOptionPriceModel PriceModel [get, set]
 Gets or sets the price model for this option security More...
 
IOptionExerciseModel OptionExerciseModel [get, set]
 Fill model used to produce fill events for this security More...
 
IOptionAssignmentModel OptionAssignmentModel [get, set]
 The automatic option assignment model More...
 
bool EnableGreekApproximation [get, set]
 When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers More...
 
IDerivativeSecurityFilter< OptionUniverseContractFilter [get, set]
 Gets or sets the contract filter More...
 
- Properties inherited from QuantConnect.Securities.Security
IShortableProvider ShortableProvider [get]
 This securities IShortableProvider More...
 
IEnumerable< SubscriptionDataConfigSubscriptions [get]
 Gets all the subscriptions for this security More...
 
Symbol Symbol [get]
 Symbol for the asset. More...
 
Cash QuoteCurrency [get]
 Gets the Cash object used for converting the quote currency to the account currency More...
 
SymbolProperties SymbolProperties [get, protected set]
 Gets the symbol properties for this security More...
 
Resolution Resolution [get]
 Resolution of data requested for this security. More...
 
bool IsFillDataForward [get]
 Indicates the data will use previous bars when there was no trading in this time period. This was a configurable datastream setting set in initialization. More...
 
bool IsExtendedMarketHours [get]
 Indicates the security will continue feeding data after the primary market hours have closed. This was a configurable setting set in initialization. More...
 
DataNormalizationMode DataNormalizationMode [get]
 Gets the data normalization mode used for this security More...
 
SubscriptionDataConfig SubscriptionDataConfig [get]
 Gets the subscription configuration for this security More...
 
virtual bool IsTradable [get, set]
 Gets or sets whether or not this security should be considered tradable More...
 
bool IsDelisted [get, set]
 True if the security has been delisted from exchanges and is no longer tradable More...
 
SecurityCache Cache [get, set]
 Data cache for the security to store previous price information. More...
 
SecurityHolding Holdings [get, set]
 Holdings class contains the portfolio, cash and processes order fills. More...
 
SecurityExchange Exchange [get, set]
 Exchange class contains the market opening hours, along with pre-post market hours. More...
 
IFeeModel FeeModel [get, set]
 Fee model used to compute order fees for this security More...
 
IFillModel FillModel [get, set]
 Fill model used to produce fill events for this security More...
 
ISlippageModel SlippageModel [get, set]
 Slippage model use to compute slippage of market orders More...
 
ISecurityPortfolioModel PortfolioModel [get, set]
 Gets the portfolio model used by this security More...
 
IBuyingPowerModel BuyingPowerModel [get, set]
 Gets the buying power model used for this security More...
 
IBuyingPowerModel MarginModel [get, set]
 Gets the buying power model used for this security, an alias for BuyingPowerModel More...
 
IMarginInterestRateModel MarginInterestRateModel [get, set]
 Gets or sets the margin interest rate model More...
 
ISettlementModel SettlementModel [get, set]
 Gets the settlement model used for this security More...
 
IVolatilityModel VolatilityModel [get, set]
 Gets the volatility model used for this security More...
 
ISecurityDataFilter DataFilter [get, set]
 Customizable data filter to filter outlier ticks before they are passed into user event handlers. By default all ticks are passed into the user algorithms. More...
 
IPriceVariationModel PriceVariationModel [get, set]
 Customizable price variation model used to define the minimum price variation of this security. By default minimum price variation is a constant find in the symbol-properties-database. More...
 
dynamic Data [get]
 Provides dynamic access to data in the cache More...
 
virtual DateTime LocalTime [get]
 Local time for this market More...
 
Fundamental Fundamentals [get]
 Gets the fundamental data associated with the security if there is any, otherwise null. More...
 
object this[string key] [get, set]
 Gets or sets the specified custom property through the indexer. This is a wrapper around the Get<T>(string) and Add(string,object) methods. More...
 
- Properties inherited from QuantConnect.Interfaces.ISecurityPrice
decimal Price [get]
 Get the current value of the security. More...
 
decimal Close [get]
 If this uses trade bar data, return the most recent close. More...
 
decimal Volume [get]
 Access to the volume of the equity today More...
 
decimal BidPrice [get]
 Gets the most recent bid price if available More...
 
decimal BidSize [get]
 Gets the most recent bid size if available More...
 
decimal AskPrice [get]
 Gets the most recent ask price if available More...
 
decimal AskSize [get]
 Gets the most recent ask size if available More...
 
long OpenInterest [get]
 Access to the open interest of the security today More...
 
Symbol Symbol [get]
 Symbol for the asset. More...
 
SymbolProperties SymbolProperties [get]
 SymbolProperties of the symbol More...
 
- Properties inherited from QuantConnect.Securities.IDerivativeSecurity
Security Underlying [get, set]
 Gets or sets the underlying security for the derivative More...
 
- Properties inherited from QuantConnect.Interfaces.IOptionPrice
ISecurityPrice Underlying [get]
 Gets a reduced interface of the underlying security object. More...
 

Detailed Description

Option Security Object Implementation for Option Assets

See also
Security

Definition at line 38 of file Option.cs.

Constructor & Destructor Documentation

◆ Option() [1/3]

QuantConnect.Securities.Option.Option.Option ( SecurityExchangeHours  exchangeHours,
SubscriptionDataConfig  config,
Cash  quoteCurrency,
OptionSymbolProperties  symbolProperties,
ICurrencyConverter  currencyConverter,
IRegisteredSecurityDataTypesProvider  registeredTypes 
)

Constructor for the option security

Parameters
exchangeHoursDefines the hours this exchange is open
quoteCurrencyThe cash object that represent the quote currency
configThe subscription configuration for this security
symbolPropertiesThe symbol properties for this security
currencyConverterCurrency converter used to convert CashAmount instances into units of the account currency
registeredTypesProvides all data types registered in the algorithm

Used in testing

Definition at line 61 of file Option.cs.

Here is the call graph for this function:

◆ Option() [2/3]

QuantConnect.Securities.Option.Option.Option ( Symbol  symbol,
SecurityExchangeHours  exchangeHours,
Cash  quoteCurrency,
OptionSymbolProperties  symbolProperties,
ICurrencyConverter  currencyConverter,
IRegisteredSecurityDataTypesProvider  registeredTypes,
SecurityCache  securityCache,
Security  underlying 
)

Constructor for the option security

Parameters
symbolThe symbol of the security
exchangeHoursDefines the hours this exchange is open
quoteCurrencyThe cash object that represent the quote currency
symbolPropertiesThe symbol properties for this security
currencyConverterCurrency converter used to convert CashAmount instances into units of the account currency
registeredTypesProvides all data types registered in the algorithm
securityCacheCache to store security information
underlyingFuture underlying security

Definition at line 101 of file Option.cs.

◆ Option() [3/3]

QuantConnect.Securities.Option.Option.Option ( Symbol  symbol,
Cash  quoteCurrency,
SymbolProperties  symbolProperties,
SecurityExchange  exchange,
SecurityCache  cache,
ISecurityPortfolioModel  portfolioModel,
IFillModel  fillModel,
IFeeModel  feeModel,
ISlippageModel  slippageModel,
ISettlementModel  settlementModel,
IVolatilityModel  volatilityModel,
IBuyingPowerModel  buyingPowerModel,
ISecurityDataFilter  dataFilter,
IPriceVariationModel  priceVariationModel,
ICurrencyConverter  currencyConverter,
IRegisteredSecurityDataTypesProvider  registeredTypesProvider,
Security  underlying 
)
protected

Creates instance of the Option class.

Allows for the forwarding of the security configuration to the base Security constructor

Definition at line 136 of file Option.cs.

Here is the call graph for this function:

Member Function Documentation

◆ GetAggregateExerciseAmount()

decimal QuantConnect.Securities.Option.Option.GetAggregateExerciseAmount ( )

Aggregate exercise amount or aggregate contract value. It is the total amount of cash one will pay (or receive) for the shares of the underlying stock if he/she decides to exercise (or is assigned an exercise notice). This amount is not the premium paid or received for an equity option.

Definition at line 283 of file Option.cs.

◆ GetExerciseQuantity() [1/2]

decimal QuantConnect.Securities.Option.Option.GetExerciseQuantity ( )

Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of all contracts held by this account, taking into account the contract's Right as well as the contract's current ContractUnitOfTrade, which may have recently changed due to a split/reverse split in the underlying security.

Long option positions result in exercise while short option positions result in assignment. This function uses the term exercise loosely to refer to both situations.

Definition at line 297 of file Option.cs.

Here is the caller graph for this function:

◆ GetExerciseQuantity() [2/2]

decimal QuantConnect.Securities.Option.Option.GetExerciseQuantity ( decimal  exerciseOrderQuantity)

Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of the specified exerciseOrderQuantity , taking into account the contract's Right as well as the contract's current ContractUnitOfTrade, which may have recently changed due to a split/reverse split in the underlying security.

Long option positions result in exercise while short option positions result in assignment. This function uses the term exercise loosely to refer to both situations.

exerciseOrderQuantity The quantity of contracts being exercised as provided by the OptionExerciseOrder. A negative value indicates exercise (we are long and the order quantity is negative to bring us (closer) to zero. A positive value indicates assignment (we are short and the order quantity is positive to bring us (closer) to zero.

Definition at line 316 of file Option.cs.

◆ IsAutoExercised()

bool QuantConnect.Securities.Option.Option.IsAutoExercised ( decimal  underlyingPrice)

Checks if option is eligible for automatic exercise on expiration

Definition at line 333 of file Option.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIntrinsicValue()

decimal QuantConnect.Securities.Option.Option.GetIntrinsicValue ( decimal  underlyingPrice)

Intrinsic value function of the option

Definition at line 341 of file Option.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPayOff()

decimal QuantConnect.Securities.Option.Option.GetPayOff ( decimal  underlyingPrice)

Option payoff function at expiration time

Parameters
underlyingPriceThe price of the underlying
Returns

Definition at line 351 of file Option.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OutOfTheMoneyAmount()

decimal QuantConnect.Securities.Option.Option.OutOfTheMoneyAmount ( decimal  underlyingPrice)

Option out of the money function

Parameters
underlyingPriceThe price of the underlying
Returns

Definition at line 361 of file Option.cs.

◆ EvaluatePriceModel()

OptionPriceModelResult QuantConnect.Securities.Option.Option.EvaluatePriceModel ( Slice  slice,
OptionContract  contract 
)

For this option security object, evaluates the specified option contract to compute a theoretical price, IV and greeks

Parameters
sliceThe current data slice. This can be used to access other information available to the algorithm
contractThe option contract to evaluate
Returns
An instance of OptionPriceModelResult containing the theoretical price of the specified option contract

Implements QuantConnect.Interfaces.IOptionPrice.

Definition at line 396 of file Option.cs.

Here is the call graph for this function:

◆ SetOptionAssignmentModel() [1/2]

void QuantConnect.Securities.Option.Option.SetOptionAssignmentModel ( PyObject  pyObject)

Sets the automatic option assignment model

Parameters
pyObjectThe option assignment model to use

Definition at line 463 of file Option.cs.

◆ SetOptionAssignmentModel() [2/2]

void QuantConnect.Securities.Option.Option.SetOptionAssignmentModel ( IOptionAssignmentModel  optionAssignmentModel)

Sets the automatic option assignment model

Parameters
optionAssignmentModelThe option assignment model to use

Definition at line 487 of file Option.cs.

◆ SetOptionExerciseModel() [1/2]

void QuantConnect.Securities.Option.Option.SetOptionExerciseModel ( PyObject  pyObject)

Sets the option exercise model

Parameters
pyObjectThe option exercise model to use

Definition at line 496 of file Option.cs.

◆ SetOptionExerciseModel() [2/2]

void QuantConnect.Securities.Option.Option.SetOptionExerciseModel ( IOptionExerciseModel  optionExerciseModel)

Sets the option exercise model

Parameters
optionExerciseModelThe option exercise model to use

Definition at line 520 of file Option.cs.

◆ SetFilter() [1/6]

void QuantConnect.Securities.Option.Option.SetFilter ( int  minStrike,
int  maxStrike 
)

Sets the ContractFilter to a new instance of the filter using the specified min and max strike values. Contracts with expirations further than 35 days out will also be filtered.

Parameters
minStrikeThe min strike rank relative to market price, for example, -1 would put a lower bound of one strike under market price, where a +1 would put a lower bound of one strike over market price
maxStrikeThe max strike rank relative to market place, for example, -1 would put an upper bound of on strike under market price, where a +1 would be an upper bound of one strike over market price

Definition at line 536 of file Option.cs.

Here is the caller graph for this function:

◆ SetFilter() [2/6]

void QuantConnect.Securities.Option.Option.SetFilter ( TimeSpan  minExpiry,
TimeSpan  maxExpiry 
)

Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values

Parameters
minExpiryThe minimum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in less than 10 days
maxExpiryThe maximum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in more than 10 days

Definition at line 549 of file Option.cs.

◆ SetFilter() [3/6]

void QuantConnect.Securities.Option.Option.SetFilter ( int  minStrike,
int  maxStrike,
TimeSpan  minExpiry,
TimeSpan  maxExpiry 
)

Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values

Parameters
minStrikeThe min strike rank relative to market price, for example, -1 would put a lower bound of one strike under market price, where a +1 would put a lower bound of one strike over market price
maxStrikeThe max strike rank relative to market place, for example, -1 would put an upper bound of on strike under market price, where a +1 would be an upper bound of one strike over market price
minExpiryThe minimum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in less than 10 days
maxExpiryThe maximum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in more than 10 days

Definition at line 568 of file Option.cs.

◆ SetFilter() [4/6]

void QuantConnect.Securities.Option.Option.SetFilter ( int  minStrike,
int  maxStrike,
int  minExpiryDays,
int  maxExpiryDays 
)

Sets the ContractFilter to a new instance of the filter using the specified min and max strike and expiration range values

Parameters
minStrikeThe min strike rank relative to market price, for example, -1 would put a lower bound of one strike under market price, where a +1 would put a lower bound of one strike over market price
maxStrikeThe max strike rank relative to market place, for example, -1 would put an upper bound of on strike under market price, where a +1 would be an upper bound of one strike over market price
minExpiryDaysThe minimum time, expressed in days, until expiry to include, for example, 10 would exclude contracts expiring in less than 10 days
maxExpiryDaysThe maximum time, expressed in days, until expiry to include, for example, 10 would exclude contracts expiring in more than 10 days

Definition at line 589 of file Option.cs.

◆ SetFilter() [5/6]

void QuantConnect.Securities.Option.Option.SetFilter ( Func< OptionFilterUniverse, OptionFilterUniverse universeFunc)

Sets the ContractFilter to a new universe selection function

Parameters
universeFuncnew universe selection function

Definition at line 600 of file Option.cs.

◆ SetFilter() [6/6]

void QuantConnect.Securities.Option.Option.SetFilter ( PyObject  universeFunc)

Sets the ContractFilter to a new universe selection function

Parameters
universeFuncnew universe selection function

Definition at line 615 of file Option.cs.

◆ SetDataNormalizationMode()

override void QuantConnect.Securities.Option.Option.SetDataNormalizationMode ( DataNormalizationMode  mode)
virtual

Sets the data normalization mode to be used by this security

Reimplemented from QuantConnect.Securities.Security.

Definition at line 653 of file Option.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ DefaultSettlementDays

const int QuantConnect.Securities.Option.Option.DefaultSettlementDays = 1
static

The default number of days required to settle an equity sale

Definition at line 43 of file Option.cs.

◆ DefaultSettlementTime

readonly TimeSpan QuantConnect.Securities.Option.Option.DefaultSettlementTime = new (8, 0, 0)
static

The default time of day for settlement

Definition at line 48 of file Option.cs.

◆ IsOptionChain

bool QuantConnect.Securities.Option.Option.IsOptionChain => Symbol.IsCanonical()

Returns true if this is the option chain security, false if it is a specific option contract

Definition at line 202 of file Option.cs.

◆ IsOptionContract

bool QuantConnect.Securities.Option.Option.IsOptionContract => !Symbol.IsCanonical()

Returns true if this is a specific option contract security, false if it is the option chain security

Definition at line 207 of file Option.cs.

◆ StrikePrice

decimal QuantConnect.Securities.Option.Option.StrikePrice => Symbol.ID.StrikePrice

Gets the strike price

Definition at line 212 of file Option.cs.

◆ Expiry

DateTime QuantConnect.Securities.Option.Option.Expiry => Symbol.ID.Date

Gets the expiration date

Definition at line 226 of file Option.cs.

◆ Right

OptionRight QuantConnect.Securities.Option.Option.Right => Symbol.ID.OptionRight

Gets the right being purchased (call [right to buy] or put [right to sell])

Definition at line 231 of file Option.cs.

◆ Style

OptionStyle QuantConnect.Securities.Option.Option.Style => Symbol.ID.OptionStyle

Gets the option style

Definition at line 236 of file Option.cs.

◆ BidPrice

override decimal QuantConnect.Securities.Option.Option.BidPrice => Cache.BidPrice

Gets the most recent bid price if available

Definition at line 241 of file Option.cs.

◆ AskPrice

override decimal QuantConnect.Securities.Option.Option.AskPrice => Cache.AskPrice

Gets the most recent ask price if available

Definition at line 246 of file Option.cs.

Property Documentation

◆ ScaledStrikePrice

decimal QuantConnect.Securities.Option.Option.ScaledStrikePrice
get

Gets the strike price multiplied by the strike multiplier

Definition at line 218 of file Option.cs.

◆ ContractUnitOfTrade

int QuantConnect.Securities.Option.Option.ContractUnitOfTrade
getset

When the holder of an equity option exercises one contract, or when the writer of an equity option is assigned an exercise notice on one contract, this unit of trade, usually 100 shares of the underlying security, changes hands.

Definition at line 253 of file Option.cs.

◆ ContractMultiplier

int QuantConnect.Securities.Option.Option.ContractMultiplier
getset

The contract multiplier for the option security

Definition at line 268 of file Option.cs.

◆ ExerciseSettlement

SettlementType QuantConnect.Securities.Option.Option.ExerciseSettlement
getset

Specifies if option contract has physical or cash settlement on exercise

Definition at line 370 of file Option.cs.

◆ Underlying

Security QuantConnect.Securities.Option.Option.Underlying
getset

Gets or sets the underlying security object.

Definition at line 378 of file Option.cs.

◆ PriceModel

IOptionPriceModel QuantConnect.Securities.Option.Option.PriceModel
getset

Gets or sets the price model for this option security

Definition at line 405 of file Option.cs.

◆ OptionExerciseModel

IOptionExerciseModel QuantConnect.Securities.Option.Option.OptionExerciseModel
getset

Fill model used to produce fill events for this security

Definition at line 413 of file Option.cs.

◆ OptionAssignmentModel

IOptionAssignmentModel QuantConnect.Securities.Option.Option.OptionAssignmentModel
getset

The automatic option assignment model

Definition at line 421 of file Option.cs.

◆ EnableGreekApproximation

bool QuantConnect.Securities.Option.Option.EnableGreekApproximation
getset

When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers

Definition at line 430 of file Option.cs.

◆ ContractFilter

IDerivativeSecurityFilter<OptionUniverse> QuantConnect.Securities.Option.Option.ContractFilter
getset

Gets or sets the contract filter

Definition at line 455 of file Option.cs.


The documentation for this class was generated from the following file: