Skip to content

Monetize.ai is a web-based chatbot that provides personalized investment advice using GPT-3.5 and Yahoo Finance API. It's built using Flask, SQLite, HTML, CSS, JavaScript, Bootstrap, and jQuery. The project is open-source and welcomes contributions.

KhanhHua2102/Monetize.ai

Repository files navigation


Logo

Monetize.ai

Financial Chat Bot Advisor Project for Agile Web Development - CITS3403 unit at UWA 2023
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. Contact
  7. Acknowledgments

Project Screenshot

About The Project

Monetize.ai is a web-based chat bot application that utilizes the GPT-3.5 and Davinci_003 language model and integrates with the Yahoo Finance, Alpha Vantage and Finnhub API to crawl financial data such as stocks and cryptocurrencies.

The main objective of this project is to provide users with a personalized financial advisory service that can help them manage their investment portfolios in an efficient and effective manner. The targeted users are people who works in the financial industry and have a good understanding of the financial market. The application is also suitable for people who are interested in investing and want to learn more about the financial market. Users can declare their investment portfolios to the chat bot and receive advice on how to balance their portfolios using modern portfolio theory. The chat bot can also calculate profits/losses and provide other useful metrics related to the user's portfolio. All of the user's portfolio data is stored in the Portfolio section for future reference.

The application is built using Flask, a popular Python web framework, and the SQLite database for efficient and scalable data storage. The client-side rendering is done using HTML, CSS, JavaScript, and Bootstrap, making it easy to use and accessible across different devices.

The repository is organized into several modules, each responsible for a specific aspect of the application. The main module is the chat bot itself, which handles user queries and provides advice based on the user's portfolio data. Other modules include the Yahoo Finance API integration, database management, and modern portfolio theory calculations.

Monetize.ai is an open-source project, welcoming contributions from developers who want to improve its functionality and features. The repository includes comprehensive documentation to assist developers in getting started with the project and contributing code. An active community of developers and users is available to provide support and guidance on using the application effectively.

(back to top)

Built With

  • Flask
  • SQLite
  • Bootstrap
  • JQuery

(back to top)

Getting Started

Prerequisites

  • python 3.8 or newer

Installation

Running the app locally by cloning the Github repo

  1. Get a free OpenAI API Key at https://platform.openai.com/account/api-keys

  2. Clone the repo

    git clone https://github.com/KhanhHua2102/CITS3403-Project.git
  3. Enter your OpenAI API in config.py

    const API_KEY = 'ENTER YOUR OPEN_AI API';
  4. Create a virtual environment for python:

    python3 -m venv env

    Then activate the virtual environment:

    On Window:

    env\Scripts\activate.bat

    On Mac/Linux:

    source env/bin/activate
  5. Install the requirements for the app:

    pip install -r requirements.txt
  6. Activate the virtual environment again

  7. Run the app on your local host:

    flask run

This will run the Flask app on your local host, typically http://127.0.0.1:5000.

Running the app locally by using Docker

  1. Pull the docker image from Docker Hub:
    docker pull khanhhua2102/monetize.ai
  2. Run the docker image:
    docker run -p 5000:5000 khanhhua2102/monetize.ai

This will run the Flask app on your local host, typically http://127.0.0.1:5000.

(back to top)

Usage

Sign Up and Login

The Sign Up and Login process is a fundamental part of user authentication on a website. Users begin by visiting the Sign Up page, where they provide their email address and choose a password. Using Flask WTF, the Sign Up form can enforce validations to ensure the email address is valid and not already registered. Password hashing techniques, such as those provided by Flask or libraries like Werkzeug, can be applied to secure the password before storing it in the database.

After successfully signing up, users can proceed to the Login page. Here, they enter their registered email and password to access their account. Flask WTF can validate the login credentials and authenticate the user. Once authenticated, the website can keep track of the user's session, allowing them to access protected pages and personalized features.

To enhance security, it is essential to store passwords in a hashed form rather than in plain text. Hashing algorithms like bcrypt or SHA-256 can be used to convert the password into a fixed-length string of characters that cannot be easily reversed. This way, even if the database is compromised, the actual passwords remain secure.

Overall, the Sign Up and Login process ensures that users can create an account securely and access their personalized information. Validations, password hashing, and user database management play vital roles in safeguarding user data and maintaining the integrity of the website.

Interacting with the Chatbot

