mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-30 13:10:53 +08:00
Added passing of arguments to algorithm initialize and batch transform.
This commit is contained in:
1 parent
52e6a69492
commit
188a9502b0
5 files changed
+59
-27
No files matched your search
@@ -24,7 +24,7 @@ class TradingAlgorithm(object):
|
||||
```
|
||||
To then to run this algorithm:
|
||||
|
||||
>>> my_algo = MyAlgo(100, sids=[0])
|
||||
>>> my_algo = MyAlgo([0], 100) # first argument has to be list of sids
|
||||
>>> stats = my_algo.run(data)
|
||||
|
||||
"""
|
||||
@@ -32,7 +32,7 @@ class TradingAlgorithm(object):
|
||||
"""
|
||||
Initialize sids and other state variables.
|
||||
|
||||
Calls user-defined initialize and forwarding *args and **kwargs.
|
||||
Calls user-defined initialize() forwarding *args and **kwargs.
|
||||
"""
|
||||
self.sids = sids
|
||||
self.done = False
|
||||
@@ -45,6 +45,8 @@ class TradingAlgorithm(object):
|
||||
# call to user-defined initialize method
|
||||
self.initialize(*args, **kwargs)
|
||||
|
||||
self.initialized = True
|
||||
|
||||
def _create_simulator(self, start, end):
|
||||
"""
|
||||
Create trading environment, transforms and SimulatedTrading object.
|
||||
|
||||
Reference in new issue
Block a user