Skip to main content

greeks

Gets the greeks for a given option

Source Code: [link]

openbb.stocks.options.greeks(current_price: float, chain: pd.DataFrame, expire: str, div_cont: float = 0, rf: Optional[float] = None)

Parameters

NameTypeDescriptionDefaultOptional
current_pricefloatThe current price of the underlyingNoneFalse
chainpd.DataFrameThe dataframe with option chainsNoneFalse
div_contfloatThe dividend continuous rate0True
expirestrThe date of expirationNoneFalse
rffloatThe risk-free rateNoneTrue

Returns

TypeDescription
pd.DataFrameDataframe with calculated option greeks

Examples

from openbb_terminal.sdk import openbb
aapl_chain = openbb.stocks.options.chains("AAPL", source="Tradier")
aapl_last_price = openbb.stocks.options.last_price("AAPL")
greeks = openbb.stocks.options.greeks(aapl_last_price, aapl_chain, aapl_chain.iloc[0, 2])