Skip to content

Commit 89566a9

Browse files
committed
Add type hints
1 parent dfb3aa2 commit 89566a9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Indicators that help to determine the direction of the market (uptrend, downtren
4545

4646
#### Weighted Moving Average (WMA)
4747

48+
```python
49+
def wma(data: Union[PdDataFrame, PlDataFrame], source_column: str, period: int, result_column: Optional[str] = None) -> Union[PdDataFrame, PlDataFrame]
50+
4851
```python
4952
from investing_algorithm_framework import CSVOHLCVMarketDataSource
5053

pyindicators/indicators/weighted_moving_average.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Union
1+
from typing import Union, Optional
22

33
import numpy as np
44
from pandas import DataFrame as PdDataFrame
@@ -13,7 +13,7 @@ def wma(
1313
data: Union[PdDataFrame, PlDataFrame],
1414
source_column: str,
1515
period: int,
16-
result_column: str = None,
16+
result_column: Optional[str] = None,
1717
) -> Union[PdDataFrame, PlDataFrame]:
1818
"""
1919
Function to calculate the weighted moving average of a series.

0 commit comments

Comments
 (0)