Skip to content

Commit

Permalink
Merge branch 'develop' into develop-schwab
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane authored Oct 10, 2023
2 parents b769ae6 + ccbff02 commit a04a23f
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 345 deletions.
6 changes: 0 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ DANGER_MODE="false"
# at the same brokerage with a comma, then separate account credentials with a colon
# BROKER=BROKER_USERNAME:BROKER_PASSWORD,OTHER_BROKER_USERNAME:OTHER_BROKER_PASSWORD

# Ally (CURRENTLY DISABLED)
# ALLY=ALLY_CONSUMER_KEY:ALLY_CONSUMER_SECRET:ALLY_OAUTH_TOKEN:ALLY_OAUTH_SECRET
# ALLY_ACCOUNT_NUMBERS=ALLY_ACCOUNT_NUMBER_1:ALLY_ACCOUNT_NUMBER_2
ALLY=
ALLY_ACCOUNT_NUMBERS=

# Fidelity
# FIDELITY=FIDELITY_USERNAME:FIDELITY_PASSWORD
FIDELITY=
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ RUN playwright install && \

# Grab needed files
COPY ./autoRSA.py .
COPY ./allyAPI.py .
COPY ./fidelityAPI.py .
COPY ./robinhoodAPI.py .
COPY ./schwabAPI.py .
Expand Down
40 changes: 11 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
A CLI tool and Discord bot to buy and sell the same amount of stocks across multiple accounts!

## What is RSA?
RSA stands for "Reverse Split Arbitrage." This is a strategy where you buy the same amount of stocks in multiple accounts across multiple brokers right before a stock performs a reverse split. Once the stock splits and your fractional share is rounded up to a full share, you profit!

This project will allow you to maximize your profits by being able to easily manage multiple accounts across different brokerages, buying and selling as needed.
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
To create your Discord bot and get your `DISCORD_TOKEN`, follow this [guide](guides/discordBot.md).
Expand Down Expand Up @@ -34,21 +32,21 @@ To buy and sell stocks, use this command:

`<action> <amount> <ticker> <accounts> <dry>`

For example, to buy 1 STAF in all accounts:
For example, to buy 1 AAPL in all accounts:

`buy 1 STAF all false`
`buy 1 AAPL all false`

For a dry run of the above command in Robinhood only:

`buy 1 STAF robinhood true`
`buy 1 AAPL robinhood true`

For a real run on Ally and Robinhood, but not Schwab:
For a real run on Fidelity and Robinhood, but not Schwab:

`buy 1 STAF ally,robinhood not schwab false`
`buy 1 AAPL fidelity,robinhood not schwab false`

For a real run on Ally and Robinhood but not Schwab buying both STAF and AREB:
For a real run on Fidelity and Robinhood but not Schwab buying both AAPL and GOOG:

`buy 1 STAF,AREB ally,robinhood not schwab false`
`buy 1 AAPL,GOOG fidelity,robinhood not schwab false`

To check your account holdings:

Expand Down Expand Up @@ -92,25 +90,7 @@ DISCLAIMER: I am not a financial advisor and not affiliated with any of the brok

## Supported brokerages:

All brokers: separate account credentials with a colon (":"). For example, `ALLY_USERNAME:ALLY_PASSWORD`. Separate multiple logins with the same broker with a comma (","). For example, `ALLY_USERNAME:ALLY_PASSWORD,ALLY_USERNAME2:ALLY_PASSWORD2`.

### Ally
**Ally has disabled their API, so Ally is currently unsupported.**

Made using [PyAlly](https://github.com/alienbrett/PyAlly). Go give them a ⭐

Required `.env` variables:
- `ALLY_CONSUMER_KEY`
- `ALLY_CONSUMER_SECRET`
- `ALLY_OAUTH_TOKEN`
- `ALLY_OAUTH_SECRET`
- `ALLY_ACCOUNT_NUMBERS`

`.env` file format:
- `ALLY=ALLY_CONSUMER_KEY:ALLY_CONSUMER_SECRET:ALLY_OAUTH_TOKEN:ALLY_OAUTH_SECRET`
- `ALLY_ACCOUNT_NUMBERS=ALLY_ACCOUNT_NUMBER1:ALLY_ACCOUNT_NUMBER2`

To get these, follow [these instructions](https://alienbrett.github.io/PyAlly/installing.html#get-the-library).
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`.

### Fidelity
Made by yours truly using Selenium (and many hours of web scraping).
Expand Down Expand Up @@ -179,6 +159,8 @@ Required `.env` variables:
- `TASTYTRADE=TASTYTRADE_USERNAME:TASTYTRADE_PASSWORD`

### 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.
#### Vanguard
Expand Down
241 changes: 0 additions & 241 deletions allyAPI.py

This file was deleted.

4 changes: 1 addition & 3 deletions autoRSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Import libraries
import os
import re
import sys
import traceback

Expand All @@ -13,7 +12,6 @@
from dotenv import load_dotenv

# Custom API libraries
from allyAPI import *
from fidelityAPI import *
from helperAPI import killDriver, stockOrder, updater
from robinhoodAPI import *
Expand All @@ -30,7 +28,7 @@


# Global variables
SUPPORTED_BROKERS = ["ally", "fidelity", "robinhood", "schwab", "tastytrade", "tradier"]
SUPPORTED_BROKERS = ["fidelity", "robinhood", "schwab", "tastytrade", "tradier"]
DISCORD_BOT = False
DOCKER_MODE = False
DANGER_MODE = False
Expand Down
Loading

0 comments on commit a04a23f

Please sign in to comment.