Humans will invest in stocks they believe in and sell stocks they don’t believe in; it only makes sense to be logical when dealing with matters of money and finance. Thus, accurately predicting stock changes requires knowing which companies are currently trending in the public’s favor. What StockAssist brings to the table that is unique to our generation is generating predictions based on social media trends. Older generations may look to news sources to inform them of which stocks to invest in, but this implies a lag of possibly weeks as news sources need to gather their data and edit it before publishing. By the time the news reaches the crowd, its advice may already be outdated. With StockAssist, we cut out this lag entirely and give you the real-time general consensus of how a company stands by data mining and implementing machine learning on social media posts. This will give the most accurate prediction of how stocks will fare, and thus is revolutionary in advising people with their stock investment decisions.

What it does

This web application will take the stock in question and collect all the news, social media, and statistical data about that stock. It will then run this data through our machine learning algorithms to analyze how well the company is doing in the eyes of the public. With this application, the users will only need to check one place to find an aggregated analysis of their stocks from a diverse, real-time generated data set.

How I built it

The first iteration of the application was written in Go. After discovering incompatibility issues with the Azure platform, the application was completely rewritten in javascript using Node.js. The application consists of two main parts the server and client, with each communicating with another through http requests. The server is where all of the heavy data manipulation is conducted. The server receives a query from the client via an HTTP GET request. The server then takes that query and using Twitter’s REST search api finds 1000 tweets that match that query. Then using regular expressions, the server strips and removes all the referenced URLs (in order to make the semantic analysis easier). After the data has been prepared, we perform an analysis of the tweets using semantic analysis tools hosted on Azure. The analysis tool then returns a score based the words used, and from that we generate a confidence statistic. The second part of the application consists of the client. As mentioned beforehand, the client sends a query to the server, and the server in turn returns a summary of the analysis it performed. The client then generates a stock recommendation based on a determining algorithm, displays a rough summary of that data using a pie chart, and gives a confidence statistic. The client was written in the standard HTML5/CSS/JavaScript while reference several other open source libraries for the visuals and the communications.

Challenges I ran into

Developing a web application hosted on Microsoft Azure was our biggest challenge. Initially, our team used Go to develop the back-end of the application; however, Azure never seemed to be compatible with Go. Thus, we had to switch languages, and completely re-write the entire back-end in Node.js. Another challenge we faced along the lines of Microsoft Azure was figuring out the Machine Learning. It was difficult to create training models with the help of different statistics such as chi-squared. We attempted to create an optimal training model on twitter feeds based on binary sentiment analysis. Upon building the training models, it was another challenge to create a predictive experiment based on the optimized training model, and hosting the solution on the web. Although we couldn't get the machine learning algorithm to work, we made great headway in learning this sector of Microsoft Azure.


Despite all the challenges present, we were able to finally implement Microsoft Azure as a web host for our application. Even though we did not completely figure out the Microsoft Azure Machine Learning, we made great progress in learning how to utilize this tool to perform sentiment analysis on twitter feeds. In order to actually create the machine learning, we used a direct approach with sentiment analysis through node.js. On the front-end, we were able to coordinate all the back-end to co-exist with the front-end. The most important accomplishment was to develop the Azure hosting service, along with our web application.

What I learned

This hackathon was full of twists and turns and we definitely learned a lot from it. From how to use Azure to what web frameworks work best with our front end, our general takeaway for this hackathon was to remember to reach out for help. The Microsoft team was immensely effective in mentoring us and helping guide us to reach our goals; it’s been a game changer for us and it’s something we’ll be sure to do in future hackathons.

What's next for STOCKASSIST

We’d love to expand on every aspect of our app. This means we’d love to include more and more social media outlets to better refine our data set, and thus use this to refine our machine learning algorithm as well. We also believe that this app would be effective across more platforms - from mobile to tablets to smart watches. If there’s an influx of negative social media coverage for a particular company, having a mobile app ping our users would be highly effective in helping them save money in the stock market.

Share this project: