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

ClockMomentHandler 创建时设置next_time的问题 #69

Open
liningbo opened this issue Apr 15, 2024 · 0 comments
Open

ClockMomentHandler 创建时设置next_time的问题 #69

liningbo opened this issue Apr 15, 2024 · 0 comments

Comments

@liningbo
Copy link

liningbo commented Apr 15, 2024

easyquant的engine在非交易日关闭后重新启动时,会出现ClockMomentHandler在下一个交易日的00:00:00执行买卖的问题。
是因为ClockMomentHandler的init函数在第一次设置下次运行时间next_time的时候,对于is_trading_date为True和False都用当天的日期来设置next_time,但是对于is_trading_date为True,是需要交易日才执行定时任务。
修改方式:在创建ClockMomentHandler时,在init函数中设置next_time的时候,如果engine重启当天是非交易日,取下一交易日的日期来设置next_time。
#70

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

1 participant