- I built a stock trading web application where users can invest stocks with a real-time stock quotes starting with $10,0000 of virtual money. This project is inspired by my passion for stock trading, computer science, and coding. This is a Python web application using Flask, Werkzeug exceptions and security, SQLite3, Requests, Jinja, Bootstrap4, Javascript, HTML5, and CSS3.
You will need the following installed on your computer system and import the following libraries:
- Python >= 3.7
- os
- datetime
- time
- SQLite3
- Flask and flash, jsonify, redirect, render_template, and request
- Flask_session
- tempfile
- Werkzeug.exceptions and default_exceptions, HTTPException, InternalServerError
- Werkzeug.security and check_password_hash, generate_password_hash
-
API Key from https://iexcloud.io/ as they are the real-time stock data provider
-
Clone / Download Entire Repository
-
Open up the terminal and navigate to the repository
-
Export your API_KEY into the terminal
-
Run "python application.py"
-
Please view the application.py - here is where most of my Python logic and coding remains, including most of my SQL queries (e.g. common expression tables, Insert, and Update queries)
-
Jinja Templates are in the "templates" folder where I created a layout, and created several custom dynamic pages
-
Password Hashing - this web application hashes the user's password upon account registration, so no real passwords are stored in the database
-
Portfolio Balance - presents users current investment portfolio and cash position. Default new users start with $10,000.
-
Quote & Buy - in a three step process, the user will first query for a stock ticker, perform a buy estimate, and either executes a buy order, or not, using real time API quotes provided by IEX Cloud (https://iexcloud.io/) This process is concluded with a buy order confirmation
-
Sell - in a two step process, users may estimate, and subsequently, execute a sell order
-
Transaction History - view when all orders were place in the History page where the database displays all executed orders
-
Responsive Algorithm Preventing Errors - the algorithm will not allow users to purchase more shares of stock they can afford, or sell more shares than they have or do not own. The program will also instruct users what they need to fix in order to proceed
-
Account Registration Page - all fields must be complete or application will return an error message
-
Registration Error - Example of an error message if a field is missing
-
Quote & Buy - Phase 3b - If user click's "Estimate" with a blank quantity
-
Sell - Phase 1a Estimate Order - Error Example Invalid "Sell Quantity"
-
Sell - Phase 1b Estimate Order - Error Example Invalid Stock Symbol
-
Use Regular Expressions to vet unwanted inputs
-
Update to production grade database infrastructure using PostGres SQL and deploy using Heroku because of it's free cost structure for dynamic data
-
Create function to allow users to change passwords or add more money
- Hope you enjoyed it. Thank you for your time!
- Johneson Giang - Invidual Project - Github
This project is licensed under the MIT License - see the LICENSE.md file for details
-
Shout out to David J. Mahlan and Brian Yu
-
BootStrap4 Free Templates - Kelly
-
I definitely want to give a shout out to my dear teacher, mentor, and friend @CodingWithCorgis!