Stock Portfolio Rajsi Traders is a small firm that has launched a platform where it will display a few stocks which is for working employees. In their platform, they have a few stocks mentioned which you can add to your portfolio and it will also generate the “Profit/Loss” scenario based on the market price and current stock price. They have given this project to you to create the backend of the platform and help them generate the relevant prices.
What is the Stock portfolio Platform? The user can see 6 most relevant stocks on the platform. To move ahead, they need to add at least 4 stocks in their portfolio first. While adding the stocks, the user also needs to mention the quantity of the stocks they wish to purchase. Once added, it will generate the Market Price and Bought At price automatically.
Once you have added all the stocks, the user can see their “Stock Portfolio” When the user clicks “View Returns” for each stock, they will be able to see the return for each stock they have added in their portfolio. Return = (marketPrice - boughtAt) * quantity Now, the user will need to calculate the return percentage based on the returns they received which will be: returnPercentage = (returns / boughtAt) * 100 After calculating the Return Percentage, the user can now see the “Status” of their stock portfolio for each stock Profit or Loss And at the end, the user can see their cumulative result of the portfolio Total Returns Total Growth