Skip to content

Conversation

hhhezhang
Copy link

@hhhezhang hhhezhang commented Jul 3, 2025

Sometimes it won't send me the account summary in the morning because of the 24 hours min gap check failed.

Description by Korbit AI

What change is being made?

Update the minimum requirement check for sending the account summary to Discord, reducing the 24-hour threshold by 5 minutes.

Why are these changes being made?

The adjustment accounts for potential discrepancies in timing and ensures that minor delays or drifts in time do not prevent the account summary from being sent if it has been slightly less than 24 hours since the last summary. This enhances the robustness of the timing check and prevents unnecessary delays in communication.

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

@hhhezhang hhhezhang requested a review from grzesir as a code owner July 3, 2025 20:56
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.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Readability Unexplained Magic Numbers in Timing Logic ▹ view 🧠 Not in scope
Files scanned
File Path Reviewed
lumibot/strategies/_strategy.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

# Check if it has been at least 24 hours since the last account summary
if self.last_account_summary_dt is None or time_since_last_account_summary.total_seconds() >= 86400: # 24 hours
# Check if it has been at least 24 hours - 5mins since the last account summary
if self.last_account_summary_dt is None or time_since_last_account_summary.total_seconds() >= (86400 - 300):

This comment was marked as resolved.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Order Processing Skipped in Alpaca Broker

The self.process_pending_orders(strategy=strategy) call was accidentally removed from lumibot/brokers/alpaca.py. This change, unrelated to the PR's stated purpose of fixing account summary timing, prevents pending orders from being processed, breaking order execution functionality in the Alpaca broker.

lumibot/brokers/alpaca.py#L328-L331

"""
# Seconds until the bell rings
time_to_close = self.get_time_to_close()

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@@ -326,9 +326,6 @@ def _await_market_to_close(self, timedelta=None, strategy=None):
The calling strategy; forwarded so pending orders can be processed
the same way BacktestingBroker does.
"""
# First, handle any orders waiting to be processed.
self.process_pending_orders(strategy=strategy)
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this removed?

@grzesir
Copy link
Contributor

grzesir commented Jul 7, 2025

Hey I'm be happy to merge this but i think you need to add back process_pending_orders()

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.

2 participants