Skip to content

SEC13FHolding

QuantConnect.DataSource.SEC13FHolding

SEC13FHolding()

Bases: BaseData

One position as a single institutional manager reported it on a single SEC Form 13F submission. Managers exercising discretion over at least 100 million dollars must file a Form 13F within 45 days of quarter end, listing the covered securities they hold.

Nothing here is summed or otherwise derived: every field is the value the SEC publishes for that line of that filing's information table. A manager that reports the same security on two lines, which the rules allow when the discretion differs, produces two records, and they are left apart. Holder counts, quarter-over-quarter change and concentration are all derivable from the records of a day and are left to the algorithm.

This is the factory that reads one line. The points an algorithm receives are SEC13FHoldings, the collection of every record a security carries for one filing date.

Creates a new default instance.

FILING_DATE_FORMAT

FILING_DATE_FORMAT: str = 'yyyyMMdd'

Format of the filing date column, which is also the name of the file.

accession_number

accession_number: str

EDGAR accession number of the submission this line was reported on, such as 0001067983-26-000012. It identifies the filing on the SEC's own site and is what groups the records of one submission back together.

manager_cik

manager_cik: int

Central Index Key of the manager that filed the submission. It is the stable identity of a fund across name changes, which is why it, and not the name, is carried on every line of the files. The names live once in managers.csv beside the dataset.

manager_name

manager_name: str

Name of the manager as its most recent cover page states it, read from managers.csv, with any comma taken out because that file is split on every one. It is the current name even on an old filing, and null for a CIK the file does not carry.

period_end

period_end: datetime

The quarter the position is reported for, which is the SEC PERIODOFREPORT. It is carried rather than derived from Time because the two are unrelated: late filings and amendments mean one filing date carries several different reported quarters, and the gap between them runs from zero to years.

form_type

form_type: str

Submission type, which is 13F-HR for a holdings report and 13F-HR/A for an amendment. A 13F-NT notice reports no positions and so contributes no records at all.

amendment_type

amendment_type: str

For an amendment, whether it restates the whole report or only adds holdings. The distinction decides whether the amendment replaces the original filing or supplements it, and the SEC leaves it to the filer to declare. Empty on an original filing.

amendment_number

amendment_number: Optional[int]

Sequence number of the amendment, or null on an original filing.

title_of_class

title_of_class: str

Class of the security as the manager titled it, such as COM or CL A. It is free text that the filer writes, so it varies between managers for the same security.

amount

amount: Optional[float]

Size of the position, which is a number of shares when AmountType is SH and a principal amount when it is PRN. The two are not comparable and are deliberately left in one field with its unit beside it, as the SEC reports them.

amount_type

amount_type: str

Unit of Amount: SH for shares, PRN for a principal amount.

reported_value

reported_value: Optional[float]

Market value of the position exactly as the manager reported it, in the unit the filing used. Before 2023 the SEC asked for thousands of dollars and since then for whole dollars, and filers on both sides of that change ignore the instruction, so the number is published untouched with ValueScale beside it.

value_scale

value_scale: int

The power of ten that turns ReportedValue into whole dollars: 3 for a value stated in thousands, 0 for one already in dollars, and -3 for a line that overstated its value a thousandfold, which happens often enough to matter.

This is the one reading in the record that the SEC does not publish. It comes from the filing's period and from the size of the value against the security's close, because filers disagree with the instruction often enough that the period alone is wrong. It is carried beside the reported number rather than multiplied into it, so that what the manager filed stays readable and this judgement stays separable from it. Use MarketValue to apply it.

market_value

market_value: Optional[float]

Market value of the position in whole dollars. Worked out from ReportedValue and ValueScale rather than carried as a column of its own, so the three can never disagree.

put_call

put_call: Optional[OptionRight]

Whether the position is an option on the security rather than the security itself, and on which side. Null for a holding of the security. An option line states the shares underlying the contracts, not the number of contracts.

investment_discretion

investment_discretion: str

Who exercises investment discretion over the position: SOLE for the filing manager alone, DFND when it is defined by other managers, OTR otherwise.

other_manager

other_manager: str

The other managers that share the position, as the sequence numbers the filing gives them on its cover page, separated by semicolons. Empty when the manager reports alone.

voting_sole

voting_sole: Optional[float]

Shares over which the manager holds sole voting authority.

voting_shared

voting_shared: Optional[float]

Shares over which the manager shares voting authority.

voting_none

voting_none: Optional[float]

Shares over which the manager holds no voting authority.

confidential_omitted

confidential_omitted: bool

True when the submission this line belongs to withheld other positions under confidential treatment. The filing is then incomplete by design and the withheld positions surface in a later one, so the flag is carried rather than silently ignored.

date_reported

date_reported: Optional[datetime]

The date a previously confidential filing was originally made, which the SEC publishes as DATEREPORTED. It is filled on about two filings in a thousand and is null on the rest, so it marks positions that were withheld and later released rather than serving as a timestamp. The timestamp is Time, the filing date.

