Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

雪球只能买不能卖 #80

Closed
firstsko opened this issue Jul 13, 2016 · 3 comments
Closed

雪球只能买不能卖 #80

firstsko opened this issue Jul 13, 2016 · 3 comments

Comments

@firstsko
Copy link

sell不起作用的

@shidenggui
Copy link
Owner

需要补充更多信息

@jinrongxiaoe
Copy link
Contributor

我也遇到这个问题。这个bug可以这么重现:
取一个组合,前一天等仓位加入5个股票,第二天在盘中执行下面代码:
import easytrader

et = easytrader.use('xq')
et.prepare('xq.json')

close all positions

for position in et.position:
et.sell(position['stock_code'], price=position['last_price'], amount=position['current_amount'])
print("Selling off %s" % position['stock_code'])

症状是第一个票会顺利清仓,但是后面的票会出现下面的错误:
2016-07-21 13:50:07.521130] DEBUG: xqtrader.py: weight:17.740000, cash:63.880000
[2016-07-21 13:50:07.750284] DEBUG: xqtrader.py: 调仓 sell双林股份: 400
[2016-07-21 13:50:07.750461] ERROR: xqtrader.py: 调仓错误: 组合仓位比例出错
Selling off SZ300100

@shidenggui
Copy link
Owner

@haogefeifei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants