From 308a4f1abb3e02bbb7853dbaada8eb8b4ac35687 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 24 Feb 2022 22:38:53 +0530 Subject: [PATCH] changed years to any period in return calc --- fincal/fincal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fincal/fincal.py b/fincal/fincal.py index b779d85..244536c 100644 --- a/fincal/fincal.py +++ b/fincal/fincal.py @@ -203,7 +203,8 @@ class TimeSeries(TimeSeriesCore): prior_match: str = "closest", closest: str = "previous", compounding: bool = True, - years: int = 1, + interval_type: Literal['years', 'months', 'days'] = 'years', + interval_value: int = 1, date_format: str = None ) -> List[tuple]: """Calculates the rolling return""" @@ -228,7 +229,8 @@ class TimeSeries(TimeSeriesCore): returns = self.calculate_returns( as_on=i, compounding=compounding, - years=years, + interval_type=interval_type, + interval_value=interval_value, as_on_match=as_on_match, prior_match=prior_match, closest=closest,