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

return all orders regardless of the status #508

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

grzesir
Copy link
Contributor

@grzesir grzesir commented Aug 2, 2024

Description by Korbit AI

Note

This feature is in early access. You can enable or disable it in the Korbit Console.

What change is being made?

Add support for tracking and processing orders with an "error" status in the lumibot library.

Why are these changes being made?

This change ensures that all orders, including those with errors, are tracked and processed correctly, providing a more comprehensive order management system. This addresses the issue of untracked error orders and improves the robustness of the order handling mechanism.

Copy link
Contributor

korbit-ai bot commented Aug 2, 2024

My review is in progress 📖 - I will have feedback for you in a few minutes!

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 have reviewed your code and found 1 potential issue. To discuss my individual comments that I have added, tag me in replies using @korbit-ai.


Please react with a 👍 to my comments that you find helpful and a 👎 to those you find unhelpful - this will help me learn and improve as we collaborate.

Comment on lines +606 to +614
def _process_error_order(self, order, error):
self._new_orders.remove(order.identifier, key="identifier")
self._unprocessed_orders.remove(order.identifier, key="identifier")
self._partially_filled_orders.remove(order.identifier, key="identifier")
self._filled_orders.remove(order.identifier, key="identifier")
order.status = self.ERROR_ORDER
order.set_error(error)
self._error_orders.append(order)
return order
Copy link
Contributor

Choose a reason for hiding this comment

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

category Error Handling

The _process_error_order method is handling error orders, but it is not providing any information about the error or alerting the caller that an error occurred. Consider adding logging statements or raising an exception to provide more visibility into error orders and potentially halt execution if necessary.

@grzesir grzesir merged commit 0dc5b8c into dev Aug 3, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant