Skip to main content

standard_deviation

Standard deviation measures how widely returns are dispersed from the average return.

Source Code: [link]

openbb.ta.standard_deviation(data: pd.DataFrame, window: int = 30, trading_periods: Optional[int] = None, is_crypto: bool = False, clean: bool = True)

Parameters

NameTypeDescriptionDefaultOptional
datapd.DataFrameDataframe of OHLC prices.NoneFalse
windowint [default: 30]Length of window to calculate over.30True
trading_periodsOptional[int][default: 252]Number of trading periods in a year.NoneTrue
is_cryptobool [default: False]If true, trading_periods is defined as 365.FalseTrue
cleanbool [default: True]Whether to clean the data or not by dropping NaN values.TrueTrue

Returns

TypeDescription
resultsDataframe with results.

Examples

data = openbb.stocks.load('SPY')
df = openbb.ta.standard_deviation(data)