Market Data & Web Scraping Intermediate

NSE EOD Bhavcopy Delivery Percentage (>60%) & Volume Accumulation Scanner in Python

Scan NSE End-of-Day (EOD) stock data in Python Pandas to filter institutional delivery accumulation where Delivery Percentage exceeds 60% with 2x Delivery Volume.

#pandas#numpy

Problem Statement

Intraday speculative volume often reverses the next day, whereas a spike in cash-market Delivery Volume (shares actually settled into demat accounts > 60%) signals genuine institutional accumulation.

Formula / Core Logic

Deliv_Vol_Ratio = Deliv_Qty / SMA(Deliv_Qty, 20) Accumulation_Flag = (Deliv_Pct >= 60.0) & (Deliv_Vol_Ratio >= 2.0) & (Close_Chg_Pct > 1.0)

Installation

pip install pandas numpy
nse-bhavcopy-delivery-percentage-volume-breakout-scanner-python.py
import pandas as pd
import numpy as np

def scan_delivery_accumulation(df, window=20, min_deliv_pct=60.0, min_deliv_mult=2.0):
    # Expected cols:Close, Traded_Qty, Deliverable_Qty
    df = df.copy()
    df['Delivery_Pct'] = ((df['Deliverable_Qty'] / df['Traded_Qty']) * 100.0).round(2)
    avg_deliv = df['Deliverable_Qty'].rolling(window).mean().shift(1)
    df['Deliv_Spike_Mult'] = (df['Deliverable_Qty'] / avg_deliv).round(2)
    df['Price_Chg_Pct'] = (df['Close'].pct_change() * 100.0).round(2)
    
    df['Institutional_Accumulation'] = np.where(
        (df['Delivery_Pct'] >= min_deliv_pct) & (df['Deliv_Spike_Mult'] >= min_deliv_mult) & (df['Price_Chg_Pct'] > 1.0),
        1, 0
    )
    return df

Get the Complete 100+ Python Quant & Automation Bundle

Instant lifetime access to all production-ready scripts, valuation models, and trading bots ($19).

Buy Full Bundle on Gumroad ($19) →

Frequently Asked Questions

Q: Why compare today's Deliverable Qty against its 20-day average instead of just checking Delivery % > 60%?

Illiquid stocks can show 80% delivery on tiny volume; requiring 2x the 20-day average deliverable quantity confirms heavy institutional buying.