Parent: Object
OptionChain organizes the option expirations and strikes available for a single underlying symbol. Each expiration is represented by an OptionSymExp instance, which contains the option symbol root and available strikes for that expiration.
Creates a new OptionChain for the underlying symbol specified in underlier. Set isIndex to true for index options. This information can be used when generating historical expiration dates for expired contracts.
Adds the OptionSymExp specified in optionSymExp to the chain. The item is added only if the chain does not already contain an OptionSymExp with the same option symbol root and expiration.
Returns the available strike closest to price for the specified expiration. Set useWeekly to false to search regular expirations or true to search weekly/non-regular expirations. If no matching OptionSymExp is available, WL9 generates a fictitious strike based on the supplied price. For generated historical strikes, WL9 uses progressively larger strike intervals as the underlying price increases.
Returns true if the chain contains an OptionSymExp whose option symbol root matches optionSymbolRoot, otherwise returns false.
Returns a sorted List of unique expiration dates contained in the option chain. If weeklies is false, regular expirations are returned. If true, weekly or other non-regular expirations are returned. Returns null if an error occurs while obtaining the expirations.
Returns the OptionSymExp instance for the specified expiration. Set useWeekly to false to search regular expirations or true to search weekly/non-regular expirations. Returns null if no matching OptionSymExp exists.
Indicates whether this OptionChain represents index options.
Returns a string key that uniquely identifies an OptionSymExp using the specified optionSymbolRoot and expiration.
The key is formatted as the option symbol root followed by @ and the expiration date in yyMMdd format.
Returns the next option expiration on or after dte, advanced by the number of calendar days specified in calendarDaysAhead. Set weeklies to false to use regular expirations, or true to use weekly/non-regular expirations. Set allowExpired to true when working with historical options during a backtest. If expired contracts are not present in the option chain, WL9 generates an appropriate historical expiration date. For regular historical expirations, WL9 accounts for US stock market holidays. If RegularExpirationOnThursday is true, the generated regular expiration is moved from Friday to Thursday.
Returns the next available strike greater than price for the specified expiration. Set useWeekly to false to search regular expirations or true to search weekly/non-regular expirations. If price is higher than every available strike, the highest strike in the chain is returned. If no matching OptionSymExp is available, such as when backtesting historical options without a historical option chain, WL9 generates a fictitious strike based on the supplied price.
Returns the List of OptionSymExp instances contained in the chain. Each OptionSymExp represents an option symbol root and expiration, along with the strikes available for that expiration.
Returns the next available strike below price for the specified expiration. Set useWeekly to false to search regular expirations or true to search weekly/non-regular expirations. If no lower strike is available, the lowest strike in the chain is returned. If no matching OptionSymExp is available, WL9 generates a fictitious strike based on the supplied price.
Indicates that regular expirations should occur on Thursday rather than Friday when WL9 generates historical expiration dates for expired contracts.
Returns the underlying symbol associated with the option chain, such as AAPL, IBM, or SPX.