wma
Weighted Moving Average.
A Weighted Moving Average puts more weight on recent data and less on past data. This is done by multiplying each bar's price by a weighting factor. Because of its unique calculation, WMA will follow prices more closely than a corresponding Simple Moving Average.
Example:
from openbb import obb
stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
wma_data = obb.technical.wma(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 WMA, by default 50. | 50 | True |
| offset | int | The offset of the WMA, by default 0. | 0 | True |
Returns
The WMA data.