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

使用simple_macd测试出现现金为负异常 #9

Closed
gucasbrg opened this issue Aug 14, 2016 · 1 comment
Closed

使用simple_macd测试出现现金为负异常 #9

gucasbrg opened this issue Aug 14, 2016 · 1 comment
Labels

Comments

@gucasbrg
Copy link

gucasbrg commented Aug 14, 2016

1、用examples/simple_macd.py 进行测试,
时间周期:2014-01-04\2015-01-04
资金默认:100000
回测周期:每日
从代码与复制到ricequant,出现现金为负情况:
image
看算多少股时,context.portfolio.cash/bar_dict[context.s1].close类似此,买多少股的时候没有把交易费用加进去?

@cedricporter
Copy link
Member

这个ricequant的首席技术官Kangol做出过回答:

买入前的简易风控检查不计算slippage和transaction cost,matcher那边成交后可能会超出一点,属于正常
券商也会碰到这个问题
市场单丢出去滑点后超出了现金量,券商就直接算你欠他一点钱,反正你有股票在他手里,欠一点也无所谓
这个我问过富途的人,官方回答

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

No branches or pull requests

2 participants