You can interact with the Monetize.ai chatbot by sending it messages through the chat interface. The chatbot understands a variety of finance-related questions and commands. Here are a few examples:

General Questions:

Ask the chatbot broad questions about investing strategies, financial concepts, and stock markets.

You: What are some common investing strategies?

Bot: There are many different investment strategies, including value investing, growth investing, income investing, and momentum investing. Each strategy has its own unique approach to selecting investments and managing risk. It's important to do your research and choose a strategy that aligns with your financial goals and risk tolerance.

Update Your Portfolio:

Tell the chatbot when you buy or sell stocks by providing details like the stock ticker, number of shares, date, and price. The chatbot will update your portfolio and provide metrics like profits/losses.

You: I bought 200 shares of Apple (AAPL) on 01/02/2020 at $300 per share.

Bot: Based on the information you provided, if you had purchased 200 shares of Apple Inc. (AAPL) on 01-02-2002 at a start price of $0.44 and sold them on 04-05-2023 at an end price of $167.45, you would have made a profit of $33,402.00. This is a significant return on investment, and it's important to note that past performance does not guarantee future results. It's always a good idea to diversify your investments and consult with a financial advisor before making any investment decisions.

Rebalance Your Portfolio:

Ask the chatbot to rebalance your portfolio using modern portfolio theory. It will adjust the weights of your stock holdings to match your desired risk tolerance.

You: Can you rebalance my portfolio?

Bot: Sure, I'd be happy to help you rebalance your portfolio. Based on your current holdings, a moderate risk tolerance portfolio would consist of approximately 40% AAPL, 30% AMZN, and 30% TSLA. To achieve this, you would need to sell some of your TSLA shares and buy more AAPL and AMZN shares. Specifically, you would need to sell 50 TSLA shares and buy 67 AAPL shares and 33 AMZN shares. This would bring your portfolio to a target allocation of approximately 40% AAPL, 30% AMZN, and 30% TSLA. Please note that this is just a suggestion and you should always consult with a financial advisor before making any investment decisions.

Get a stock price target:

Ask the chatbot for a price target for a specific stock.

You: What is the price target for AAPL?

Bot: The current price target for AAPL is $178.88.

Ask for Recommendations:

Inquire about stocks you are interested in or request general stock recommendations, the recommendation is based on analysts either buy, hold or sell the stock.

You: Please give me stock recommendation of Tesla.

Bot: Based on the latest analyst recommendation for TSLA, it seems that there are more "Buy" and "Strong Buy" recommendations than "Hold" and "Sell" recommendations. However, it's important to note that past performance does not guarantee future results and it's always important to do your own research and consult with a financial advisor before making any investment decisions.

Change your risk tolerance:

Ask the chatbot to change your preferred risk tolerance to either low, moderate, or high.

You: Please change my risk tolerance to high.

Bot: Hello Quang Khanh Hua, I am happy to inform you that your risk tolerance has been updated. Is there anything else I can help you with?

Reset portfolio data:

Ask the chatbot to reset your portfolio data. This will clear your portfolio data.

You: reset portfolio

Bot: Your portfolio has been reset.

Reset chatbot context data:

Ask the chatbot to reset your context data.

You: reset

Bot: Chatbot's context data cleared.

Settings

  • Display user’s informations
  • Change user’s information (coming soon)
  • Upload profile picture (coming soon)
  • Change to Dark mode (coming soon)

History

  • User can search for old conversations using keywords
  • Depending on the keyword searched either previous user message (if keyword is found inside the bot's reply) or next bot message (if keyword is found inside the user's message)
  • Able to select the number of pages they can see at one time (coming soon)
  • The message box will change depending on the message inside (coming soon)

(back to top)

Roadmap

  • Change user’s information in settings page
  • Upload profile picture
  • Change to Dark mode
  • Create a base legit financial knowledge for more accure chatbot answers
  • More features comming soon..

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Quang Khanh Hua (Henry)

Yin Min Aung (Ivan)

Hoang Long Nguyen

(back to top)

Contact

Quang Khanh Hua - henry@khanhhua2102.com

linkedin-shield

(back to top)

About

Monetize.ai is a web-based chatbot that provides personalized investment advice using GPT-3.5 and Yahoo Finance API. It's built using Flask, SQLite, HTML, CSS, JavaScript, Bootstrap, and jQuery. The project is open-source and welcomes contributions.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published