ema
Exponential Moving Average.
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. | None | False |
| target | str | Target column name. | close | True |
| index | str | Index column name to use with data, by default "date" | date | True |
| length | int | The length of the calculation, by default 50. | 50 | True |
| offset | int | The offset of the calculation, by default 0. | 0 | True |
Returns
The calculated data.