The program allows users to create and manage their stock portfolios, buy and sell stocks, and track their portfolio performance. The program uses various data structures such as structs, linked lists, and binary search trees to store and manipulate user and stock information. The main data structures used in the program are:
Stock: A struct that holds information about a stock, including symbol, name, purchase price, quantity, and historical prices. PortfolioList: A binary search tree that stores the user's portfolio, where each node represents a stock. User: A struct that holds information about a user, including their name, portfolio, and various portfolio statistics.
The program provides the following functionalities:
Create a new user Add a stock to a user's portfolio Find a stock by symbol Calculate the total value of a user's portfolio Display a user's portfolio Remove a stock from a user's portfolio Update stock information Display stock quantity histogram Sell stocks Calculate Return on Investment (ROI) Calculate Capital Gains Tax Calculate standard deviation of stocks Manage portfolio risk based on standard deviation and user's risk threshold
The program also includes various helper functions for managing data structures, performing calculations, and handling user input.