mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-29 20:33:46 +08:00
WIP: Changed Batch event window to inheritance for now. Added example covariance.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from zipline.gens.transform import EventWindowBatch
|
||||
|
||||
class CovEventWindow(EventWindowBatch):
|
||||
def get_value(self, prices, volumes):
|
||||
return prices.cov()
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user