top of page

Building a Stock Screening and Ranking Tool

Undertake the python-finance-groundbreaking project "Building a Stock Screening and Ranking Tool" to revolutionize stock selection and analysis, enhancing your Python skills and enabling you to think like a true programmer.


Python is becoming increasingly popular in the field of finance due to its versatility and powerful libraries. One of the most common tasks in finance is screening stocks to find the most promising ones to invest in. A stock screener is a tool that allows you to filter stocks based on various criteria such as price, market capitalization, industry sector, and more.


In this project, you will build a stock screener that will calculate various statistical measures such as mean return, standard deviation, beta, Sharpe ratio, and more to help investors to make informed decisions about which stocks to invest in.


Prerequisites

Module 1: Data Analytics

Financial Books: Exploring Pandas Data Series From Basics | Slicing and Dicing Data with Pandas

Lectures: Pandas Data Series – Part 1 | Pandas DataFrames – Part 1 | Part 2

Module 2: Data Analytics

Financial Books: Exploring Pandas Data Series From Basics | Slicing and Dicing Data with Pandas

Lectures: Building Block 1.0 - Python for Finance | Historical Time-Series Data & Equity Shocks

Module 3: Statistical & Quantitative Techniques

Financial Books: The Basics of Standard Deviation: A Simple Guide | Covariance & Correlation: Diversification/Standard

Lectures: Descriptive Statistics – Univariate Analysis | Bivariate Analysis


Project Requirement

Please carefully read the requirements of this project, as they will serve as the foundation for you.

  • You must use the Pandas or yFinance library to retrieve stock data from Yahoo Finance and calculate various statistical measures for each stock in the NIFTY Bank Index.

  • You will then use these statistical measures to rank the stocks in the index and create a stock screener that allows investors to filter stocks based on their preferred criteria.


Your program must calculate the following statistical measures for each stock in the index:

  • Price: the current price of the stocks.

  • Volume: the current trading volume for the stocks.

  • Mean Return: the average daily return of the stocks over a number of years (more than 2 years).

  • Market Return: the average daily return of the NIFTY Bank Index over the same period.

  • Standard Deviation: the standard deviation of the daily returns of the stocks.

  • Downside Deviation: the standard deviation of the negative daily returns of the stocks.

  • Market Standard Deviation: the standard deviation of the daily returns of the NIFTY Bank Index.

  • Correlation: the correlation between the daily returns of the stocks and the NIFTY Bank Index.

  • Active Return: the difference between the Mean Return and Market Return.

  • Tracking Error: the difference between the Standard Deviation and Market Standard Deviation.

  • Beta: the measure of the stocks' volatility relative to the NIFTY Bank Index.

  • Sharpe Ratio: the ratio of the excess return of the stocks' over the risk-free rate to its standard deviation.

  • Sortino Ratio: a modification of the Sharpe Ratio that only considers the downside risk.

  • Treynor Ratio: the ratio of the excess return of the stocks' over the risk-free rate to its beta.

  • Jensen Ratio: the measure of the stocks' performance relative to its expected return.

  • M Squared: the return of a portfolio with the same risk as the market.

  • Information Ratio: the ratio of the Active Return to the Tracking Error.


Here are some functional and non-functional requirements (optional) for the project:

  • Ranking Stocks: the screener can also rank the stocks based on their statistical measures and present the results in a table format.

  • Data Persistence: the programmer can implement data persistence by storing account data in a database or a file to allow users to retrieve their account data even if they close the program or restart their computers.

  • Code Documentation: the programmer should add comments to the code to explain what each method and function does to make it easier for others to understand the code and modify it if needed.

  • Documentation: the programmer should create documentation for the program, including a user manual and a technical documentation guide to make it easier for users and developers to understand how the program works and how to use it.

The result can then be exported to excel to allow users to filter stocks in the index based on their preferred criteria.


Building a Stock Screening

How building a stock screener will help candidates learn Python for Finance?

This project will help candidates learning Python for Finance by providing them with:

  • hands-on experience using Python to analyze stock data and calculate various statistical measures.

  • deep understanding of the concepts such as mean return, standard deviation, beta, Sharpe ratio, correlation, and more, which are fundamental in finance.

  • becoming proficient in using statistical methods to make informed investment decisions and manage risks.

The project's benefits are numerous!

 

Team Collaboration and Selection Requirement:

for this project, candidates have the flexibility to choose their mode of operation:


Standalone Mode: If you feel confident and would like to take on the challenge individually, you're welcome to work on the project as a standalone participant. This will give you an opportunity to showcase your individual strengths and decision-making skills.


Team Collaboration: Alternatively, if you believe that collaboration will enhance the quality and depth of your analysis, you are encouraged to form a team. Collaborative efforts often bring diverse perspectives, leading to richer insights and more comprehensive results.

  • Self-Selection: Candidates are free to select their own teammates. If you already have someone in mind, align with them, and inform the project coordinator of your team composition.

  • Team Size: While there's no strict limit, we recommend teams of 2-3 members for effective collaboration and equitable distribution of work.

  • Commitment Agreement: Ensure that all members of the team are equally committed to the project.

Please note: Whether you choose to work individually or in a team, the assessment criteria will remain consistent. The emphasis will be on the depth of analysis, quality of insights, and presentation of findings.

 

Screen #S004: Statistics

Screen #S004: Statistics

Computation Time: 1 Second

Computational Time Frame

computation time will depend on various factors such as the number of stocks being screened, the lookback Period, and the processing power of the computer running the code.

243 views0 comments

Comments


bottom of page