An awesome repository containing scripts and projects for automating stock orders across multiple brokerages.
- Multi-Ticker Support: Trade multiple stock tickers like
NVDA, TSLA, AAPL
all in one swift test run! π - Multi-Account Login: Effortlessly manage and trade across multiple accounts with seamless login automation π
- Smart Error Handling: Dynamic error checking & handling with XPATHs ensures your trades run smoothly and without hiccups βοΈ
- Account Slicing: Want to focus on specific accounts? Automate starting from a particular account and beyond! π―
- Extended Trading Hours: Take advantage of extended hours for supported brokerages and never miss out on prime trading opportunities β°
- Limit Order Support: Set precise limit orders with select brokerages to stay in control of your trades! π
- 1-Click Updates: Update
.side
files with new tickers, account variables, and more in a single click using.sh
or '.bat
script! π - JavaScript Helper Scripts: Boost efficiency with easy-to-use JavaScript helper scripts for managing account arrays π»
This project contains the means of automating buy/sell stock orders within:
- Ally Invest
- Charles Schwab
- Chase's J.P. Morgan Invest
- Fidelity
- Firstrade
- Merrill Edge Lynch
- Sofi Invest
- Vanguard
- Robinhood (GitHub Gold Sponsor)
- WellsTrade (GitHub Gold Sponsor)
Note: Although I no longer have an Ally Invest or Merrill Edge account, the existing scripts should still work as intended. While I canβt provide direct updates for those platforms, I am able to assist with bug fixes or issues during a remote TeamViewer session for Gold sponsors.
Gold Sponsors get exclusive access to the private repository, filled with the latest updates, cool features, and handy tools. Hereβs a glimpse of what you can expect as a Gold Sponsor:
The private version of the automation script(s) have been completely reworked for maximum efficiency. Unlike the public version, which requires more configuration and manual setup (like for accounts with Chase and Fidelity), the Gold Sponsor version is designed to be seamless, user-friendly, and fast.
You gain access to the latest updates for brokerage automation and project features, ensuring that any potential optimizations, errors, or bugs are promptly addressed in the private version. In contrast, the public version remains unchanged and is not updated as frequently.
Gain access to the Automated Cash Transfer/Withdrawal tool, which lets you seamlessly consolidate funds from multiple accounts into a single account. This script also allows you to rename multiple accounts for easier management. Additionally, Gold Sponsors receive exclusive access to trading automation for Robinhood and WellsTrade.
Ready to upgrade?
Become a Gold Sponsor here and unlock these exclusive benefits!
To use this project, you will need to set the following environment variables in your .env file:
Variable | Description | Type |
---|---|---|
SCHWAB_AI |
Total Number of Schwab Accounts | Integer |
MERRILL_AI |
Total Number of Merrill Accounts | Integer |
VANGUARD_AI |
Total Number of Vanguard Accounts | Integer |
FIDELITY_AI |
Fidelity account numbers | Nested List of Strings |
CHASE_AI |
AI Values found in Chase's Trade URL for each account. You can find Step-By-Step here. | Nested List of Strings |
FIRSTRADE_AI |
Firstrade Account Numbers | List of Strings |
ALLY_AI |
Ally Account Numbers -- In Ally Invest Settings Webpage, change the default orders on the settings for all accounts to be a small penny stock for default stock ticker to minimize risk, Market, 1 Quantity!! | List of Strings |
-- | -- | -- |
CUSTOM_DIR |
Path to the folder to store updated .side files | String |
DYNAMIC |
Dynamic Account Length Feature (0=Off, 1=On) | Integer |
SOFI_AI |
List of account numbers for Sofi Helper Auto.side | List of Strings |
SOFI_ACCOUNT_NAMES |
Account names and numbers for SoFi Auto.side | String |
SOFI_LOGIN |
Login credentials for SoFi Auto.side file | String |
EXCLUDE_ACCOUNTS |
List of SoFi account names to exclude | String |
As a reminder, if you are a Gold Sponsor, please refer to the sponsors
repository README instead of this public version. The sponsor version includes more features and customization options tailored specifically for your needs.
Login Env Example
If you prefer, you can store your login information in a .env
file to automatically open and log in to any brokerage. However, I strongly advise against this practice. Instead, I recommend using the login test to open the login URL and manually log in. Storing credentials in a .side
file is discouraged due to security reasons. Multiple account credentials are separated by the :
character.
Please note that the login test is a best-try approach. Some brokerages, like Chase, may block automated logins, but you can quickly fill out the user/password information manually if you choose to use this tool.
Variable | Description | Type | Example |
---|---|---|---|
CHASE_LOGIN |
Chase Account Credentials | String | CHASE_LOGIN="USERNAME:PASSWORD" |
FIDELITY_LOGIN |
Fidelity Account Credentials | String | FIDELITY_LOGIN="USERNAME:PASSWORD" |
FIRSTADE_LOGIN |
Firstrade Account Credentials | String | FIRSTADE_LOGIN="USERNAME:PASSWORD" |
MERRILL_LOGIN |
Merrill Account Credentials | String | MERRILL_LOGIN="USERNAME:PASSWORD" |
SCHWAB_LOGIN |
Schwab Account Credentials | String | SCHWAB_LOGIN="USERNAME:PASSWORD" |
ALLY_LOGIN |
Ally Account Credentials | String | ALLY_LOGIN="USERNAME:PASSWORD" |
VANGUARD_LOGIN |
Vanguard Account Credentials | String | VANGUARD_LOGIN="USERNAME:PASSWORD" |
Refer to .env.example
for more clarity.
Follow these steps to set up and use Selenium IDE for automation:
-
Download Selenium IDE:
- Install the Selenium IDE browser extension for your preferred browser from the add-on store. For the most reliable automation runs, it is recommend to use a Chromium browser. Avoid using Firefox if possible.
-
Clone the Repository & Install Dependencies:
git clone https://github.com/Prem-ium/Auto-StockTrader cd Auto-StockTrader pip install -r requirements.txt
-
Configure Environment Variables (.env):
Create a.env
file and set up your environment variables following the formats outlined in the Environmental Variables section. -
Run the Python Script:
python main.py
- Pass a stock ticker as an argument to update all
.side
files:
python main.py AAPL
- Separate multiple tickers with a comma:
python main.py NVDA,TSLA,AAPL
- Pass a stock ticker as an argument to update all
-
Open Updated .side Files:
- Open the updated
.side
project files in Selenium IDE.
- Open the updated
-
Execute Desired Automation within Selenium IDE:
- Log in to your brokerage account.
- Begin running your desired automation tasks in either the buy or sell test tabs.
I've been diligently working on this project for several months, and I'm thrilled with the progress it has made. Based on user testimonials, it has proven to be an invaluable tool for automating stock ticker orders across multiple brokerage accounts and various brokerages. I am continually striving to enhance its functionality and optimize its efficiency for automated order execution.
If you appreciate my work and would like to show your support, there are two convenient ways to make a donation:
-
GitHub Sponsors
- Donate via GitHub Sponsors
- Preferred because this donation method is fee-free and offers perks for your contribution.
-
Buy Me A Coffee
Your generous donations will go a long way in helping me cover the expenses associated with developing new features and promoting the project to a wider audience. I extend my heartfelt gratitude to all those who have already contributed. Thank you for your support!
I'm not available to respond to issues in this repository. For direct support, please consider sponsoring me below under the Silver
or Gold
tier. Keep in mind that the public version is mostly "as built" and is rarely updated, while the private Gold Sponsor version receives regular updates and support.
To ensure a smooth review process, please follow these guidelines when submitting a pull request (PR):
- Title: Provide a clear and concise title.
- Description: Include a detailed description of changes, problems addressed, and any relevant context.
- Documentation: If necessary, update comments, README, requirements, and any relevant documentation.
- License Compliance: Ensure any changes made in forks uphold the repository's license. Do not make changes to certain areas such as the
FUNDING.yml
or any present copyright information without approval.
Once you have verified that your changes adhere to these guidelines, please open a pull request with your changes and click 'Request Review' on the Pull Request.
By adhering to these guidelines, you help maintain the quality and consistency of the project. Thank you for your interest in making contributions!
This repository follows the BSD 3-Clause βNewβ or βRevisedβ License.
I express my sincere gratitude to my sponsors, donors, & project contributor(s). Your support is invaluable, and it enables me to create exciting projects like this.
Thank you for backing my work. Each one of you plays a crucial role, and I am truly grateful for your contributions. If you find this project interesting, please consider leaving a π, donating, or contributing if you found this project to be helpful!
- Tax Document Consolidator (Coming Soon):: Iβm developing a 1099 Tax Consolidation script that combines multiple tax PDFs from brokerages into a single CSV, detailing all relevant tax information (such as proceeds, costs, gains, interest earned, etc.).
- The script also offers data analysis and visualization for your 1099 tax returns.
- Useful for people with multiple accounts. Most accountants charge anywhere from $50-$100/per tax document; so the hope is it will help people save big. The program comes with a CSV/PDF viewer, which makes it easy to verify accuracy.
- Stay tuned for its release, which will be available for purchase soon.
- Referral-Link-Me: Maximize your rewards with curated referral links for credit cards, brokerages, and more.
- Adjust
SET_SPEED
env to control test execution pace on faster computers. - Opt for 'Reference' over 'Log' in Selenium IDE for faster execution.
- Activate 'Best performance' mode in Laptop Battery settings to accelerate execution.
- Keep the browser's automation tab as the focused window for potential speed enhancements.
π― Stream Deck
This part of the README might be extremely specific to a subset of people, specifically those who own Elgato Stream Decks. This is how I have mine currently set up, which may or may not be helpful for others:
Action | Type | Command |
---|---|---|
Run | Hotkey | Ctrl + R |
Stop | Hotkey | Ctrl + . |
Pause | Hotkey | Ctrl + P |
QuickStart | Open | cmd.exe /c ""C:\Users\Frost\Desktop\RSA-QuickStart.bat"" |
Save | Hotkey | Ctrl + S |
Switch Windows | Hotkey | Alt + Tab |
Open Tests | Hotkey | Ctrl + 1 |
Open Test Suites | Hotkey | Ctrl + 2 |
Start Brave | Powershell | Start-Process "AppData\Local\BraveSoftware\Brave-Browser\Application\brave.exe" -ArgumentList "--new-window", "--app=chrome-extension://mooikfkahbdckldjjndioackbalphokd/index.html" |
Start Edge | Powershell | start msedge --app="chrome-extension://ajdpfmkffanmkhejnopjppegokpogffp/index.html" |
I am not a financial advisor, nor am I affiliated with any brokerage mentioned in this repository.
You may use this tool at your own risk. I am not responsible for any financial loss, account restriction, or any other damage that may occur with the use of this tool. This project is provided "as is" and without warranty of any kind.
By using this repository, the user accepts all the risks and agrees to hold the developer(s) harmless from any claims, damages, or losses arising from the use of the project.