Skip to content

Commit

Permalink
Merge remote-tracking branch 'robcarver17/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tgibson11 committed Feb 14, 2025
2 parents 6477b7b + c79bb41 commit cfb234c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sysproduction/reporting/data/pandl.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def get_period_perc_pandl_for_sector_in_date_range(self, asset_class: str):
def get_period_perc_pandl_for_instrument_all_strategies_in_date_range(
self, instrument_code: str
) -> float:
print("Getting p&l for %s" % instrument_code)
self.data.log.info("Getting p&l for %s" % instrument_code)

try:
pandl_across_contracts = self.pandl_for_instrument_across_contracts(
Expand Down Expand Up @@ -223,7 +223,7 @@ def _get_pandl_for_instrument_across_contracts(
return pandl_df

def get_period_perc_pandl_for_strategy_in_date_range(self, strategy_name: str):
print("Getting p&l for %s" % strategy_name)
self.data.log.info("Getting p&l for %s" % strategy_name)
try:
pandl_df = self.get_df_of_perc_pandl_series_for_strategy_all_instruments(
strategy_name
Expand Down Expand Up @@ -388,7 +388,7 @@ def get_perc_pandl_series_for_contract(data, instrument_code, contract_id):
def get_perc_pandl_series_for_strategy_instrument_vs_total_capital(
data, instrument_strategy: instrumentStrategy
):
print("Data for %s" % (instrument_strategy))
data.log.info("Data for %s" % instrument_strategy)
instrument_code = instrument_strategy.instrument_code
strategy_name = instrument_strategy.strategy_name

Expand Down
1 change: 1 addition & 0 deletions systems/accounts/pandl_calculators/pandl_using_fills.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def merge_fill_prices_with_prices(
[prices, unique_trades_as_pd_df.price], axis=1, join="outer"
)
prices_to_use.columns = ["price", "fill_price"]
prices_to_use.index = pd.to_datetime(prices_to_use.index)

# Where no fill price available, use price
prices_to_use = prices_to_use.ffill(axis=1)
Expand Down

0 comments on commit cfb234c

Please sign in to comment.