<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys" -->

---
title: A null percentage shouldn't delete a valid row | daily.dev
description: A Python-based insider buying screener handles null holding-change percentages in SEC Form 4 filings without discarding valid purchase rows or fabricating...
canonical: https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A null percentage shouldn't delete a valid row | daily.dev
og:description: A Python-based insider buying screener handles null holding-change percentages in SEC Form 4 filings without discarding valid purchase rows or fabricating...
og:url: https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys
og:image: https://api.daily.dev/og/posts/l2AxwC2ys.png
og:image:alt: A null percentage shouldn't delete a valid row
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A null percentage shouldn't delete a valid row

**[AlphAI](https://daily.dev/sources/alphai)** · [@mikhailmakeev](https://daily.dev/mikhailmakeev) · 1 min read · 1 upvotes · 0 comments

## Summary

A Python-based insider buying screener handles null holding-change percentages in SEC Form 4 filings without discarding valid purchase rows or fabricating values. An example filing shows 204,946 shares bought with 204,946 held afterward, implying a zero starting balance where turning the missing percentage into 0% or 100% would misrepresent the data. The screener filters on transaction code and purchase value while keeping the percentage field optional. It can be run in replay mode using included sample data and original SEC XML files without an account or API key, or live using Python 3.10+ and a free AlphAI API key with rate limits of 20 calls/minute and 100/day, and no package dependencies.

## Content

Fourteen purchases passed the dollar filter in our saved sample. Two had no holding-change percentage, and both stayed in the output.

One SEC Form 4 row reported 204,946 shares bought and 204,946 held afterward. The implied starting balance is zero. Turning that missing percentage into 0% or 100% would invent a result. Filtering out every row with a null percentage would lose the purchase instead.

The Python screener filters on transaction code and purchase value. It keeps the percentage optional. You can reproduce the September 18 capture without an account or API key:

```bash
git clone https://github.com/makeev/alphai-insider-buying.git
cd alphai-insider-buying
python3 insider_buying.py \
  --replay samples/2026-09-18/examples/snapshot.json.gz \
  --out out/daily-example
```

Open `out/daily-example/report.md` or sort `candidates.csv`. Replays make no network requests. The repo includes the original SEC XML files so you can check the examples yourself.

For a live watchlist, Python 3.10+ and an AlphAI Free key are enough: 20 calls/minute and 100/day, with one request per ticker. The script has no package dependencies.

The walkthrough also covers why a filing's direct and indirect holdings need separate event identities, and why transaction dates don't tell you when a filing became available.

https://dev.to/makeev/build-an-insider-buying-screener-with-python-and-sec-form-4-data-4eg1

## Similar posts on daily.dev

- [How to Analyze Insider Transactions with Python: A CEO Buying Case Study](https://daily.dev/posts/how-to-analyze-insider-transactions-with-python-a-ceo-buying-case-study-x6xdahxf3) · freeCodeCamp · 1 upvotes · 0 comments
- [Free Historical Insider Trading and Institutional Holdings Data](https://daily.dev/posts/free-historical-insider-trading-and-institutional-holdings-data-eugvd7fh4) · Medium · 0 upvotes · 0 comments
- [What If You Bought Every Stock That Fell 5% in One Day?](https://daily.dev/posts/what-if-you-bought-every-stock-that-fell-5-in-one-day--kyct5qjny) · Medium · 2 upvotes · 0 comments
- [Count Is Not Risk: Ranking Data Issues by What They Actually Cost](https://daily.dev/posts/count-is-not-risk-ranking-data-issues-by-what-they-actually-cost-esovtfaud) · SQL Authority · 0 upvotes · 0 comments
- [One line of Python, and a 3× drop in p99](https://daily.dev/posts/one-line-of-python-and-a-3-drop-in-p99-9yshjhsge) · Backstage Blog · 1 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#fintech](https://daily.dev/tags/fintech), [#crawling](https://daily.dev/tags/crawling)

[View this post on daily.dev](https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys","headline":"A null percentage shouldn't delete a valid row","text":"A Python-based insider buying screener handles null holding-change percentages in SEC Form 4 filings without discarding valid purchase rows or fabricating values. An example filing shows 204,946 shares bought with 204,946 held afterward, implying a zero starting balance where turning the missing percentage into 0% or 100% would misrepresent the data. The screener filters on transaction code and purchase value while keeping the percentage field optional. It can be run in replay mode using included sample data and original SEC XML files without an account or API key, or live using Python 3.10+ and a free AlphAI API key with rate limits of 20 calls/minute and 100/day, and no package dependencies.","url":"https://daily.dev/posts/a-null-percentage-shouldn-t-delete-a-valid-row-l2axwc2ys","datePublished":"2026-09-20T09:56:14.397Z","dateModified":"2026-09-20T09:56:32.249Z","author":{"@type":"Person","name":"Mikhail Makeev","url":"https://daily.dev/mikhailmakeev","image":"https://lh3.googleusercontent.com/a/ACg8ocIjcvDU1gmJ9-KJDeTYqY2rMdl5QxcWYtLTGSXrj8ubF4nwar_w=s96-c","description":"Owner of alphai.io","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":5500}},"image":"https://media.daily.dev/image/upload/s--O23S-jYU--/f_auto/v1789898174/posts/l2AxwC2ys?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/alphai","name":"AlphAI"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AlphAI","item":"https://daily.dev/squads/alphai"},{"@type":"ListItem","position":3,"name":"A null percentage shouldn't delete a valid row"}]}
```

