option_snapshot_binomial_greeks_second_order() ​
- Retrieve a real-time last second order binomial greeks calculation for all option contracts that lie on a provided expiration.
- Greeks are calculated with a Leisen-Reimer binomial tree. European-style index options (such as SPX, SPXW, XSP, NDX, RUT and VIX) are priced as European and every other root as American, which allows early exercise at every node; set
exercise_styleto override. See here for more detail. - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output.
- Make
expiration* if you want to get the snapshot for every expiration chain for the underlying.
Returns the latest message for each contract from the past 7 days (for example, on a Friday back to the previous Friday). Outside market hours it returns values from the most recent trading session. Contracts with no messages in the past 7 calendar days are not returned. Contracts are removed after their expiration date's trading session. Use
current_day_only=trueto return only today's data.
Parameters
The stock or index symbol, or underlying symbol for options.
The expiration of the contract in YYYY-MM-DD or YYYYMMDD format, or * for all expirations.
The strike price of the contract in dollars (ie 100.00 for $100.00), or * for all strikes.
The right (call or put) of the contract.
The annualized continuous dividend yield used in Greeks calculations, as a decimal (e.g. 0.0042 for a 0.42% yield). To pass a dollar amount instead, use annual_dividend_amount. Must be non-negative.
The interest rate type to be used in a Greeks calculation.
The interest rate, as a percent, to be used in a Greeks calculation.
The underlying stock price to be used in the Greeks calculation.
The number of steps used to build the binomial tree for binomial Greeks calculations. Higher values are more accurate but slower to compute; the cost of a request grows with the square of this value. An even value is rounded up to the next odd one, which the Leisen-Reimer tree requires so that the strike lands on the centre of the final step. Requests for every expiration (expiration=*) are capped at 101 steps.
Used to adjust Greeks calculation methodology. "1" uses a fixed .15 DTE for 0DTE; "latest" uses real TTE (down to a minimum of 1 hour)
If specified, only contracts with a full calendar day 'Days to Expiration' (DTE) less than or equal to this number will be returned.
Limits the number of contracts returned relative to the underlying's spot price. For a specified value 'n', this returns 'n' strikes above and 'n' strikes below the spot price, plus one at-the-money (ATM) strike (where spot price = strike price), if available. This results in a maximum of 2n + 1 strikes.
Filters snapshots to include only data with a timestamp greater or equal to the specified value (HH:mm:ss.SSS format).
Use the market value bid, ask, and price
Only return snapshot data from the current trading day (New York date). Applied before min_time.
The annual dividend per share in dollars used in Greeks calculations (e.g. 0.96 for $0.96 per year). It is converted to a yield for each tick by dividing by the underlying price used for that tick. Must be non-negative, and cannot be combined with a non-zero annual_dividend.
The exercise style used to price the option on the binomial tree. american allows early exercise at every node; european allows exercise only at expiration. When omitted, European-style index options (such as SPX, SPXW, XSP, NDX, RUT and VIX) are priced as European and every other root as American. See here for the list of European roots.
Where each contract's implied volatility comes from. own_quote (default) uses the contract's own midpoint. out_of_the_money uses the out-of-the-money option at the same strike, which smooths deep in-the-money Greeks; it requires strike=*, right=both, and an interval on history requests. See here for details.
Sample Code ​
Response ​
Returns second order binomial greeks for an option contract