Skip to main content

vol

Plot volume

Source Code: [link]

openbb.stocks.options.vol(chain: pd.DataFrame, current_price: float, symbol: str, expiry: str, min_sp: float = -1, max_sp: float = -1, calls_only: bool = False, puts_only: bool = False, raw: bool = False, export: str = "", sheet_name: Optional[str] = None, external_axes: bool = False)

Parameters

NameTypeDescriptionDefaultOptional
chainpd.DataframeDataframe with options chainNoneFalse
current_pricefloatCurrent price of selected symbolNoneFalse
symbolstrTicker symbolNoneFalse
expirystrexpiration date for optionsNoneFalse
min_spfloatMin strike to consider-1True
max_spfloatMax strike to consider-1True
calls_onlyboolShow calls onlyFalseTrue
puts_onlyboolShow puts onlyFalseTrue
exportstrFormat to export fileTrue
sheet_namestrOptionally specify the name of the sheet to export toNoneTrue
external_axesboolWhether to return the figure object or not, by default FalseFalseTrue

Returns

This function does not return anything


Examples

from openbb_terminal.sdk import openbb
aapl_chain_data = openbb.stocks.options.chains("AAPL", expiration="2023-07-21", source="Nasdaq")
aapl_price = openbb.stocks.options.price("AAPL", source="Nasdaq")
openbb.stocks.options.vol(
chain=aapl_chain_data,
symbol="AAPL",
current_price=aapl_price,
expiry="2023-07-21",
)