Stockgraph is a web app to explore the stock market and individual stocks.
This app uses the FastAPI framework you can learn more about it here.
A full list of the libaries and pacakages used can be found below. One important to note is that the price data used comes from Alpaca. Alpaca is a an API provider for algorithimic traders. You will need to sign up for an account in order to receive an API key.
Once you have your credentials create a config.py file to store your API_KEY and SECRET_KEY.
Data for this app is updated at the end of the day. It uses crontab jobs to run the populate_prices.py file in the db folder. Cron should be installed in most MacOS and Linux distributions. Click here for a quick walk through on cron.
FastAPI
- fastapi
- uvicorn
SQLite
sqlite3
Download here
Tulip Indicators
- tulipy
Alpaca
- alpaca_trade_api
UI
Tradingview widgets
Chart.js
Jinja2 Templates
Other
- requests
- DateTime
- pytrends
- pygooglenews
- pandas
- numpy
Javascript libaries: jQuery
Home
Screener
Single View
Order History
Study
The home is the base page and is the first thing you see when entering the site. The page was built using CSS grid and it displays data from the DB as well as data from google trends, and google news by using the packages pytrends and pygooglenews. The charts use Chart.js and TradingView Lightweight Charts.
The screener is for end of day screening and doesn't display intraday data. The data is pulled from the DB. The percentage change as well as the indicators are computed using numpy and the tulip indicators library.
To see information on individual stocks use the searchbar or click on the company names when using the screener.
This view features a tradingview chart, company news, stocktwists feed and a side bar with the following information:
company financials
analyst ratings
related companies
strategy
Note: To see order history you need access to your Alpaca trading account.
IP: This section shows andvance analysis on one stock at a time.
Transitioning to using Postgres DB in production