This is a simple yet powerful R Project that fetches real-time data, performs analysis, and generates visualizations.
Loading the Required Libraries: I have started with loading the packages that I am going to be using for this analysis like QuantMod and GGPlot2. I will use the getSymbols() function from quantmod to fetch historical stock data. After fetching the live data for the selected stocks, I proceed to calculate some basic metrics like daily returns and moving averages.
Calculating Moving Averages and Daily Returns: I have calculated the 20-day simple moving average and daily returns.
Visualizations:
Line chart: Stock price with 20-day moving average.
Histogram: Distribution of daily returns.
Line Chart of Stock Prices: I have used ggplot2 to visualize the stock prices along with the moving average.
Histogram of Daily Returns:A histogram of the daily returns will give us insight into the volatility of the stock.
Dashboard
APPLE
META
TESLA
TCS
AMAZON
NETFLIX
STARBUCKS
JOHNSON & JOHNSON