Added passing of arguments to algorithm initialize and batch transform.

This commit is contained in:
Thomas Wiecki
2012-09-25 11:48:37 -04:00
parent 52e6a69492
commit 188a9502b0
5 changed files with 59 additions and 27 deletions
+4 -2
View File
@@ -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.