gitwtfhub

wtf is form4lab?

bagoldbe/form4lab — explained in plain English

Analysis updated 2026-05-18

6PythonAudience · researcherComplexity · 3/5Setup · moderate

TL;DR

A self-hosted research tool that collects public insider stock trades, scores the traders, and lets you backtest and paper trade strategies based on them.

Mindmap

mindmap
  root((form4lab))
    What it does
      Collects Form 4 filings
      Scores insiders
      Backtests strategies
    Tech stack
      Python
      Docker Compose
      PostgreSQL
    Use cases
      Insider trading research
      Strategy backtesting
      Paper trading via Alpaca
    Audience
      Researchers
      Developers
      Serious investors
    Setup
      SEC identity required
      Docker or local Python
      Paper trading optional

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Research whether public insider stock trades predict future stock performance.

REASON 2

Backtest a custom trading strategy against historical Form 4 filings.

REASON 3

Paper trade a signal-based strategy risk free through Alpaca's simulated brokerage.

REASON 4

Score and rank company insiders by their historical trading track record.

What's in the stack?

PythonDockerPostgreSQLSQLiteSQLAlchemy

How it stacks up

bagoldbe/form4labaclark4life/home-depot-crawlashishdevasia/ha-proton-drive-backup
Stars666
LanguagePythonPythonPython
Last pushed2014-08-10
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/52/5
Audienceresearcherdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Docker Compose or Python 3.11+, plus a required SEC_IDENTITY environment variable for API access.

Wtf does this do

form4lab is a research tool built around one question: when company executives and directors trade their own company's stock, does that trading tell you anything useful? By US law, these insiders must publicly report their trades to the SEC within a few business days on a document called a Form 4. This is the legal, disclosed kind of insider trading, not the illegal kind reported in the news. form4lab automatically collects these Form 4 filings, stores them in a database, and scores the insiders behind them based on their track record. You can then test trading ideas against this historical data through a built in backtester, and optionally run those ideas on a simulated brokerage account using fake money, so nothing real is ever at risk unless you choose to enable it. The project ships with a few simple example strategies to learn from, but it is upfront that these are illustrative only and not expected to make money after costs. Building an actual working strategy is left up to the user. The maintainers are clear this is educational software, not investment advice. Setup uses Docker Compose, running a database, a web dashboard, and a background scheduler that keeps pulling in new filings and updating scores. There is also a path to run it locally with Python 3.11 or newer instead of Docker. Either way, you need to supply an identifying name and email address, since the SEC requires this on every request to its data system. If you want to act on the signals automatically, form4lab connects to Alpaca, a US brokerage that offers free paper trading, letting you watch a full signal to order pipeline play out with simulated money before ever considering real funds. This makes form4lab useful for developers, researchers, or serious individual investors who want to explore insider trading patterns rigorously rather than by gut feeling, while keeping the option to stay purely in research mode with no brokerage connected at all.

Yoink these prompts

Prompt 1
Help me set up form4lab locally with Docker Compose and pull Form 4 data for AAPL.
Prompt 2
Show me how to write a custom trading strategy module for form4lab.
Prompt 3
Explain how form4lab's backtester avoids look-ahead bias in its results.
Prompt 4
Walk me through enabling Alpaca paper trading with form4lab safely.

Frequently asked questions

wtf is form4lab?

A self-hosted research tool that collects public insider stock trades, scores the traders, and lets you backtest and paper trade strategies based on them.

What language is form4lab written in?

Mainly Python. The stack also includes Python, Docker, PostgreSQL.

How hard is form4lab to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is form4lab for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.