Inspiration

All 3 of us have failed miserably in stock investing due to a lack of knowledge and experience. One sold NVIDIA at its canyon, another invested in clean diesel at the peak of oil, while a third remained optimistic for too long. What if there was an intuitive way to understand risk managed trading methods like options trading? Backed by our new knowledge in CS, DS, and Math we decided to create an engine we wished we had as beginner investors. Tuition isn't cheap.

What it does

Given a stock ticker and the desired option expiration date we calculate an options pricing and profit matrix (visualized in charts) to help the user understand the returns and risks for different option prices.

How we built it

We used various financial APIs like yahoo finance and Alpha Vantage to scrape both current and historical stock prices and company info to help calculate the options matrix. We implemented streamlit in our UI to display our visualizations made with Seaborn. In the backend we implemented the Black Sholes Options Pricing model for European style call options and the Binomial Pricing Model for American style call options (early exercise of options buying) using Scipy, Numpy, and Pandas to help calculate the pricings and profits.

Challenges we ran into

Modern Stock APIs that are free limit our queries to 25 times per day which is nowhere near enough for the bulk of testing and usage that our product requires to be useful. We had to make a bot to try a combination of APIs to meet our query demands. There were also a lot of confusing technical details in the math models that we needed a refresher in differential equations for.

Accomplishments that we're proud of

Getting the models to accurately predict the pricings and profits for the matrix and seamlessly integrating it with the limited information we received from financial APIs.

What we learned

Plan around the APIs and the queries properly! Also it's better to implement some simple strategies well than get bogged down with too many fancy strategies that all don't work properly. Finally we learned to trust each other and patience especially as we struggled into the late AMs.

What's next for Stock Options Calculator

A LLM gen AI recommendation engine. What if you don't know what strategy you want to use much less what they are? You should be able to ask a recommendation engine what strategy to choose based on your investing preferences. We would tokenize and lemmanize your input, assign a sentiment score to how confident you are (how much risk a user is willing to undergo) in an investment if applicable, and link the keywords and scores to different options trading strategies that the model returns (with a brief explanation of the criteria) as a recommendation to the User.

Built With

Share this project:

Updates