A CLI tool and discord bot to buy the same amount of stocks in multiple accounts!
View on Docker Hub
- Clone the repo and cd into it
- Create a
.env
file for your brokerage variables, and add your bot usingDISCORD_TOKEN
andDISCORD_CHANNEL
- Just run
docker run --env-file ./.env -it --restart unless-stopped --name rsa nelsondane/auto-rsa
- The bot should appear online (You can also do
!ping
). Once bot is working, just enter CTRL-p then CTRL-q to exit gracefully, letting the bot run in the background. See below for command explanation.
Make sure python3-pip is installed
- Clone this repository and cd into it
- Run
pip install -r requirements.txt
- Create a
.env
file for your brokerage variables, and add your bot usingDISCORD_TOKEN
andDISCORD_CHANNEL
- Run
python auto-rsa.py
(See below for command explanation)
- Follow the Always Running Python Script steps until Step 4
- Run the script using
python3 auto-rsa.py <action> <amount> <ticker> <account> <dry>
(See below for parameter explanation)
Ping-Pong: Once the bot is invited to your server, you can check that it's running by sending !ping
, to which the bot should respond with pong
To buy and sell stocks, just send a message of this format in discord:
!rsa <action> <amount> <ticker> <account> <dry>
!rsa
: command name (not in CLI)<action>
:buy
orsell
<amount>
: Amount to buy or sell. Must be an integer<ticker>
: The stock ticker to buy or sell<account>
: What brokerage to run it in (robinhood, schwab, or all)<dry>
: Whether to run in "dry" mode (in which no transactions are made, useful for testing). Set to True, False, or just write "dry" for True
For example, to buy 1 STAF in all accounts:
!rsa buy 1 STAF all false
.
For a dry run of the above command in Robinhood only:
!rsa buy 1 STAF robinhood true
.
To check individual account holdings:
!holdings broker-name
.
To see when the market opens/closes:
!market
.
To restart the bot:
!restart
.
After a few seconds, the bot will let you know if anything happened! (Hopefully)
For example, to buy 1 STAF in all accounts:
python3 auto-rsa.py buy 1 STAF all false
.
For a dry run of the above command in Robinhood only:
python3 auto-rsa.py buy 1 STAF robinhood true
.
To check individual account holdings:
python3 auto-rsa.py holdings broker-name
.
After a few seconds you should see some output in the terminal (Hopefully)
Made using PyAlly. Go give them a ⭐
Required .env
variables:
- ALLY_CONSUMER_KEY
- ALLY_CONSUMER_SECRET
- ALLY_OAUTH_TOKEN
- ALLY_OAUTH_SECRET
- ALLY_ACCOUNT_NBR
To get these, follow these instructions
Made using robin_stocks. Go give them a ⭐
Required .env
variables:
- ROBINHOOD_USERNAME
- ROBINHOOD_PASSWORD
- ROBINHOOD_TOTP: If 2fa enabled
Configuring 2fa can be tricky, read the TOTP section here
Made using schwab-api. Go give them a ⭐
Required .env
variables:
- SCHWAB_USERNAME=
- SCHWAB_PASSWORD=
- SCHWAB_TOTP_SECRET= (If 2fa is enabled)
To get your TOTP secret, use this website by the api author
Made by yours truly using the official Tradier API
Required .env
variables:
- TRADIER_ACCESS_TOKEN
To get your access token, go to your Tradier API settings
No official or 3rd party APIs were found, so would have to create one from scratch using web scraping. (Kind of like these one two).
Same as Fidelity. I found this vanguard-api, but it failed when I ran it.
No official or 3rd party APIs, but have a website. So same as Fidelity and Vanguard.
Not currently working since login is broken in webull. Go give them a ⭐ anyways.
No official or 3rd party APIs and no website to scrape (app only).
Why.