Inspiration
The inspiration behind the team's design came from recognizing the amount of time investors and asset managers spend exhaustively picking apart financial reports of public companies in the hopes of extracting relevant information. These time consumptive challenges prompted the team to automate this process to allow investors to explore more stocks and opportunities, and to help them improve the efficiency of their processes. QuAlpha hopes to eliminate the time-consuming nature of acquiring alpha and increases opportunity generation for investors. The project contributes to the growing presence of AI in finance and investing, helping to streamline investment operations.
What it does
- Pulls relevant financial data as text from earnings reports: "the year 2022 estimates a net revenue of $50 million"
- Remove stop words (words that dont take away from the context of the sentence when removed): "year 2022 net revenue $50 million"
- Apply POS (part-of-speech) tags to each word within the text: {(year, YEAR), (2022, NUMBER), (net, TOTAL), (revenue, REVENUE), ($50, FIGURE), (million, AMOUNT)}
- Apply regular expression to sort for desired data: YEAR*NUMBER TOTAL*REVENUE*FIGURE*AMOUNT
- Turn output into data structure and us it to calculate investment decision
The design starts by parsing through databases for specific sentiments and data from a company’s financial records throughout multiple yearly quarters. The QuAlpha software then executes a natural language processing algorithm that automatically adapts to specific writing styles to extract useful financial investment indicators. Such indicators include data on total revenue growth, total revenue, gross margin, and diluted earnings per share within the company’s quarterly guidance for the upcoming fiscal year. It removes filler words, performs part-of-speech tagging, filters according to regular expressions, and formats the data in a clear and consistent manner. The resultant data structure is then used as input for a performance prediction algorithm that advises users whether they should buy, sell, or hold the company’s stock. Users can view the raw data predictions for each financial category throughout the years as well as the change in the data predictions overtime. The final investment recommendation can be viewed within QuAlpha’s graphical user interface.
How we built it
QuAlpha is built by implementing functions from NLTK libraries for natural language processing, numpy and matplotlib for graphically representing the data, BeautifulSoup for retrieving text from HTML files, and tkinter for user interface creation. The quantitative algorithm is based on the growth rates from year to year of the mentioned financial data, and conditional operands were implemented to identify specific combinations of values to determine whether to buy, sell or hold the stock. The user interface has button to run the algorithm based on provided company stock symbol as input, as well as a drop down to toggle between raw data, and calculated growth rate data. The final investment advisement for the next fiscal year is displayed in bold styling at the bottom of the interface.
Challenges we ran into
There were some challenges connecting members’ individual code components into one final product. For example, the formatting of the raw extracted data from the AI model was not a suitable input for the quantitative algorithm as it didn’t follow the same data structure and had excess surrounding characters that needed to be removed. The team overcame this hurdle by making a bridging algorithm that converted the data structures. Another setback the team faced was that Google collab couldn’t execute code from the tkinter library. Furthermore, acquiring text using the BeautifulSoup library took longer than expected to execute, which reduced the number of tests the team could perform.
Accomplishments that we're proud of
The natural language processing algorithm for capturing financial sentiment is 100% accurate with the companies it was trained for. When testing past financial data to see what the algorithm would predict against the prices of the stock at any instantaneous time, our algorithm was approximately 85% accurate. For this being the team’s first time participating in a hackathon, we are very proud of how we were able to successfully complete our algorithms and UI in the limited scope and time.
What we learned
The team learned how to accurately and efficiently capture and segment unique, human-written text to extract data and sentiment. The material extracted was crucial in predicting the performance of a specific stock, allowing us to learn how specific financial data influences stock pricing. This is the teams first time implementing AI in a hackathon environment, prompting us to pursue the OTPP: Best Beginner Innovative Hack. We believe that QuAlpha solves a complex business problem: the exhaustive nature of reading endless financial data, limiting an investor or investment firms' ability to identify and execute on alpha-rich opportunities. QuAlpha solves this problem as it can extract all the important information and metrics to present it to a user in a fraction of the time, requiring minimal interaction.
What's next for QuAlpha
The next steps for QuAlpha are to expand the range of financial data that is captured by the Natural Language Processing algorithm to supply our quantitative algorithm with more expansive and thorough data, allowing it to make more consistent, well-informed decisions. The team would also like to expand the number of companies that can accurately be targeted by our AI, to expand the universe of stocks we are able to analyze.
Built With
- ai
- beautiful-soup
- electronic-data-gathering-analysis-retrieval
- financial-modelling
- google-collab
- matplotlib
- natural-language-processing
- nltk
- numpy
- python
- quantitative-finance
- ui-design
- us-securities-and-exchange-commission
Log in or sign up for Devpost to join the conversation.