quantlab.dataset.sharadar.insiders#
Sharadar insider transactions (SF2) as a daily panel of net shares and value per transaction code, keyed by permaticker.
SF2 holds one row per security line of an insider’s Form 3, 4 or 5. Its
date is the SEC filing date, the day the transaction became public;
transactiondate is earlier (two days at the median). A line is a
non-derivative transaction (securityadcode NA acquired or ND
disposed), a derivative one (DA, DD), or a holding with no
transaction (no transactioncode, N/D), which never counts.
SharadarInsidersDataset places each line at the first SEP trading day
on or after its filing date (never its transaction date) and sums a day’s
lines per security (quantlab.dataset.sharadar.filings.FilingPanelDataset):
net_shares,net_value: open-market trades in the stock, shares and USD bought (P) minus sold (S) on a non-derivative line. The vendor’stransactionvalueis unsigned USD (INDICATORS calls it USD millions, but it equals shares times price), so a sale counts negative.net_shares_<code>,net_value_<code>: the non-derivative lines of one transaction code,P,S,A(grant),M(exercise or conversion),F(tax or exercise price paid in stock),G(gift),D(disposed to the issuer), andotherfor every remaining code.PandSkeep their own sign, as innet_shares; every other code counts positive when acquired (NA) and negative when disposed (ND). A line without a price adds nothing to the value.net_shares_derivative: derivative units (options, units, warrants) acquired minus disposed, every code together.insiders_buying,insiders_selling: the distinct owners (ownername) with a non-derivativePorSline on the day.
A day without a transaction is 0. A transaction is counted on the first
filing that shows it. When an amendment (4/A) restates a filing, it repeats
the lines; a later line repeating one exactly (same insider, transaction
date, code, shares and price, TRADE_KEY, on the same side of the
derivative split) is not counted again. The vendor also relabels the
superseded original RESTATED - <form>, but only once the amendment
arrives, so the label is ignored: a live update, which saw the original as
a plain form on its filing date, and a rebuild of the same days give the
same panel. An amendment that changes a line’s shares or price does not
repeat it, and is counted again on its own filing date.
TICKERS has rows of SF2 (table SF2), so its tickers are mapped
through them. SF2 has no lastupdated; it is refreshed by trailing date
windows (SharadarClient.window_table), and update() appends the new
trading days.
Examples#
Build the store and read the net buying of a quarter:
config = SharadarInsidersConfig(
zarr_file_path="/data/quantlab/market/sharadar/sharadar_insiders_1d/sharadar_insiders_1d.zarr",
raw_data_dir_path="/data/quantlab/downloads/sharadar",
)
SharadarInsidersDataset(config).update()
panel = SharadarInsidersDataset(config).panel("2024-01-02", "2024-03-28")
panel["net_value"].attrs["unit"] # 'USD'
panel["net_shares_M"].attrs["unit"] # 'shares'
Classes
Daily panel of insiders' transactions per code, on each filing's available date. |