options
Calculate option prices, Greeks and implied volatility, or pull live option chain metrics like put/call ratio, max pain and gamma exposure by selecting an indicator.
Instructions
Option pricing and Greeks (Black-Scholes model, binomial tree, delta, gamma, theta, vega, rho, implied volatility). Requires tickers='AAPL' — use comma-separated values for multiple tickers. get_stock_price_simulation returns the unique price levels per time step; pass show_unique_combinations=false for every simulated path. get_binomial_model covers the strikes within 5% of the price unless strike_price_range= asks for more; strike_price_range also narrows the Greeks and get_option_chains. get_option_chains shows the nearest expiry (its Expiration Date column says which); show_expiration_dates=true lists the expiries and expiration_date= picks one. get_strategy_payoff takes legs as a list of objects, e.g. [{'strike_price': 340, 'position': 'long'}, {'strike_price': 360, 'position': 'short'}]. Option market metrics from the live chains, per expiry (number_of_expirations= or expiration_dates=): get_put_call_ratio (volume and open interest), get_max_pain, get_implied_volatility_term_structure (at-the-money volatility), get_volatility_skew (25-delta risk reversal and butterfly) and get_implied_move (straddle-implied move and range; around_earnings=true uses the first expiry after the next earnings date). Per ticker: get_gamma_exposure (dealer GEX in dollars per 1% move and the gamma flip point; by_strike=true per strike), get_model_free_implied_volatility (the Cboe VIX method for any ticker, days=30; '^SPX' approximates the VIX) and get_volatility_risk_premium (implied minus realized volatility, and in variance units). The market metrics take the underlying price quoted with the live chain (else the last traded close) and the rates and realized volatility from the price history, so leave end_date at today; days= cannot exceed the longest listed expiry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of calendar days used in day-count-based calculations. | |
| legs | No | The strategy as a list of legs. An option leg: {'strike_price': 340, 'put_option': false, 'position': 'long' or 'short', 'premium': 4.2}; a stock leg: {'instrument': 'stock', 'position': 'long', 'premium': 336}. E.g. a bull call spread is a long call at a lower and a short call at a higher strike. Leave unset to use the default of the indicator you selected. Required by: get_strategy_payoff. | |
| seed | No | The seed used to initialize the random number generator, ensuring reproducible results. | |
| limit | No | The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. | |
| rebate | No | The fixed cash amount paid out if the option knocks out (or fails to knock in). | |
| tickers | No | Comma-separated ticker symbols, e.g. 'AAPL,MSFT,GOOGL'. | |
| end_date | No | End of the date range in YYYY-MM-DD format. | 2026-10-27 |
| by_strike | No | Whether to return the exposure per strike instead of the totals. | |
| indicator | Yes | Name of the specific metric to calculate, one of the listed values. Required — search_metrics finds the indicator (and its tool) for a metric by name. | |
| quarterly | No | Return quarterly data instead of annual when True. | |
| timesteps | No | The number of time steps to use for the binomial tree. This will be evenly distributed over the time to expiration. | |
| knock_type | No | Either "in" or "out". | out |
| put_option | No | Whether to calculate the put option rho. | |
| start_date | No | Start of the date range in YYYY-MM-DD format. | 2021-10-28 |
| time_steps | No | The number of time steps used to build each simulated path. | |
| cash_payout | No | The fixed cash amount paid out by a cash-or-nothing option when it expires in-the-money. Ignored for asset-or-nothing options. | |
| option_type | No | Either "cash-or-nothing" or "asset-or-nothing". | cash-or-nothing |
| simulations | No | The number of simulated stock price paths. | |
| standardize | No | Return the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values. | |
| show_columns | No | Comma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage. | |
| dividend_yield | No | For get_asian_option, get_barrier_option, get_binary_option, get_binomial_model, get_bjerksund_stensland, get_black_scholes_model, get_delta, get_dual_delta, get_epsilon, get_implied_volatility, get_lambda, get_monte_carlo_option_price, get_put_call_parity, get_rho, get_risk_neutral_density, get_theta, get_vega, get_volatility_surface: The dividend yield to use for the calculation. A given value is used as a continuous yield. For get_charm, get_color, get_dual_gamma, get_gamma, get_partial_derivative, get_speed, get_ultima, get_vanna, get_vera, get_veta, get_vomma, get_zomma: The dividend yield to use for the calculation. | |
| risk_free_rate | No | For get_asian_option, get_barrier_option, get_binary_option, get_binomial_model, get_bjerksund_stensland, get_black_scholes_model, get_charm, get_color, get_delta, get_dual_delta, get_dual_gamma, get_epsilon, get_gamma, get_implied_volatility, get_lambda, get_monte_carlo_option_price, get_partial_derivative, get_put_call_parity, get_rho, get_risk_neutral_density, get_speed, get_theta, get_ultima, get_vanna, get_vega, get_vera, get_veta, get_volatility_surface, get_vomma, get_zomma: The risk free rate to use for the calculation. A rate passed here is used as given, as a continuously compounded rate. For get_garman_kohlhagen: The domestic risk free rate to use for the calculation. A rate passed here is used as given, as a continuously compounded rate. For get_stock_price_simulation: The risk free rate shown with show_input_info; it does not affect the simulated prices. A rate passed here is used as given, as a continuously compounded rate. | |
| american_option | No | Whether to value an American option, which can be exercised at every node, instead of a European option. | |
| around_earnings | No | Whether to use the first expiry after the next earnings date instead. | |
| expiration_date | No | For get_implied_volatility: The expiration date to use for the calculation. For get_option_chains, get_risk_neutral_density: The expiration date to use. | |
| show_input_info | No | Whether to show the input information. | |
| benchmark_ticker | No | Ticker used as the market benchmark, e.g. 'SPY' or '^GSPC'. | SPY |
| expiration_dates | No | For get_gamma_exposure: The expiries to include. For get_implied_move, get_implied_volatility_term_structure, get_max_pain, get_put_call_ratio, get_volatility_skew: The expiries to use. For get_volatility_surface: The expiration dates to fit the surface over. | |
| strike_step_size | No | The step size to use for the strike prices. | |
| barrier_direction | No | Either "down" or "up". | down |
| number_of_strikes | No | The number of strikes in the evaluation grid. | |
| outlier_threshold | No | The number of median absolute deviations from the median implied volatility beyond which a quote is treated as an outlier and dropped before fitting. | |
| stock_price_range | No | The percentage range to use for the stock prices at expiration. | |
| barrier_percentage | No | The barrier level as a percentage of the current stock price. A down barrier needs a value below 1 and an up barrier a value above 1; otherwise the barrier is already breached. | |
| strike_price_range | No | Only strikes within this fraction of the current stock price, e.g. 0.05 for the strikes within 5% of it. Leave unset to use the default of the indicator you selected. Defaults differ between indicators. | |
| time_to_expiration | No | The number of years to use for the time to expiration. | |
| show_standard_error | No | Whether to also return the standard error of each Monte Carlo estimate as a second DataFrame. | |
| expiration_time_range | No | The number of days to use for the time to expiration: the columns are the expirations 1 up to expiration_time_range - 1 days after the start date. | |
| number_of_expirations | No | For get_gamma_exposure: The number of nearest expiries to include when no dates are given. For get_implied_move, get_implied_volatility_term_structure, get_max_pain, get_put_call_ratio, get_volatility_skew: The number of nearest expiries to use when no dates are given. For get_volatility_surface: The number of near-term expiration dates to fit when `expiration_dates` is not given. Leave unset to use the default of the indicator you selected. Defaults are 6 for get_gamma_exposure, get_max_pain, get_put_call_ratio, get_volatility_skew, get_volatility_surface; 10 for get_implied_volatility_term_structure; 4 for get_implied_move. | |
| show_expiration_dates | No | For get_implied_volatility: Whether to show the expiration dates. For get_option_chains: Whether to return the available expiration dates instead of the option chains. | |
| stock_price_step_size | No | The step size to use for the stock prices at expiration. | |
| foreign_risk_free_rate | No | The foreign risk free rate to use for the calculation, which plays the role of the dividend yield in the standard Black-Scholes model. | |
| show_unique_combinations | No | Whether to show the unique combinations of the stock prices. Leave unset to use the default of the indicator you selected. Defaults are True for get_stock_price_simulation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |