Skip to content

Commit

Permalink
Rearrange bits, allow first wait to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Jul 18, 2023
1 parent 73dd829 commit 6b93a4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions thetagang/portfolio_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,15 @@ def manage(self):

self.submit_orders()

self.wait_for_pending_orders()
try:
self.wait_for_pending_orders()
except RuntimeError:
pass

self.adjust_prices()

self.wait_for_pending_orders()

console.print(
"[bright_yellow]ThetaGang is done, shutting down! Cya next time. :sparkles:[/bright_yellow]"
)
Expand Down Expand Up @@ -1954,8 +1959,6 @@ def adjust_prices(self):
except RuntimeError:
console.print_exception()

self.wait_for_pending_orders()

def wait_for_pending_orders(self):
with console.status(
f"[bold blue_violet]Waiting for {len(self.trades)} orders to submit..."
Expand Down

0 comments on commit 6b93a4d

Please sign in to comment.