From ffeb44324b6c70c7e741dcfb095cd701774ec6c8 Mon Sep 17 00:00:00 2001 From: Nelson Dane <47427072+NelsonDane@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:09:21 -0400 Subject: [PATCH] fancy readme --- README.md | 50 ++++++++++++++++++++-------------- testLogin.py | 76 ---------------------------------------------------- 2 files changed, 30 insertions(+), 96 deletions(-) delete mode 100644 testLogin.py diff --git a/README.md b/README.md index afd2a090..fab6f6f8 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,39 @@ -# AutoRSA Discord Bot and CLI Tool -A CLI tool and Discord bot to buy and sell the same amount of stocks across multiple accounts! +# ✨ AutoRSA ✨ +## Discord Bot and CLI Tool +A CLI tool and Discord bot to buy, sell, and monitor holdings across multiple accounts! -## What is RSA? -RSA is a stock trading strategy where buying and selling a stock across multiple brokerages would be very beneficial, hence this project. + + + + -## Discord Bot Installation +## ❓ What is RSA? ❓ +You already know what Reverse Split Arbitrage is, that's not why you're here. If you do know what it is, then you know why a tool like this would be valuable. If you're a big player, even more so... + +## πŸ€” How Does It Work? πŸ€” +This program uses APIs to interface with your brokerages. When available, official APIs are always used. If an official API is not available, then a third-party API is used. As a last resort, Selenium or Playwright Stealth are used to automate the browser. + +## πŸ€– Discord Bot Installation πŸ€– To create your Discord bot and get your `DISCORD_TOKEN`, follow this [guide](guides/discordBot.md). -### Docker +### 🐳 Docker 🐳 1. Create a `.env` file for your brokerage variables using [.env.example](.env.example) as a template, and add your bot using `DISCORD_TOKEN` and `DISCORD_CHANNEL` 2. Using the provided [docker-compose.yml](docker-compose.yml) file, run the command `docker compose up -d` inside the project directory. 3. The bot should appear online (You can also do `!ping` to check). -### Always Running Python Script +### πŸƒβ€β™‚οΈ Always Running Python Script πŸƒβ€β™€οΈ Make sure python3-pip is installed 1. Clone this repository and cd into it 2. Run `pip install -r requirements.txt` 3. Create a `.env` file for your brokerage variables using [.env.example](.env.example) as a template, and add your bot using `DISCORD_TOKEN` and `DISCORD_CHANNEL` 4. Run `python autoRSA.py` (See below for more command explanations) -## CLI Tool Installation +## πŸ’» CLI Tool Installation πŸ’» 1. Clone this repository and cd into it 2. Run `pip install -r requirements.txt` 3. Create a `.env` file for your brokerage variables using [.env.example](.env.example) as a template. 4. Run the script using `python autoRSA.py` plus the command you want to run (See below for more command explanations) -## Usage +## πŸ‘€ Usage πŸ‘€ If running as a Discord bot, append `!rsa` to the beginning of each command. If running from the CLI Tool, append `python autoRSA.py` to the beginning of each command. @@ -60,7 +69,9 @@ For help: `!help` (without appending `!rsa`) -### Parameters +Note: There are two special keywords you can use when specifying accounts: `all` and `day1`. `all` will use every account that you have set up. `day1` will use "day 1" brokers, which are Robinhood, Schwab, Tastytrade, and Tradier. This is useful for brokers that provide quick turnaround times, hence the nickname "day 1". + +### βš™οΈ Parameters βš™οΈ - ``: string, "buy" or "sell" - ``: integer, Amount to buy or sell. - ``: string, The stock ticker to buy or sell. Separate multiple tickers with commas and no spaces. @@ -68,15 +79,12 @@ For help: - ``: string proceeding `not`, What brokerages to exclude from command. Separate multiple brokerages with commas and no spaces. - ``: boolean, 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`. Defaults to `True`, so if you want to run a real transaction, you must set this explicitly. -### Testing your Login Credentials -To test your login credentials, run `python testLogin.py`. This will print all your `.env` variables and attempt to log in to each brokerage. If you get an error, check your `.env` variables and try again. This prints everything in plain text, so don't share the output with anyone! - -### Guides +### πŸ—ΊοΈ Guides πŸ—ΊοΈ More detailed guides for some of the difficult setups: - [Discord Bot Setup](guides/discordBot.md) - [Schwab 2FA Setup](guides/schwabSetup.md) -## Contributing +## 🀝 Contributing 🀝 Found or fixed a bug? Have a feature request? Want to add support for a new brokerage? Feel free to open an issue or pull request! Is someone selling a ripoff of this bot? (Looking at you OSU freshmen). Get it from here and contribute to open source! @@ -85,10 +93,10 @@ Like what you see? Feel free to support me on Ko-Fi! [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/X8X6LFCI0) -## DISCLAIMER +## 😳 DISCLAIMER 😳 DISCLAIMER: I am not a financial advisor and not affiliated with any of the brokerages listed below. Use this tool at your own risk. I am not responsible for any losses or damages you may incur by using this project. This tool is provided as-is with no warranty. -## Supported brokerages: +## πŸ‘ Supported brokerages πŸ‘ All brokers: separate account credentials with a colon (":"). For example, `SCHWAB_USERNAME:SCHWAB_PASSWORD`. Separate multiple logins with the same broker with a comma (","). For example, `SCHWAB_USERNAME:SCHWAB_PASSWORD,SCHWAB_USERNAME2:SCHWAB_PASSWORD2`. @@ -156,11 +164,13 @@ Required `.env` variables: `.env` file format: - `TASTYTRADE=TASTYTRADE_USERNAME:TASTYTRADE_PASSWORD` -### Maybe future brokerages +### πŸ€·β€β™‚οΈ Maybe future brokerages πŸ€·β€β™€οΈ #### Ally Ally disabled their official API, so all Ally packages don't work. I am attempting to reverse engineer their API, which you can track [here](https://github.com/NelsonDane/ally-api). Once I get it working, I will add it to this project. #### Chase -I will be signing up for a Chase account soon, and I have heard that it is possible, so I will be looking into it soon. +Chase doesn't have an official API, so it would have to be added using Selenium. +#### Firstrade +In progress on the `develop-firstrade` branch. Stay tuned. #### Vanguard Will be added using Selenium just like Fidelity. I found this [vanguard-api](https://github.com/rikonor/vanguard-api), but it failed when I ran it. #### SoFi @@ -169,6 +179,6 @@ Login requires SMS 2fa, and I'm not sure how to do that automatically. In progress on [develop-webull](https://github.com/NelsonDane/auto-rsa/pull/61). Stay tuned. #### Public Same as Webull and SoFi. -### Never working brokerages +### πŸ‘Ž Never working brokerages πŸ‘Ž #### Stash Why. diff --git a/testLogin.py b/testLogin.py deleted file mode 100644 index 8858b897..00000000 --- a/testLogin.py +++ /dev/null @@ -1,76 +0,0 @@ -# Nelson Dane -# Script to check auto rsa logins -# Run this to make sure the accounts successfully log in - -# Standard libraries -import os - -from dotenv import load_dotenv - -# Custom API libraries -from fidelityAPI import fidelity_init -from robinhoodAPI import robinhood_init -from schwabAPI import schwab_init -from tastyAPI import tastytrade_init -from tradierAPI import tradier_init - -# Initialize .env file -load_dotenv() - -# Check for environment variables -# Discord -if os.environ.get("DISCORD_TOKEN") is None: - print("DISCORD_TOKEN not found") -else: - print(f"Discord token found {os.environ.get('DISCORD_TOKEN')}") -if os.environ.get("DISCORD_CHANNEL") is None: - print("DISCORD_CHANNEL not found") -else: - print(f"Discord channel found {os.environ.get('DISCORD_CHANNEL')}") -# Fidelity -if os.environ.get("FIDELITY") is None: - print("FIDELITY not found") -else: - print(f"FIDELITY found {os.environ.get('FIDELITY')}") -# Robinhood -if os.environ.get("ROBINHOOD") is None: - print("ROBINHOOD not found") -else: - print(f"ROBINHOOD found {os.environ.get('ROBINHOOD')}") -# Schwab -if os.environ.get("SCHWAB") is None: - print("SCHWAB not found") -else: - print(f"SCHWAB found {os.environ.get('SCHWAB')}") -# Tradier -if os.environ.get("TRADIER") is None: - print("TRADIER not found") -else: - print(f"TRADIER found {os.environ.get('TRADIER')}") -# Tastytrade -if os.environ.get("TASTYTRADE") is None: - print("TASTYTRADE not found") -else: - print(f"TASTYTRADE found {os.environ.get('TASTYTRADE')}") -print() - -# Check each account -print("==========================================================") -print("Checking Accounts...") -print("==========================================================") -print() -fidelity_init() -print() -robinhood_init() -print() -schwab_init() -print() -tradier_init() -print() -tastytrade_init() -# Print results -print() -print("==========================================================") -print("All checks complete") -print("==========================================================") -print()