Inspiration

From recent events, we’ve seen how social media plays a significant role in the stock market. Platforms such as Twitter and Reddit have largely influenced the trajectory of a stock, with companies such as Gamestop and AMC as prime examples. As avid investors ourselves, we found it difficult scrolling through “cashtags” on Twitter to analyze trends on how the media was feeling about a certain stock: feeds were either blockaded with majority positive or majority negative tweets. Not only was this information skewed, but scraping through Twitter during critical times proved to be time-consuming, which meant missing critical opportunity windows in the fast-moving market. As a response to this issue, we created StockTweets, a platform that displays real-time stock market data and public sentiment all in the same place. We focused on a simple yet informative interface that would be accessible to both newbies and stock market experts.

What it does

StockTweets is a platform that grants users seamless access to important information needed when investing. Users can search for a stock they’re interested in and are given details such as price over time, P/E ratio, etc. Additionally, the platform displays popular tweets and sentiment analysis, so the user can monitor overall public opinion of the stock. StockTweets is especially useful when a user needs to make split-second decisions on whether to buy or sell a stock; this is especially critical in the stock market where windows of opportunity may only be a few minutes long. With these decision-making metrics aggregated on one platform, StockTweets enables traders to analyze metrics for quick, informed decisions while also presenting those newer to investing with easily-digestible information.

How we built it

We used React and HTML/CSS for the frontend and Python for the backend, connecting the two with Flask. In addition, we used the Alpha Vantage API to gather stock summary data and the Twitter API to retrieve tweets related to the stock. After gathering tweets with the Twitter API, we also used Google Cloud’s Natural Processing Library to score each tweet’s sentiment, returning top positive, neutral, and negative sentiments about the stock.

Challenges we ran into

We had trouble connecting the frontend with the backend using Flask. Seamlessly updating StockTweet’s interface once a stock was entered was challenging, since we needed to handle live updates in the form of a graph and also as tweets from real Twitter users.

Accomplishments that we're proud of

Femmehacks either or first or second hackathon, so we’re proud that we were able to create a complete project! We had to stitch together a variety of elements such as the Twitter and Alpha Vantage API to paint a complete picture of a specific stock.

What we learned

It was our first time for a few of us working with Flask and learning how to retrieve requests from the user, so we spent a long time learning how exactly Flask connected the frontend to our backend. Although we’ve had experience working in Python, this was the first time working with APIs for some of us.

What's next for StockTweets

We’ve implemented features such as stock details and Twitter users’ reviews on the stock, but we’re looking into creating a customized portfolio for each user. We would need to work on login credentials, and having a database to store users’ preferred stocks. In addition, we hope to implement ML features such as building a recommendation engine or a price predictor.

Share this project:

Updates