Final project for Intro to CS class.

Overview

Financial Analysis Web App

https://share.streamlit.io/mayurk1/fin-web-app-final-project/webApp.py

1. Project Description

This project is a technical analysis web app made using the Streamlit framework. It allows for a user to perform various analysis methods given a ticker and input parameters. The following indicators are supported: Moving Average, Exponential Moving Average, and Moving Average Convergence Divergence. Additionally, a function to plot Moving Average crossovers of user provided windows is also provided (extra credit?). The app allows for charts with the range of current date and up to 999 days in the past.

2. Project Selection

I chose this project as I enjoy analyzing stock data and wanted to learn more about making a web app with visualizations. Through making this app, I learned the basics of web app development and how to use various frameworks. Additionally, I leveraged Python libraries and APIs to collect stock data. I learned how to develop a data collection and analysis pipeline using a stock data API. Finally, I learned how to apply Classes to a real world application through this project.

3. Future Considerations

If I had an opportunity to redo this project, I would make the visualizations more robust by allowing for user manipulation. Further, in order to improve performance and memory, I would implement a caching feature to prevent unnecessary API calls. These changes would be made in order to improve the quality of the data visualizations and provide a long term solution for this web app given the limitations of the free API. Further, I would use a more robust API as the current one is limited in number of calls and does not adjust historic data for stock split prices.

4. How to Run the Web App

The web app is currently hosted on the Streamlit servers at the following URL:

https://share.streamlit.io/mayurk1/fin-web-app-final-project/webApp.py

No additional setup or changes should be needed in order for the app to run.

How to Use the Web App

To start, enter a ticker in the text box in the sidebar (if the sidebar is not visible, press the arrow in the top left corner). SPY is set as the default value if no input is provided. Next, select the type of Technical Analysis you would like to do. Depending on the selection, a set of parameters will be provided below. Next, provide the delta value, which is the number of days from the current day to collect data on. The application will pull the daily adjusted closing values of the provided ticker. Next, adjust the sliders for the given Technical Analysis selection. There are default values for some TAs. In order to revert them, select a different dropdown item and select the original again.

Please wait ~1 second after hitting 'Run' for the app the update.

API Limitations: due to the limitations of the (free) API, historic stock price data is NOT retroactively updated for stock splits.

NOTE: please enter logical selections, if a specific chart is not possible, the system will not graph the line. Hit 'Run' to create a new graph after updating the inputs.

If an incorrect ticker is provided, the system will display an error message. In order to clear this, provide valid inputs in the sidebar and hit 'Run' again.

5. Challenges

The main challenge of this project was finding and using an appropriate framework. Having tried Flask and Django before settling on Streamlit, the process of creating a web app can be very tedious. Further, creating and setting up the proper logic was difficult as I had to account for various user inputs and selections, without having the entire page crash. One of the biggest issues I faced was a proper implementation of updating the sidebar fields given the user selection. I overcame these issues by implementing a Streamlit form in order to prevent user inputs from conflicting with each other.

6. Cited Sources

The official documentations of the Streamlit, Alpaca, and numpy APIs were extensively used. The Streamlit documentation greatly helped in the formulation of the web app elements and implementation of the logic. The Alpaca Markets API and documentation was used in order to pull market data. Finally, the third resource was used to assist in the creation of moving average plots from stock data.

https://docs.streamlit.io/

https://alpaca.markets/docs/

https://www.datacamp.com/community/tutorials/moving-averages-in-pandas

Description of Files

webApp.py

Main web app driver file. Contains the page objects and form logic.

tradingMethods.py

Class to perform the technical analysis functions. Takes in ticker, deltas, and related features.

config.py

Holds references to API keys.

requirements.txt

Necessary Python libraries.

Owner
Mayur Khanna
Biomedical Informatics M.S. Candidate at University of Chicago | Python | JavaScript | Bioinformatics
Mayur Khanna
HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022

HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022 [Project page | Video] Getting sta

51 Nov 29, 2022
BaseCls BaseCls 是一个基于 MegEngine 的预训练模型库,帮助大家挑选或训练出更适合自己科研或者业务的模型结构

BaseCls BaseCls 是一个基于 MegEngine 的预训练模型库,帮助大家挑选或训练出更适合自己科研或者业务的模型结构。 文档地址:https://basecls.readthedocs.io 安装 安装环境 BaseCls 需要 Python = 3.6。 BaseCls 依赖 M

MEGVII Research 28 Dec 23, 2022
Object-aware Contrastive Learning for Debiased Scene Representation

