mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-25 13:10:33 +08:00
MAINT: Add data frequency to simulation parameters.
Working towards performance and risk logic being aware of data frequency, as different handling of order of events based on the data frequency is needed.
This commit is contained in:
@@ -240,8 +240,8 @@ Last successful date: %s" % self.last_trading_day)
|
||||
class SimulationParameters(object):
|
||||
def __init__(self, period_start, period_end,
|
||||
capital_base=10e3,
|
||||
emission_rate='daily'):
|
||||
|
||||
emission_rate='daily',
|
||||
data_frequency='daily'):
|
||||
global environment
|
||||
if not environment:
|
||||
# This is the global environment for trading simulation.
|
||||
@@ -252,6 +252,7 @@ class SimulationParameters(object):
|
||||
self.capital_base = capital_base
|
||||
|
||||
self.emission_rate = emission_rate
|
||||
self.data_frequency = data_frequency
|
||||
|
||||
assert self.period_start <= self.period_end, \
|
||||
"Period start falls after period end."
|
||||
|
||||
Reference in New Issue
Block a user