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
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| data | pd.DataFrame | Dataframe of OHLC prices. | None | False |
| window | int [default: 30] | Length of window to calculate over. | 30 | True |
| trading_periods | Optional[int][default: 252] | Number of trading periods in a year. | None | True |
| is_crypto | bool [default: False] | If true, trading_periods is defined as 365. | False | True |
| clean | bool [default: True] | Whether to clean the data or not by dropping NaN values. | True | True |
Returns
| Type | Description |
|---|---|
| results | Dataframe with results. |
Examples
data = openbb.stocks.load('SPY')
df = openbb.ta.standard_deviation(data)