Skip to content

Commit

Permalink
remove future warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Carver committed Dec 6, 2023
1 parent 75575e7 commit 30eab73
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sysquant/estimators/vol.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ 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).quantile(
vol_min = vol.rolling(min_periods=floor_min_periods, window=floor_days).q(
quantile=floor_min_quant
)

Expand Down
33 changes: 32 additions & 1 deletion systems/rawdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ def _aggregate_daily_vol_normalised_returns_for_list_of_instruments(
def _daily_vol_normalised_price_for_list_of_instruments(
self, list_of_instruments: list
) -> pd.Series:

norm_returns = (
self._aggregate_daily_vol_normalised_returns_for_list_of_instruments(
list_of_instruments
Expand Down Expand Up @@ -373,6 +374,36 @@ def _by_asset_class_daily_vol_normalised_price_for_asset_class(

return norm_price

@diagnostic()
def daily_vol_normalised_price_for_asset_class_with_redundant_instrument_code(
self, instrument_code: str, asset_class: str
) -> pd.Series:
"""
Price for an asset class, built up from cumulative returns
:param asset_class: str
:return: pd.Series
"""

return self._by_asset_class_daily_vol_normalised_price_for_asset_class(asset_class)

@diagnostic()
def system_with_redundant_instrument_code_passed(
self,instrument_code: str, asset_class: str
):
## allows ultimate flexibility when creating trading rules but be careful!

return self.parent

@diagnostic()
def instrument_code(
self,instrument_code: str
) -> pd.Series:
## allows ultimate flexibility when creating trading rules

return instrument_code


@output()
def normalised_price_for_asset_class(self, instrument_code: str) -> pd.Series:
"""
Expand Down Expand Up @@ -702,4 +733,4 @@ def instrument_list(self) -> list:
if __name__ == "__main__":
import doctest

doctest.testmod()
doctest.testmod()

0 comments on commit 30eab73

Please sign in to comment.