WIP: Changed Batch event window to inheritance for now. Added example covariance.

This commit is contained in:
Thomas Wiecki
2012-09-12 22:06:19 -04:00
parent b74721421e
commit 784fc72569
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
from zipline.gens.transform import EventWindowBatch
class CovEventWindow(EventWindowBatch):
def get_value(self, prices, volumes):
return prices.cov()
+1 -1
View File
@@ -339,6 +339,6 @@ class BatchWindow(EventWindow):
def __call__(self, *args, **kwargs):
if self.updated:
self.cached = self.func(self.prices, self.volumes, *args, **kwargs)
self.cached = self.get_value(self.prices, self.volumes, *args, **kwargs)
return self.cached