策略报错:object has no attribute 'last_sale_date'
由pjackpcq创建,最终由pjackpcq 被浏览 35 用户
问题
策略报错:AttributeError: 'zipline.assets._assets.Equity' object has no attribute 'last_sale_date'
https://bigquant.com/experimentshare/c5bd05c402bf467b8f9ac0c43a9cf6a8
解答
把持仓定义的那个改成
equities = {e.symbol: p for e, p in context.portfolio.positions.items() if p.amount>0}