Stock Trading Game in Python/Flask, using SQL for the DB and HTML/CSS (Bootstrap) for the layout. Featuring user registration/login and real time stock price query using API.
-
Python 3.7.3 - The Back-End
-
Flask - The Web Framework used
-
Jinja - Template Engine
-
SQLite - Database Engine
-
BootStrap - Front-End component (Menu)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need Python 3.x and the following libraries and packages. Type commands in terminal to install:
pip install flask
pip install flask_session
pip install sqlite3
pip install cs50
In addition, you will need a Vantage AUTH Key to access real-time stock data and use this application. Request a Key by signing up on Alpha Vantage
A step by step series of examples that tell you how to get a development env running
Download all files into a folder. Ensure that all imported libraries in app.py
and helpers.py
are
installed on your machine or virtual environment.
Edit helpers.py
by replacing 'AUTH_KEY' in the lookup()
function with your personal AUTH Key (See prerequisites)
url = f"https://www.alphavantage.co/query?apikey=AUTH_KEY&datatype=csv&function" \
f"=TIME_SERIES_INTRADAY&interval=1min&symbol={symbol} "
Run the program on your machine or virtual environment.
flask run
- Realized gains/losses, and addition to volume-dependent service fee per transaction
- Graphical representation of performance vs major stock indices (S&P 500, DOW, etc.)
- Completed as part of Harvard CS50 Curriculum