Python Project Ideas (Finance & Quantitative Finance) PART 2

As a continuation of the previous post on Python project ideas for Finance, I came up with more beginner-friendly ideas. 

Again, fell free to refer to my YouTube video for a more detailed explanation.

Idea 1: Stock Market Data Visualization

You can use this project to introduce yourself to the stock market concepts such as volatility, moving averages, closing prices, etc.

You can get some arbitrary data on yahoo finance, which is also very conveniently available in a Python module. And just see what you can plot using the matplotlib module.

In this project, the emphasis should be on your understanding of the financial data rather than coding. You can always enhance your project by comparing multiple stocks’ historic performance, spotting the correlation between different days and the stock performance, comparing industries, etc.

Idea 2: Coding a Financial Derivative

This is a project that I did in my Master’s study  (I studied Quantitative Finance at the University of Amsterdam). What we need to do is translate a derivative (in my case it was an option) into Python script to get the option price.

Think of a tree with different nodes. In Python, we convert this tree into a matrix and take the upper triangle of the matrix to portray the nodes. So, the main task is to code the relationship between the nodes starting from the last node, when the payoff can be calculated.

Option tree converted to matrix

How it looks in practice:

  • you need to use the beloved pandas and numpy libraries
  • you treat your option as a function that takes the same parameters as in the formula
  • and you work with two matrices: (1) the tree for pricing the underlying asset; and (2) the tree for pricing the option.

If you want to make it more challenging, you can change the option type from European to American and assume more specific conditions such as a cap or floor for the price after certain periods.

Idea 3: Logistic Regression

This project is also an introduction to data science. If you studied Econometrics, you might recall that as opposed to an OLS regression, Logistic regression is the case where your outcome is in range of [0;1]. And the goal here is basically to get a probability of a certain event.

Linear vs Logistic regression

To work on such a project, you can find a dataset with binary labels for the outcome variable. A very common example would data on mortgage applicants and their financial situation, where the binary outcome is whether they obtained the mortgage YES or NO.

I completed a project on logistic regression with data on billionaires.  Feel free to check out my billionaire’s regression post for step-by-step guidance.

Idea 4: Personal Finance Analytics

In one of my Youtube videos, I was discussing my personal finance management, and I touched upon the idea that you can extract the data on your transactions from your account in the internet bank.

This is a very creative project, as you can decide for yourself what kind of overview, would you want to see. It can be an overview per month, per category, some shocking statistics on how often you visit a grocery store, etc. If you share expenses with your partner, then their try combining your transactions.

This is one of the easiest but most useful projects in my opinion. All you need is your own data and a basic understanding of the pandas module.

Idea 5: Web-scraping for Financial Data

If you are looking to expand your knowledge of data analytics beyond pandas and numpy modules, you can take a look at web scraping which you can do with Python.

The module that is used here is requests. And the easiest way to start with web scraping would be to find a webpage that contains a table. You should try to get this table into a Pandas dataframe by searching for the pattern in which it is stored. For instance, a table would be wrapped in ‘\t’ characters when you extract it using regular expressions.

I worked with this technique at a very basic level, but I managed to use it efficiently for extracting some data on annual reports that I needed for the previous job. This project is also posted here, and it is a very short one and easy to read, so make sure to check it out if you want to start with web scraping.

Leave a Reply

Your email address will not be published. Required fields are marked *