Object-aware Contrastive Learning Official PyTorch implementation of "Object-aware Contrastive Learning for Debiased Scene Representation" by Sangwoo

43 Dec 14, 2022
Learning and Building Convolutional Neural Networks using PyTorch

Image Classification Using Deep Learning Learning and Building Convolutional Neural Networks using PyTorch. Models, selected are based on number of ci

Mayur 126 Dec 22, 2022
Repo for flood prediction using LSTMs and HAND

Abstract Every year, floods cause billions of dollars’ worth of damages to life, crops, and property. With a proper early flood warning system in plac

1 Oct 27, 2021
A tensorflow implementation of GCN-LPA

GCN-LPA This repository is the implementation of GCN-LPA (arXiv): Unifying Graph Convolutional Neural Networks and Label Propagation Hongwei Wang, Jur

Hongwei Wang 83 Nov 28, 2022
PyTorch implementation of SmoothGrad: removing noise by adding noise.

SmoothGrad implementation in PyTorch PyTorch implementation of SmoothGrad: removing noise by adding noise. Vanilla Gradients SmoothGrad Guided backpro

SSKH 143 Jan 05, 2023
Face Mask Detection system based on computer vision and deep learning using OpenCV and Tensorflow/Keras

Face Mask Detection Face Mask Detection System built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect

Chandrika Deb 1.4k Jan 03, 2023
Deep Learning Visuals contains 215 unique images divided in 23 categories

Deep Learning Visuals contains 215 unique images divided in 23 categories (some images may appear in more than one category). All the images were originally published in my book "Deep Learning with P

Daniel Voigt Godoy 1.3k Dec 28, 2022
NATS-Bench: Benchmarking NAS Algorithms for Architecture Topology and Size

NATS-Bench: Benchmarking NAS Algorithms for Architecture Topology and Size Xuanyi Dong, Lu Liu, Katarzyna Musial, Bogdan Gabrys in IEEE Transactions o

D-X-Y 137 Dec 20, 2022
Official PyTorch implementation of "Improving Face Recognition with Large AgeGaps by Learning to Distinguish Children" (BMVC 2021)

Inter-Prototype (BMVC 2021): Official Project Webpage This repository provides the official PyTorch implementation of the following paper: Improving F

Jungsoo Lee 16 Jun 30, 2022
This repository contains code to train and render Mixture of Volumetric Primitives (MVP) models

Mixture of Volumetric Primitives -- Training and Evaluation This repository contains code to train and render Mixture of Volumetric Primitives (MVP) m

Meta Research 125 Dec 29, 2022
Memory-Augmented Model Predictive Control

Memory-Augmented Model Predictive Control This repository hosts the source code for the journal article "Composing MPC with LQR and Neural Networks fo

Fangyu Wu 1 Jun 19, 2022
automatic color-grading

color-matcher Description color-matcher enables color transfer across images which comes in handy for automatic color-grading of photographs, painting

hahnec 168 Jan 05, 2023
Multi-Object Tracking in Satellite Videos with Graph-Based Multi-Task Modeling

TGraM Multi-Object Tracking in Satellite Videos with Graph-Based Multi-Task Modeling, Qibin He, Xian Sun, Zhiyuan Yan, Beibei Li, Kun Fu Abstract Rece

Qibin He 6 Nov 25, 2022
A TikTok-like recommender system for GitHub repositories based on Gorse

GitRec GitRec is the missing recommender system for GitHub repositories based on Gorse. Architecture The trending crawler crawls trending repositories

337 Jan 04, 2023
TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)

TensorFlow Examples This tutorial was designed for easily diving into TensorFlow, through examples. For readability, it includes both notebooks and so

Aymeric Damien 42.5k Jan 08, 2023
This code uses generative adversarial networks to generate diverse task allocation plans for Multi-agent teams.

Mutli-agent task allocation This code uses generative adversarial networks to generate diverse task allocation plans for Multi-agent teams. To change

Biorobotics Lab 5 Oct 12, 2022
[CVPR2021] Invertible Image Signal Processing

Invertible Image Signal Processing This repository includes official codes for "Invertible Image Signal Processing (CVPR2021)". Figure: Our framework

Yazhou XING 281 Dec 31, 2022
SpinalNet: Deep Neural Network with Gradual Input

SpinalNet: Deep Neural Network with Gradual Input This repository contains scripts for training different variations of the SpinalNet and its counterp

H M Dipu Kabir 142 Dec 30, 2022