From 40dcdedc50e3c4e0e4f48e8b352bacb793bb736b Mon Sep 17 00:00:00 2001 From: Rob Carver Date: Wed, 10 Jan 2024 13:02:02 +0000 Subject: [PATCH] repointing data refs to rawdata refs to make it easier to override --- systems/positionsizing.py | 4 ++-- systems/rawdata.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/systems/positionsizing.py b/systems/positionsizing.py index b7f45548f5..c4e1509738 100644 --- a/systems/positionsizing.py +++ b/systems/positionsizing.py @@ -318,7 +318,7 @@ def get_block_value(self, instrument_code: str) -> pd.Series: """ underlying_price = self.get_underlying_price(instrument_code) - value_of_price_move = self.parent.data.get_value_of_block_price_move( + value_of_price_move = self.rawdata_stage.get_value_of_block_price_move( instrument_code ) @@ -535,7 +535,7 @@ def get_fx_rate(self, instrument_code: str) -> pd.Series: """ base_currency = self.get_base_currency() - fx_rate = self.data.get_fx_for_instrument(instrument_code, base_currency) + fx_rate = self.rawdata_stage.get_fx_for_instrument(instrument_code, base_currency) return fx_rate diff --git a/systems/rawdata.py b/systems/rawdata.py index 5970ca6d62..1a5f2ea89b 100644 --- a/systems/rawdata.py +++ b/systems/rawdata.py @@ -48,6 +48,10 @@ def get_raw_cost_data(self, instrument_code: str): def get_value_of_block_price_move(self, instrument_code: str) -> float: return self.data_stage.get_value_of_block_price_move(instrument_code) + def get_fx_for_instrument( + self, instrument_code: str, base_currency: str + ): + return self.data_stage.get_fx_for_instrument(instrument_code=instrument_code, base_currency=base_currency) @input def get_daily_prices(self, instrument_code) -> pd.Series: