diff --git a/README.md b/README.md index 7c608162..2aa07d21 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,9 @@ Required `.env` variables: To get your TOTP secret, follow this [guide](guides/schwabSetup.md). -Note: If you are using Windows, you will need to install playwright manually. See [this guide](guides/playwrightWindows.md) for more information. +Note 1: Think or Swim must be enabled on all accounts. To enable, go to `Trade` > `Trading Platforms` > `Learn how to enable thinkorswim`. Then press `Continue` and expand the `thinkorswim Access Agreement` and accept it. Then press `Continue` again. Then select the checkbox for all available accounts and press `Submit`. It may take a day or two for the accounts to be enabled. + +Note 2: If you are using Windows, you may need to install playwright manually. See [this guide](guides/playwrightWindows.md) for more information. ### Tradier Made by yours truly using the official [Tradier API](https://documentation.tradier.com/brokerage-api/trading/getting-started). Consider giving me a ⭐ diff --git a/schwabAPI.py b/schwabAPI.py index e0d4e969..acaafaa3 100644 --- a/schwabAPI.py +++ b/schwabAPI.py @@ -114,10 +114,24 @@ def schwab_transaction(schwab_o: Brokerage, orderObj: stockOrder, loop=None): f"{key} account {print_account}: The order verification was " + "successful" if success - else "unsuccessful", + else "unsuccessful, retrying...", loop, ) if not success: + messages, success = obj.trade( + ticker=s, + side=orderObj.get_action().capitalize(), + qty=orderObj.get_amount(), + account_id=account, + dry_run=orderObj.get_dry(), + ) + printAndDiscord( + f"{key} account {print_account}: The order verification was " + + "retry successful" + if success + else "retry unsuccessful", + loop, + ) printAndDiscord( f"{key} account {print_account}: The order verification produced the following messages: {messages}", loop,