Skip to content

Commit

Permalink
BUG: Changed benchmark returns to only contain market minutes.
Browse files Browse the repository at this point in the history
The series was being generated as all minutes between two times.
It should be only the trading minutes.
  • Loading branch information
CaptainKanuk committed Feb 17, 2015
1 parent 760bbce commit fd618c6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions zipline/finance/performance/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
from zipline.finance import trading
from . period import PerformancePeriod

trd_env = trading.TradingEnvironment()

log = logbook.Logger('Performance')


Expand Down Expand Up @@ -110,9 +112,12 @@ def __init__(self, sim_params):
risk.RiskMetricsCumulative(self.sim_params)

elif self.emission_rate == 'minute':
self.all_benchmark_returns = pd.Series(index=pd.date_range(
self.sim_params.first_open, self.sim_params.last_close,
freq='Min'))
self.all_benchmark_returns = pd.Series(
index=trd_env.minutes_for_days_in_range(
self.sim_params.first_open,
self.sim_params.last_close
)
)
self.intraday_risk_metrics = \
risk.RiskMetricsCumulative(self.sim_params)

Expand Down

0 comments on commit fd618c6

Please sign in to comment.