end_time

end_time: datetime

The record covers the filing date it is stamped with, ending at midnight that night.

LEAN emits a point at its end time rather than at its time, so this is what decides when an algorithm sees the filing: the day's filings all arrive at 00:00 the following day, after EDGAR has finished listing that day at about 22:05 ET. Nothing is readable before it was filed, and a whole day of filings arrives at once instead of trickling in.

REPORT_FOLDER

REPORT_FOLDER: str

Name of the dataset's folder under alternative/sec/, which is where its files live.

symbol

symbol: Symbol

Symbol representation for underlying Security

data_type

data_type: MarketDataType

Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.

time

time: datetime

Current time marker of this data packet.

value

value: float

Value representation of this data packet. All data requires a representative value for this moment in time. For streams of data this is the price now, for OHLC packets this is the closing price.

price

price: float

As this is a backtesting platform we'll provide an alias of value as price.

ALL_RESOLUTIONS

ALL_RESOLUTIONS: List[Resolution] = ...

A list of all Resolution

This Field is protected.

DAILY_RESOLUTION

DAILY_RESOLUTION: List[Resolution] = ...

A list of Resolution.DAILY

This Field is protected.

MINUTE_RESOLUTION

MINUTE_RESOLUTION: List[Resolution] = ...

A list of Resolution.MINUTE

This Field is protected.

HIGH_RESOLUTION

HIGH_RESOLUTION: List[Resolution] = ...

A list of high Resolution, including minute, second, and tick.

This Field is protected.

OPTION_RESOLUTIONS

OPTION_RESOLUTIONS: List[Resolution] = ...

A list of resolutions support by Options

This Field is protected.

is_fill_forward

is_fill_forward: bool

True if this is a fill forward piece of data

clone

clone() -> BaseData

Creates a copy of the instance.

data_time_zone

data_time_zone() -> Any

Data time zone (Eastern, the SEC filing time zone).

default_resolution

default_resolution() -> Resolution

Default resolution.

get_source

get_source(
    config: SubscriptionDataConfig,
    date: datetime,
    is_live_mode: bool,
) -> SubscriptionDataSource

Location of the source file. One zip per security holds one entry per filing date, so that the dataset stays at a file per security instead of the eight and a half million a loose file per date would take. LEAN reads the entry straight out of the zip.

is_sparse_data

is_sparse_data() -> bool

Sparse data: a security is only reported on the days managers file for it.

reader

reader(
    config: SubscriptionDataConfig,
    line: str,
    date: datetime,
    is_live_mode: bool,
) -> BaseData

Parses one line of the file into one reported position.

requires_mapping

requires_mapping() -> bool

Linked to Equities, so renames and delistings are applied via map files.

supported_resolutions

supported_resolutions() -> List[Resolution]

Supported resolutions (Daily only, the quarterly cadence is modeled as Daily).

to_string

to_string() -> str

String representation for debugging.

deserialize_message

deserialize_message(serialized: str) -> Sequence[BaseData]

Deserialize the message from the data server

Parameters:

Name Type Description Default
serialized str

The data server's message

required

Returns:

Type Description
Sequence[BaseData]

An enumerable of base data, if unsuccessful, returns an empty enumerable.

should_cache_to_security

should_cache_to_security() -> bool

Indicates whether this contains data that should be stored in the security cache

Returns:

Type Description
bool

Whether this contains data that should be stored in the security cache.

update

update(
    last_trade: float,
    bid_price: float,
    ask_price: float,
    volume: float,
    bid_size: float,
    ask_size: float,
) -> None

Update routine to build a bar/tick from a data update.

Parameters:

Name Type Description Default
last_trade float

The last trade price

required
bid_price float

Current bid price

required
ask_price float

Current asking price

required
volume float

Volume of this trade

required
bid_size float

The size of the current bid, if available

required
ask_size float

The size of the current ask, if available

required

update_ask

update_ask(ask_price: float, ask_size: float) -> None

Updates this base data with the new quote ask information

Parameters:

Name Type Description Default
ask_price float

The current ask price

required
ask_size float

The current ask size

required

update_bid

update_bid(bid_price: float, bid_size: float) -> None

Updates this base data with the new quote bid information

Parameters:

Name Type Description Default
bid_price float

The current bid price

required
bid_size float

The current bid size

required

update_quote

update_quote(
    bid_price: float,
    bid_size: float,
    ask_price: float,
    ask_size: float,
) -> None

Updates this base data with new quote information

Parameters:

Name Type Description Default
bid_price float

The current bid price

required
bid_size float

The current bid size

required
ask_price float

The current ask price

required
ask_size float

The current ask size

required

update_trade

update_trade(last_trade: float, trade_size: float) -> None

Updates this base data with a new trade

Parameters:

Name Type Description Default
last_trade float

The price of the last trade

required
trade_size float

The quantity traded

required