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

期货日线回测,open_auction中下单,开盘时间不一致问题如何处理? #759

Open
quant2008 opened this issue Jan 16, 2023 · 2 comments

Comments

@quant2008
Copy link

期货有的有夜盘,则开盘时间是昨晚21点;有的没有夜盘,则开盘时间为今日早上9点。
那么一个多品种的日线策略,在open_auction中下单,就面临一个问题:这个open_auction是在昨晚21点触发,还是在今天9点触发?

如果是在昨晚21点触发,那就现实中无法拿到无夜盘的合约开盘价,也无法下单立即成交。
如果是今早9点触发,那就无法处理昨晚开盘的合约。
米筐是如何处理上述问题的呢?

我的想法是:提供一个api,例如get_open_time(symbol,date),来获得合约在指定日期的开盘时间,这样用户能够自己做些处理来缓解以上问题。
另一方面,是不是允许昨晚和今早各触发一次open_auction?

@Cuizi7
Copy link
Contributor

Cuizi7 commented Feb 12, 2023

该问题确实存在,未来或考虑优化,当前对于此中场景可使用分钟回测。关于开盘时间可以查看 instrument 对象中的 trading_hours 属性。

@LawrentChen
Copy link

现在的期货 open_auction 应该是有夜盘的就按 21 点价格,没夜盘的就按 9 点价格撮合的。我觉得倒也挺合理...?
实盘期货有夜盘的品种的第 T 个交易日也是从 T-1 交易日的夜晚开始的,历史行情开盘价就是 21 点价格。实盘的时候分开两批做,也更好地贴近前收盘吧?

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

No branches or pull requests

3 participants