GuideInsider transactions
Six checks before you backtest insider buys
A backtest on insider purchases looks simple: take every Form 4 with a purchase, buy the stock when the filing comes out, sell later. Most of the work, and most of the mistakes, sit in the first step. A Form 4 is written for the SEC, not for a backtest, and several of its details quietly change what your test measures.
These are the six checks we run before any calculation on insider data. Each one names the field in our API that answers it.
1. Use the time of the filing, and check it
The market learns about a trade when the SEC accepts the Form 4, not when the insider traded.
That is filed_at. Why the trade date is the wrong clock is the subject of
an earlier article.
The filing time itself needs a second look. EDGAR's daily archives carry only the date, so the
time of day has to come from elsewhere. The SEC's submissions API has a field
acceptanceDateTime for it, marked as UTC. For a period, part of those values were New York
local time with the UTC marker. Read as UTC, they put a filing 4 or 5 hours too early. In one of
our datasets that affected 38,306 of 339,316 filings. One example is filing
0000950170-25-012600: 19:27:46 New York time in the archive, but 19:27:46 UTC in the API, which is
14:27:46 in New York.
A backtest that buys "five minutes after the filing" then buys hours before the filing existed,
and nothing in the code looks wrong. Two simple checks catch most of it. We treat a filing time
before 6 a.m. Eastern as implausible. And a sample of times compared with the
ACCEPTANCE-DATETIME in the filing's header in the EDGAR archive should match to the second. The
affected values in our data were confirmed against that header and corrected on 20 November 2026
(how we set the time).
2. Decide who counts as an insider
Every reporting person ticks a box: officer, director, 10 % owner or other. A CEO buying with their own money and a fund that crossed 10 % of a company are both "insiders" on the form, but they are not the same kind of buyer. Published research looks at them separately (what the studies found).
role carries the box, and role_detail the job title of an officer. Decide up front which
roles your test uses, and filter on them before you count anything:
curl -s -H "Authorization: Bearer $ALGOUM_API_KEY" \
"https://api.algoum.de/v1/insider/transactions?ticker=AAPL&side=buy" \
| jq '.data[] | select(.role == "officer" or .role == "director")'side=buy only ever returns transaction code P, a purchase on the open market. Grants
(A), option exercises (M) and gifts (G) are not decisions to buy, and they never appear
as buys.
3. Count trades, not rows
One purchase can appear several times in raw EDGAR. A joint filing by a fund, its general partner and the person behind them lists the same trade once per reporter. Shares held through several vehicles, such as a trust and a direct holding, are reported once per vehicle and look like duplicates.
We report a joint trade once and list everyone in reporting_owners. Rows that differ by
holding vehicle stay separate rows, and ownership_detail names the vehicle. For a signal,
group by filing_id, so one filing is one event, and decide whether you want the first filing
per stock and day or every filing.
4. Don't count corrections as new buys
A Form 4/A corrects an earlier filing, sometimes months later. It has its own filed_at, and to
a naive query it looks like a new purchase on that day. form_type tells originals (4) from
amendments (4/A), and original_filed_on gives the date of the filing being corrected.
For an entry signal, form_type=4 is usually what you want. An amendment can still matter, for
example when it changes the number of shares, but it is not the moment the market first learned
about the trade (how we handle amendments).
5. Treat a missing price as missing
When a trade was executed in several parts at different prices, the filing often states a
weighted average in a footnote, or no price at all. A price can also be in a currency other than
dollars. Our price is null when the filing states none, never 0, and its currency is read
from the footnotes (prices and currencies).
A zero price silently turns a purchase into a free trade. If your test sizes or filters on the
insider's price, drop or flag null prices explicitly.
6. Ask what was known at the time
Some signals combine several filings, such as three insiders buying within a week. Computed on
today's data, such a cluster can include a filing that arrived after the day you pretend to
trade. /insider/cluster-buys takes as_of, which computes the clusters as they looked at the
end of a past day, and returns sec_known_at, the filing time at which the cluster first met
the threshold:
curl -s -H "Authorization: Bearer $ALGOUM_API_KEY" \
"https://api.algoum.de/v1/insider/cluster-buys?window=7d&min_insiders=3&roles=officer,director&as_of=2025-03-14"Enter no earlier than sec_known_at (the cluster-buy rule).
One more thing the filing cannot tell you
The six checks fix the data side. A filing tells you when you could have acted, not what you would have paid. Price the entry at the quote you could have traded at, not at the first trade after the filing time, and compare your simulated fills with real ones before you trust a result.
A worked example that applies these checks end to end, as a Jupyter notebook with code, is in our examples repository on GitHub.
Sources
- SEC, Forms 3, 4 and 5 and their general instructions: https://www.sec.gov/files/forms-3-4-5.pdf
- SEC, EDGAR application programming interfaces, including the submissions API: https://www.sec.gov/search-filings/edgar-application-programming-interfaces
- How algoum derives
filed_at: Methodology - Amendments, prices and currencies, the cluster-buy rule: Methodology
- Fields and parameters: API reference