quantlab.dataset.sharadar.tables.split_basis_change#

quantlab.dataset.sharadar.tables.split_basis_change(rows, splits, *, source, target)[source]#

Return rows with _basis: the factor taking a split-adjusted value from one pull’s basis to another’s.

A value of a row dated date, adjusted for the splits a pull on day source had applied, times _basis is the same value adjusted for those a pull on day target had applied. A pull has every split effective before its day and none on it or later (pull_day), so _basis is the product of the security’s splits after the row’s date that the source pull had and the target pull had not (effective on or after target and before source), over that of the ones the target had and the source had not; 1.0 for a row no split falls between. A target of the row’s own date gives the value as paid on that day.

Parameters:
rowspl.DataFrame

Rows with permaticker, date and the two day columns named by source and target.

splitspl.DataFrame

The splits, permaticker, date and value (new shares per old share).

source, targetstr

The columns holding the two pulls’ days.

Returns:
pl.DataFrame

rows with a _basis column.

Examples

A dividend on 2026-09-30 of a security that split 1:10 on 10-06, given by ACTIONS pulled on 10-16 (on the new basis), to the basis of SEP’s row of the day, pulled on 10-05:

split_basis_change(rows, splits, source="_dividend_pulled", target="_price_pulled")  # _basis 0.1