mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-05 06:28:48 +08:00
BUG: Use normed last_close instead of period_end.
`period_end` can be outside the range of data for which we have dates. `last_close` properly gets pulled back to the last date for which we actually have data. We should consider whether or not we need to be storing period_end at all.
This commit is contained in:
@@ -1281,7 +1281,7 @@ class TradingAlgorithm(object):
|
||||
"""
|
||||
days = self.trading_environment.trading_days
|
||||
start_date_loc = days.get_loc(start_date)
|
||||
sim_end = self.sim_params.period_end
|
||||
sim_end = self.sim_params.last_close.normalize()
|
||||
end_loc = min(start_date_loc + 252, days.get_loc(sim_end))
|
||||
end_date = days[end_loc]
|
||||
return self.engine.factor_matrix(
|
||||
|
||||
Reference in New Issue
Block a user