Skip to content

Commit

Permalink
Check if we can write new contracts _before_ rolling.
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Feb 13, 2023
1 parent a4097b1 commit 01d361e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions thetagang/portfolio_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,17 +456,17 @@ def manage(self):
click.echo()
click.secho("Checking positions...", fg="green")

self.check_puts(account_summary, portfolio_positions)
self.check_calls(account_summary, portfolio_positions)
# Check if we have enough buying power to write some puts
self.check_if_can_write_puts(account_summary, portfolio_positions)

# Look for lots of stock that don't have covered calls
self.check_for_uncovered_positions(account_summary, portfolio_positions)

# Refresh positions, in case anything changed from the ordering above
portfolio_positions = self.get_portfolio_positions()
self.check_puts(account_summary, portfolio_positions)
self.check_calls(account_summary, portfolio_positions)

# Check if we have enough buying power to write some puts
self.check_if_can_write_puts(account_summary, portfolio_positions)
# Refresh positions, in case anything changed from the orders above
portfolio_positions = self.get_portfolio_positions()

# Wait for pending orders
wait_n_seconds(
Expand Down

0 comments on commit 01d361e

Please sign in to comment.