mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 21:45:09 +08:00
MAINT: Remove dependence on intraday risk for benchmark returns.
The intraday_risk_metrics is being removed since the values are not used; cumulative risk metrics with the last value updated to the latest close has been used for some time. Before the removal of intraday_risk_metrics, the position trackers passing of benchmark returns to the cumulative risk metrics needs to no longer depend on the calculations done by the intraday stats. So instead use the all_benchmark_returns stored in the tracker directly.
This commit is contained in:
@@ -410,8 +410,14 @@ class PerformanceTracker(object):
|
||||
self.all_benchmark_returns[dt],
|
||||
account)
|
||||
|
||||
bench_since_open = \
|
||||
self.intraday_risk_metrics.benchmark_cumulative_returns[dt]
|
||||
# Duplicate intraday_risk_metrics work of calculating the benchmark
|
||||
# returns since open.
|
||||
# intraday_risk_metrics is marked for removal.
|
||||
#
|
||||
# This redundant work is in anticipation of no longer being able to
|
||||
# depend on the 'since open' calculations in intraday_risk_metrics.
|
||||
bench_returns = self.all_benchmark_returns.loc[todays_date:dt]
|
||||
bench_since_open = (1. + bench_returns).prod() - 1
|
||||
|
||||
self.cumulative_risk_metrics.update(todays_date,
|
||||
self.todays_performance.returns,
|
||||
|
||||
Reference in New Issue
Block a user