We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
order_target_portfolio能不能增加期货版? 另外,可以让它自动先卖后买吗(对股票)?
The text was updated successfully, but these errors were encountered:
先卖后买的问题我也碰到了(#659),但后来我发现实盘满仓周转的时候,如果没有专业交易软件支持,终究是要自己理顺清仓、减仓、加仓、建仓的顺序的。
我的大致思路是这样的,@quant2008 供参考: 用 dataclass 分别定义 position 和 positions 两个数据类(后者由前者组成),再来一个 order 类。用 __sub__ 方法定义仓位之间的减法:目标仓位 positions 减当前持仓 positions 得出按照清仓、减仓、加仓、建仓顺序排列的交易指令列表 List[order]。之后直接用减号 "-" 运算就行了。 有了交易指令列表之后可以直接用底层一些的 submit_order 发单,但要小心资金不足之类的情况还要再另行处理。
估计官方的解决方案会更优雅些,以后回头抄作业(奸笑)
Cheers🍺
Sorry, something went wrong.
真实交易,不敢恭维,仔细研究过这个框架的代码,在风控,订单结算等几个方面代码逻辑不是很清晰,前期的架构不错,后期换了几波人维护,应该是每个开发人员对业务理解不清晰,实盘没敢用,自己从新写了
No branches or pull requests
order_target_portfolio能不能增加期货版?
另外,可以让它自动先卖后买吗(对股票)?
The text was updated successfully, but these errors were encountered: