Skip to content

Latest commit

 

History

History
108 lines (79 loc) · 3.77 KB

README.md

File metadata and controls

108 lines (79 loc) · 3.77 KB

Interactive Stock Visualizer and Predictor

This project allows you to search for stock prices, visualize the prices as candlestick plot and perform predictions using Machine Learning techniques.

The web development framework used is Django , the interface is in JavaScript and the ChartJs library.

moneyshow_web_page

Features

  • 🔎 Search stock prices using Alpha Vantage or Yahoo Finance
  • 📈 Interactive visualization of stock prices with Chart.js candlestick plot
  • 🔮 Perform stock price predictions with Machine Learning algorithms, using Scikit-learn and XGBoost
  • 🌍 Easy-to-use web interface built with Django

Getting Started

The Docker way

Building and running a Docker container using the give Dockerfile file can be easily performed by using the available scripts:

chmod u+x docker_build.sh && chmod u+x docker_run.sh # give execution rights to the scripts for the current user
./docker_build.sh && ./docker_run.sh

The application will be available at http://127.0.0.1:8000 .

The Docker Compose way

A Datadog Agent is already configured to analyze the application.

  1. Place your precious API KEY in the .env file in the root directory of the project - example:
DD_API_KEY=__your_precious_beloved_datadog_api_key__
  1. Starting the Docker Compose using the given docker-compose.yaml can be easily performed by using the available script:
chmod u+x dockercompose_up.sh # give execution rights to the script for the current user
./dockercompose_up.sh

The application will be available at http://127.0.0.1:8000 . The Datadog Agent traces will be available at Datadog.

The manual way

0. Requirements

  • 🐍 Python 3.10
  • 🔑 Alpha Vantage API key (if using Alpha Vantage for stock prices), get one here
  • 📦 Required Python packages, listed in requirements.txt

1. Clone the Repository

git clone https://github.com/gabripo/moneyshow.git
cd stock-price-visualizer

2. Create a Virtual Environment

It's recommended to use a virtual environment to manage your dependencies.

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

3. Install Dependencies

Install the required Python packages using the requirements.txt file.

pip install -r requirements.txt

4. Configure API Keys

If you're using Alpha Vantage, you'll need to configure your API key 🔑.

  • Create a folder named proj_secrets in the project root directory.
  • Create a __init__.py file in the created folder.
  • Add your Alpha Vantage API key into the __init__.py file:
ALPHA_VANTAGE_API_KEY=your_api_key_here

5. Run migrations

python manage.py migrate

6. Start the Django Server

python manage.py runserver

Usage

1. Search for a stock by symbol

Insert the symbol (ticker) of the stock, then click on "Visualize Stock" to fetch and visualize its data 📈.

You can zoom in the generated graph and reset the zoom with the "Reset Zoom" button above it.

2. Predict stock prices

Select a prediction method from the dropdown menu, then click on "Predict" 🔮.

For the developers

Checkout the repo, open it with Visual Studio Code: debug configurations are there. You know what to do.

Future extensions

  • Use skforecast for time series prediction
  • Real-time data fetching