-
Notifications
You must be signed in to change notification settings - Fork 177
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
before_market_closes not normally called in backtest #573
Comments
I think I found the bug but I don't know how to fix it. In strategy_executor.py, in the backtesting block, we don't call before_market_close or after_market_close. Im not sure if we need to put the calls in this block after on_trading_iteration. There's another option... There is some code in _strategy_sleep that processes expired options. That's another reasonable approach, although its not guranteed to run only for backtesting. I did try moving the code up, and it kinda worked? Im not sure why but its calling things twice:
@grzesir Do you have any thoughts? I could try it out and let you know how it works. |
When using lumibot 3.7.8 and python 3.11
before_market_closes
is not normally called during a backtest:Code:
The text was updated successfully, but these errors were encountered: