diff --git a/sysquant/estimators/vol.py b/sysquant/estimators/vol.py index dcad21ef31..7ff5a06031 100644 --- a/sysquant/estimators/vol.py +++ b/sysquant/estimators/vol.py @@ -94,8 +94,8 @@ def apply_vol_floor( floor_days: int = 500, ) -> pd.Series: # Find the rolling 5% quantile point to set as a minimum - vol_min = vol.rolling(min_periods=floor_min_periods, window=floor_days).q( - quantile=floor_min_quant + vol_min = vol.rolling(min_periods=floor_min_periods, window=floor_days).quantile( + q=floor_min_quant ) # set this to zero for the first value then propagate forward, ensures diff --git a/systems/accounts/pandl_calculators/pandl_calculation.py b/systems/accounts/pandl_calculators/pandl_calculation.py index c21099b0ea..ebf1ced812 100644 --- a/systems/accounts/pandl_calculators/pandl_calculation.py +++ b/systems/accounts/pandl_calculators/pandl_calculation.py @@ -90,7 +90,10 @@ def percentage_pandl(self) -> pd.Series: def _percentage_pandl_given_pandl(self, pandl_in_base: pd.Series): capital = self.capital - capital_aligned = capital.reindex(pandl_in_base.index, method="ffill") + if type(capital) is pd.Series: + capital_aligned = capital.reindex(pandl_in_base.index, method="ffill") + elif type(capital) is float or type(capital) is int: + capital_aligned = capital return 100.0 * pandl_in_base / capital_aligned