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
Python binding for Khiva library.

Khiva-Python Build Documentation Build Linux and Mac OS Build Windows Code Coverage README This is the Khiva Python binding, it allows the usage of Kh

Shapelets 46 Oct 16, 2022
Unofficial Pytorch Lightning implementation of Contrastive Syn-to-Real Generalization (ICLR, 2021)

Unofficial Pytorch Lightning implementation of Contrastive Syn-to-Real Generalization (ICLR, 2021)

Gyeongjae Choi 17 Sep 23, 2021
MatryODShka: Real-time 6DoF Video View Synthesis using Multi-Sphere Images

Main repo for ECCV 2020 paper MatryODShka: Real-time 6DoF Video View Synthesis using Multi-Sphere Images. visual.cs.brown.edu/matryodshka

Brown University Visual Computing Group 75 Dec 13, 2022
Contains code for the paper "Vision Transformers are Robust Learners".

Vision Transformers are Robust Learners This repository contains the code for the paper Vision Transformers are Robust Learners by Sayak Paul* and Pin

Sayak Paul 103 Jan 05, 2023
Official PyTorch Implementation of Learning Self-Similarity in Space and Time as Generalized Motion for Video Action Recognition, ICCV 2021

Official PyTorch Implementation of Learning Self-Similarity in Space and Time as Generalized Motion for Video Action Recognition, ICCV 2021

26 Dec 07, 2022
A nutritional label for food for thought.

Lexiscore As a first effort in tackling the theme of information overload in content consumption, I've been working on the lexiscore: a nutritional la

Paul Bricman 34 Nov 08, 2022
Apache Flink

Apache Flink Apache Flink is an open source stream processing framework with powerful stream- and batch-processing capabilities. Learn more about Flin

The Apache Software Foundation 20.4k Dec 30, 2022
ContourletNet: A Generalized Rain Removal Architecture Using Multi-Direction Hierarchical Representation

ContourletNet: A Generalized Rain Removal Architecture Using Multi-Direction Hierarchical Representation (Accepted by BMVC'21) Abstract: Images acquir

10 Dec 08, 2022
Official code for article "Expression is enough: Improving traffic signal control with advanced traffic state representation"

1 Introduction Official code for article "Expression is enough: Improving traffic signal control with advanced traffic state representation". The code s

Liang Zhang 10 Dec 10, 2022
Chinese Advertisement Board Identification(Pytorch)

Chinese-Advertisement-Board-Identification. We use YoloV5 to extract the ROI of the location of the chinese word. Next, we sort the bounding box and recognize every chinese words which we extracted.

Li-Wei Hsiao 12 Jul 21, 2022
Visualizing lattice vibration information from phonon dispersion to atoms (For GPUMD)

Phonon-Vibration-Viewer (For GPUMD) Visualizing lattice vibration information from phonon dispersion for primitive atoms. In this tutorial, we will in

Liangting 6 Dec 10, 2022
Implement of homography net by pytorch

HomographyNet Implement of homography net by pytorch Brief Introduction This project is based on the work Homography-Net: @article{detone2016deep, t

ronghao_CN 4 May 19, 2022
NU-Wave: A Diffusion Probabilistic Model for Neural Audio Upsampling

NU-Wave: A Diffusion Probabilistic Model for Neural Audio Upsampling For Official repo of NU-Wave: A Diffusion Probabilistic Model for Neural Audio Up

Rishikesh (ऋषिकेश) 38 Oct 11, 2022
A Fast Sequence Transducer Implementation with PyTorch Bindings

transducer A Fast Sequence Transducer Implementation with PyTorch Bindings. The corresponding publication is Sequence Transduction with Recurrent Neur

Awni Hannun 184 Dec 18, 2022
CZU-MHAD: A multimodal dataset for human action recognition utilizing a depth camera and 10 wearable inertial sensors

CZU-MHAD: A multimodal dataset for human action recognition utilizing a depth camera and 10 wearable inertial sensors   In order to facilitate the res

yujmo 11 Dec 12, 2022
[TIP 2021] SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction

SADRNet Paper link: SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction Requirements python

Multimedia Computing Group, Nanjing University 99 Dec 30, 2022
This repository includes the code of the sequence-to-sequence model for discontinuous constituent parsing described in paper Discontinuous Grammar as a Foreign Language.

Discontinuous Grammar as a Foreign Language This repository includes the code of the sequence-to-sequence model for discontinuous constituent parsing

Daniel Fernández-González 2 Apr 07, 2022
Churn-Prediction-Project - In this project, a churn prediction model is developed for a private bank as a term project for Data Mining class.

Churn-Prediction-Project In this project, a churn prediction model is developed for a private bank as a term project for Data Mining class. Project in

1 Jan 03, 2022
A basic implementation of Layer-wise Relevance Propagation (LRP) in PyTorch.

Layer-wise Relevance Propagation (LRP) in PyTorch Basic unsupervised implementation of Layer-wise Relevance Propagation (Bach et al., Montavon et al.)

Kai Fabi 28 Dec 26, 2022
Assessing the Influence of Models on the Performance of Reinforcement Learning Algorithms applied on Continuous Control Tasks

Assessing the Influence of Models on the Performance of Reinforcement Learning Algorithms applied on Continuous Control Tasks This is the master thesi

Giacomo Arcieri 1 Mar 21, 2022