Hi y'all am getting this bug when I try execute allocated trades using zipline. The code works fine in simulation. Is this a bug?
Traceback (most recent call last):
File "sym://qrocket_log_py", line 34, in wrapped
File "sym://qrocket_qrzipline_trade_trade_py", line 57, in mule_trade_algo
File "/opt/conda/lib/python3.8/site-packages/zipline/algorithm.py", line 652, in run
File "sym://qrocket_qrzipline_trade_trade_py", line 179, in trade_algo
File "/opt/conda/lib/python3.8/site-packages/zipline/gens/tradesimulation.py", line 182, in transform
for capital_change_packet in every_bar(dt):
for perf in self.get_generator():
File "/opt/conda/lib/python3.8/site-packages/zipline/gens/tradesimulation.py", line 117, in every_bar
handle_data(algo, current_data, dt_to_use)
File "/opt/conda/lib/python3.8/site-packages/zipline/utils/events.py", line 216, in handle_data
event.handle_data(
File "/opt/conda/lib/python3.8/site-packages/zipline/utils/events.py", line 238, in handle_data
self.callback(context, data)
File "trend_weekly", line 258, in select_stocks_and_set_weights
res = self.eval(expr, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3466, in query
File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3596, in eval
return _eval(expr, inplace=inplace, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/eval.py", line 342, in eval
parsed_expr = Expr(expr, engine=engine, parser=parser, env=env)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 798, in __init__
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 817, in parse
return self._visitor.visit(self.expr)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 401, in visit
return self.visit(expr, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 407, in visit_Module
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 401, in visit
return self.visit(node.value, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 410, in visit_Expr
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 401, in visit
return reduce(visitor, operands)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 737, in visit_BoolOp
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 731, in visitor
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 726, in _try_visit_binop
return self.visit(bop)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 401, in visit
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 737, in visit_BoolOp
self.terms = self.parse()
return visitor(node, **kwargs)
return visitor(node, **kwargs)
return visitor(node, **kwargs)
rhs = self._try_visit_binop(y)
return visitor(node, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 734, in visitor
return reduce(visitor, operands)
return self._maybe_evaluate_binop(op, node.op, lhs, rhs) e-packages/pandas/core/computation/expr.py", line 518, in _maybe_evaluate_binop
return self._maybe_eval(res, eval_in_python + maybe_eval_in_python)
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/expr.py", line 478, in _maybe_eval
return binop.evaluate(
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/ops.py", line 433, in evaluate
right = self.rhs.evaluate(
File "/opt/conda/lib/python3.8/site-packages/pandas/core/computation/ops.py", line 425, in evaluate
left = self.lhs.evaluate(
AttributeError: 'UnaryOp' object has no attribute 'evaluate'