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:
Eddie Hebert
2015-04-27 14:47:27 -04:00
parent 4908d5577e
commit da0a5bbc3f
+8 -2
View File
@@ -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,