Git Product home page Git Product logo

project_3's Introduction

Developing an Investment Portfolio via ChatBot

Table of Contents:

  1. Summary

  2. Data Techniques

  3. ChatBot Development

  4. Conclusion


Run the ChatBot using Streamlit Cloud:

Link to ChatBot --> https://investachatbot.streamlit.app/

Run the ChatBot Locally:

You must download the following packages in order to run the ChatBot:

Run ChatBot:
streamlit run chatbot.py
Python (version 3.9.12):
pip install python==3.9.12
Streamlit-Chat Package (version 0.0.2.1):
pip install streamlit-chat
from streamlit_chat import message
Streamlit Package (version 1.15.2):
pip install streamlit
conda install -c conda-forge streamlit
import streamlit as st
Plotly Package (version 5.9.0):
pip install plotly
conda install -c plotly plotly
import plotly.express as px
import plotly.graph_objects as go

Note: Our team was interested in expanding our previous project: Developing an Investment Portfolio Utilizing Machine Learning

Summary:

A:
  • According to the Rule of 110, the percentage of your retirement portfolio that should be invested in stocks should be calculated by subtracting your age from 110. For instance, if you are 30, this rule suggests that you should allocate 80% of your portfolio to stocks and the rest to other non-stock investments. However, some current investment advice recommends including a small portion, ranging from 1-5%, of cryptocurrency investments in a retirement portfolio. The rest of the portfolio should be divided between investments in bonds and real estate investment trusts (REITs).

    • To enhance our project, we have decided to add in Bitcoin and Ethereum, which are the two largest cryptocurrencies in terms of market cap.

    • Assets chosen to be included in portfolio:

      • Top 25 SP500 Stocks (ranked by marketcap)
      • 10-yr Treasury Bond, 30-yr Treasury Bond
      • Bitcoin, Ethereum
B:
  • Utilize FaceBook's Prophet Forecasting ML Model to forecast adjusted close prices of each asset for the next 30 days.
C:
  • Run Monte Carlo Simulations to also include long-term projections to furthur analyze the portfolio.

Data Techniques:

Data Sources: Yahoo Finance Python Package

  • Stocks [Top 25 SP500]
  • Bonds [10 yr & 30 yr Treasury Yield]
  • Crypto [BTC & ETH]

Gathered 10 years of Historical Data

ChatBot Development:

After doing extensive research on how to create a chatbot via Streamlit & Python, we came across a special streamlit package called streamlit-chat! This package allowed us to create a simple UI that mimics the look and functionality of a chatbot.

ChatBot Main Files:

The chatbot.py file runs the functions located in chatbot_functions.py to produce the necessary results.

Functions in chatbot_functions.py:

  • verifyUserAge

    • verify if the user is old enough to use the application
  • determine_weights

    • determine the portfolio weights based off of the user's age
  • allocate_portfolio

    • allocate the user's investment amount towards each asset class according to the portfolio weights
  • display_portfolio_allocation

    • display a donut chart visualization of the user's portfolio allocation
  • display_forecasts

    • display Prophet Forecasts to the user along with historical prices
  • run_MC_simulation

    • run a Monte Carlo Simulation based on the selected portfolio type

After much deliberation, the team decided to offer three portfolio options for the user to choose from: high risk, low risk, and moderate risk. The chatbot will then create a portfolio with assets that align with the chosen level of risk.

Conclusion:

Our objective in the preceding project was to build a chatbot that could generate an investment portfolio based on particular user inputs. Unfortunately, we were unable to achieve this due to certain knowledge shortages. However, upon learning how to use Streamlit to design easy but stylish user interfaces, we as a team chose to try again to create a chatbot that can generate an investment portfolio for the user using Streamlit & Python.

project_3's People

Contributors

mun-min avatar wdenetsosie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.