Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
femtotrader committed Jul 8, 2024
1 parent d5a17fc commit c14dc14
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions talipp/indicators/WilderMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ def __init__(self, period: int,
self.initialize(input_values, input_indicator)

def _calculate_new_value(self) -> Any:
#if not has_valid_values(self.input_values, self.period):
if len(self.input_values) < self.period:
return None
elif has_valid_values(self.input_values, self.period, exact=True):
#elif len(self.input_values) == self.period:
return sum(self.input_values[-self.period:]) / self.period
else:
return float(self.k * self.input_values[-1] + (1.0 - self.k) * self.output_values[-1])

0 comments on commit c14dc14

Please sign in to comment.