S&P500 Dashboard
This is my Shiny Dashboard for stocks listed on S&P500. Using R shiny to give a visualized general insight of market and using ARIMA model to analyze risk for a single stock.
Background
When I worked as a trader. I found that it was really inconvenient to do the daily market research because the informationΒ on the mainstream website could be confusing and overwhelming sometime. As a result, it was difficult to find a single website that can give me all the informationΒ that I prefer to use. So, I usually had to check many differentΒ websites at the same time to extract the informationΒ that I was interested in. Even though I successfully finished gathering all informationΒ together, I might not be able to get a big picture of the whole market because there were so many noisesΒ in the information I gathered. So, I made this dashboardΒ which can help me to extract information and do the basic fundamental analysis for me.
Introduction
This is a dashboard for the S&P 500 stock market to give the userΒ a general insight of stock market. And it is based on theΒ R studio Shiny package.Β The main dataset comes from Kaggle. What's more, I useΒ Alpha VantageΒ API to get the price movement of sector ETFs listed on SPDR. In order to process the dataset, I use dplyr and tidyr.Β Besides, in order to visualize market major trend, I also use ggplot2, plotly, word cloud, andΒ googlevis. Then, I use ARIMA model to do price risk analysis. If you are interestedΒ in, this is the link to myΒ Github, and this is the output of myΒ ShinyApp.IO.
App Detail
Word Cloud
Based on web scraping and word cloud visualization, this page can give users the hot words that were discussed on any date that has Nasdaq historical news page. Users only need to copy the URL of Nasdaq news page and paste in the URL input. The word cloud will change automatically.
Main tab
There are four plots on this page. All of them are based on the sector user choose. Following will introduce the details of each plot.
1.Treemap
UsersΒ can choose the date they are interested in by using the date selector in the sidebar.The size of each node is based on the volume of the ETF or stock. And the color means the gain or loss of each ETF or stock. Users can use click on ETF nodes to zoom in and check the stocks that are listed in the selected sector.
2.Barplot and Heatmap
Users can choose the indicator and the sector they are interested in and plot on the bar plot. Both of sector and indicator can be chosen in the sidebar. At the same time, the correlation between each stock and the SPY will be plot as a heat map.
3.Price movement
Users can choose the stock they are interested in and plot them as candlestick on these two plots. Users can also select the two SMA they prefer to use.
Time Series Analysis
Time series analysis for the stock users chose. Using three parameters of ARIMA model to make visualizedΒ model test process. I include basic tests for ARIMA model. They are Box-test and Shapiro-test for the residuals of the model. By default, users can use 200 points to construct the model and use the rest 50 points to test model. The resultΒ of this accuracy test is displayed by using MAPE, MPE etc indicators. Users can choose which they prefer.
Future Improvement
I will make the word cloud can be controlled by using the date in the sidebar after I find a good website which has API or URL that can be parsed by only using a date. I also will include the natural language analysis for the news analysis. For the time analysis part, I will put the result of the optimized model by using auto.arima in R package.