Parent: Object
An OptionChain organizes an option chain's strikes and expirations for a single underlier symbol and provides methods to find specific strikes and expirations.
public List
**OptionSymExpirations** returns a complete list of `OptionSymExp` objects, each of which stores the strikes for each expiration.
public double PreviousStrike(double price, DateTime expiration, bool useWeekly)
PreviousStrike
returns the next lower strike above the price for the expiration. Pass true for useWeekly for non-regular option expirations.
Remarks:
- For backtests on expired contracts option chains are not available. In this case,
PreviousStrike
returns "ficticious" strikes in $1 steps for prices below 20, and in $5 steps otherwise. public OptionSymExp GetOptionSymExp(DateTime expiration, bool useWeekly)
Returns the `OptionSymExp` object for the *expiration*. Pass *true* for *useWeekly* for non-regular option expirations.
Instantiante an OptionChain
with the underlying symbol. Because Index options typically expire on Thursday before the Friday option expiration, specify if the chain class is for Index options by passing true to isIndex. Complete an option chain by creating OptionSymExp
objects for each expiration and use the Add
method to add them to the chain.
Adds a unique OptionSymExp
(symbol/expiration with strikes) to the chain.
**Remarks:** - For backtests on expired contracts option chains are not available. In this case, `ClosestStrike` returns "ficticious" strikes in $1 steps for prices below 20, and in $5 steps otherwise. ### GetOptionSymExp
Returns a list of expirations for this OptionChain
and null if none. If weeklies is false, only regular expirations are returned. Otherwise this returns all non-regular expirations in the chain.
Identifies if the OptionChain
belongs to Index options.
Starting from dte, NextExpiry
returns the next expiration at least the number of calendarDaysAhead.
Since otion chains do not include expired contracts, set allowExpired true to return option historical dates in backtests.
**Remarks:** - For backtests on expired contracts option chains are not available. In this case, `NextStrike` returns "ficticious" strikes in $1 steps for prices below 20, and in $5 steps otherwise. ### PreviousStrike
Use to generate expired [index] option expiration dates (if required).
public string Underlier { get; }
The underlier symbol for the option chain. ### OptionSymExpirations