mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-29 12:05:54 +08:00
MAINT: Allow sim_params to provide data frequency for the algorithm.
In the case that data_frequency of the algorithm is None, allow the sim_params to provide the data_frequency. For less redundancy when setting up an algorithm.
This commit is contained in:
@@ -142,7 +142,11 @@ class TradingAlgorithm(object):
|
||||
|
||||
self.sim_params = kwargs.pop('sim_params', None)
|
||||
if self.sim_params:
|
||||
self.sim_params.data_frequency = self.data_frequency
|
||||
if self.data_frequency is None:
|
||||
self.data_frequency = self.sim_params.data_frequency
|
||||
elif self.sim_params.data_frequency is None:
|
||||
self.sim_params.data_frequency = self.data_frequency
|
||||
|
||||
self.perf_tracker = PerformanceTracker(self.sim_params)
|
||||
|
||||
self.blotter = kwargs.pop('blotter', None)
|
||||
|
||||
Reference in New Issue
Block a user