ENH: Improve TradingAlgorithm.run daily or minute data freq assumption

Changing TradingAlgorithm.run not to assume minute data if data freq is
specified as daily and sim params aren't allowed to be overwritten.
This commit is contained in:
Nathan Wolfe
2016-07-29 17:11:51 -04:00
parent 96dc1c3721
commit 19d493707f
+3 -1
View File
@@ -639,7 +639,9 @@ class TradingAlgorithm(object):
# Assume data is daily if timestamp times are
# standardized, otherwise assume minute bars.
times = copy_panel.major_axis.time
if np.all(times == times[0]):
if (np.all(times == times[0]) or
(self.sim_params.data_frequency == 'daily'
and not overwrite_sim_params)):
equity_daily_reader = PanelDailyBarReader(
self.trading_calendar.all_sessions,
copy_panel,