mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-06 13:00:45 +08:00
MAINT: Use more exact boolean checks for pandas structures.
To prepare for being compatible with pandas==0.13.0, which is stricter on boolean checks.
This commit is contained in:
@@ -53,11 +53,11 @@ class DualEMATaLib(TradingAlgorithm):
|
||||
self.buy = False
|
||||
self.sell = False
|
||||
|
||||
if self.short_ema > self.long_ema and not self.invested:
|
||||
if (self.short_ema > self.long_ema).all() and not self.invested:
|
||||
self.order('AAPL', 100)
|
||||
self.invested = True
|
||||
self.buy = True
|
||||
elif self.short_ema < self.long_ema and self.invested:
|
||||
elif (self.short_ema < self.long_ema).all() and self.invested:
|
||||
self.order('AAPL', -100)
|
||||
self.invested = False
|
||||
self.sell = True
|
||||
|
||||
@@ -381,7 +381,7 @@ class BatchTransform(object):
|
||||
else:
|
||||
data = self.rolling_panel.get_current()
|
||||
|
||||
if self.supplemental_data:
|
||||
if self.supplemental_data is not None:
|
||||
for item in data.items:
|
||||
if item not in self.supplemental_data.items:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user