Member-only story
Calculate Top 20 Stocks By Relative Volume Daily Using Python, Pandas and YFinance
Lets take a look at a novel equation to calculate “Stocks In Play” using Python
Introduction
To begin, the inspiration for this tutorial comes from this paper -
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4729284
Without delving too deep into the strategy outlined in this paper, we are going to calculate the “Stocks In Play” for a given day. A stock is defined “In play” if its volume from 9:30–9:35am i.e. the first 5 minutes of trading is greater than 100% of its mean volume over the past 14 days.
This is called relative volume and the mathematical equation is
Relative volume can be a good indicator for stocks which have big catalysts which can lead to huge price increases and therefore are good candidates to trade intraday.
Code Tutorial
We first need to get a csv of stock tickers. I have created a google sheet with around 5k tickers, which can be accessed here