The Automated Trading System is an unofficial way to access the Charles Schwabs API. In addition, its a scalable system designed to execute trades autonomously based on alert triggers from Thinkorswim Trading Platform. It aims to provide transaction processing for various financial instruments, including stocks and options.
- Authenticate and access the Google and Charles Schwab API.
- Auto "access token" updates and "refresh token" updates.
- Functions for almost all API functions (in src/app/schwab.py).
- Stream real-time data (Work in progress).
- Continuosly scrapes Gmail account for buy/sell alerts sent from Thinkorswim.
- Automates fast and secure trade execution based on alerts.
- Follows a performance tracker on Google Sheet.
- Requests real-time data such as price history, option chain, portfolio details, etc.
- Real-time Market Data: Fetch live market prices and option chains.
- Portfolio Management: Track user portfolios.
- Transaction Processing: Handle buy/sell option orders.
- Analytics Dashboard: Visualize trading performance (Work in progress).
- Secure User Authentication: User login and secure session handling.
- Backend: Django
- Database: MySQL
- Frontend: HTML, CSS
- API Integration: Charles Schwab API, Google Sheet, Google Gmail
- Testing: Postman
- Deployment: AWS, Heroku
- Thinkorswim Account (Charles Schwabs Trading Platform)
- Charles Schwabs Developer Account (Charles Schwabs Developer Portal)
- Google Cloud Platform Account (Google Cloud Computing Services)
- Gmail Account (Solely for trading)
- MySQL (local or cloud-based instance)
- Clone the repository:
git clone https://github.com/Josue-Castellanos/Automated_Trading_System.git cd Automated_Trading_System
- Setup .env file in app directory
ACCESS_TOKEN_DATETIME = None REFRESH_TOKEN_DATETIME = None JSON_DICT = None ACCESS_TOKEN = None REFRESH_TOKEN = None ID_TOKEN = None ACCOUNT_NUMBER = Your Charles Schwab Account Number here APP_KEY = Your Charles Schwab App Key here SECRET_KEY = Your Charles Schwab App Secret Key here ENV_PATH = Your Enviroment Variables Path here CALLBACK_URL = Your App Callback URL here (if local then https://127.0.0.1 ACCOUNT_ENDPOINT = https://api.schwabapi.com/trader/v1 MARKET_ENDPOINT = https://api.schwabapi.com/marketdata/v1 POST_ENDPOINT = https://api.schwabapi.com/v1/oauth/token STREAM_ENDPOINT = https://api.schwab.com/v1 CLIENT_ID = Your Google Service Client ID here CLIENT_SECRET = Your Google Service Client Secret here SHEET_ID = [Optional] Your Google Sheet ID here PERFORMANCE_PATH = Your Google Service Performance JSON Path here CREDENTIALS_PATH = Your Google Service Credentials JSON Path here TOKEN_PATH = Your Google Service Token JSON Path here