Member-only story

Calculate Top 20 Stocks By Relative Volume Daily Using Python, Pandas and YFinance

The Scraper Guy
4 min readSep 7, 2024

--

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

--

--

The Scraper Guy
The Scraper Guy

Written by The Scraper Guy

Teaching You How to Scrape Using Python LinkTree - https://linktr.ee/scrapingguy

Responses (3)