ema
Calculate the Exponential Moving Average (EMA).
EMA is a cumulative calculation, including all data. Past values have a diminishing contribution to the average, while more recent values have a greater contribution. This method allows the moving average to be more responsive to changes in the data.
Example
from openbb import obb
stock_data = obb.equity.price.historical(symbol='TSLA', start_date='2023-01-01', provider='fmp')
ema_data = obb.technical.ema(data=stock_data.results, target='close', length=50, offset=0)
Parameters
- standard
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| data | List[Data] | The data to use for the calculation. | False | |
| target | str | Target column name. | close | False |
| index | str | Index column name to use with data, by default "date" | date | False |
| length | int | The length of the calculation, by default 50. | 50 | False |
| offset | int | The offset of the calculation, by default 0. | 0 | False |
Returns
OBBject
results : List[Data]
The calculated data.