Zipline:无法理解空头头寸从何而来

问题描述

我在本地使用 quantopian zipline。

这个函数似乎可以正确卖出,但也会在投资组合中创建随机价值的空头头寸,我不明白为什么。有没有人经历过这种情况?

def sell_all(context,data):
    for stock,weight in context.portfolio.positions.items():
        if not get_open_orders(stock) and data.can_Trade(stock):
            order_target_percent(stock,0.0)

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)