Skip to content

Disable wait on order processing when backtesting #785

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
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

majdzadeh
Copy link
Contributor

@majdzadeh majdzadeh commented Jun 4, 2025

Broker waits when processing orders only if it is not a backtesting broker.

Resolves #764

Description by Korbit AI

What change is being made?

Disable the wait for order registration and execution when running in a backtesting environment.

Why are these changes being made?

The waiting behavior is unnecessary and potentially disruptive during backtesting as it simulates synchronous order processing which doesn't apply in backtesting scenarios. Removing this wait improves the performance and accuracy of backtesting by aligning behavior with realistic, asynchronous order placement typically found in live environments.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Broker waits when processing orders only if it is not a backtesting
broker.

Resolves Lumiwealth#764
Copy link
Contributor

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
lumibot/brokers/broker.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

A single `StrEnum` class is defined and imported by `Order` and `Asset`
classes.

Resolves Lumiwealth#788
@majdzadeh
Copy link
Contributor Author

@grzesir
Kindly take a look whenever you're free. Thanks.

@majdzadeh
Copy link
Contributor Author

@grzesir
Could you please check the PR?

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

Successfully merging this pull request may close these issues.

Probably invalid methods in the context of BacktestingBroker
1 participant