From 4a1346ed3a86a3301e95d98dbd8874f56d5baf01 Mon Sep 17 00:00:00 2001 From: Nelson Dane <47427072+NelsonDane@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:27:08 -0500 Subject: [PATCH 1/2] fallback to v1 on schwab orders --- schwabAPI.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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, From f3fca434c7233c7533a769d13baadb85be86ddba Mon Sep 17 00:00:00 2001 From: Nelson Dane <47427072+NelsonDane@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:36:22 -0500 Subject: [PATCH 2/2] add thinkorswim instructions --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ⭐