quantlab.dataset.sharadar.tables.split_basis_change#
- quantlab.dataset.sharadar.tables.split_basis_change(rows, splits, *, source, target)[source]#
Return
rowswith_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 daysourcehad applied, times_basisis the same value adjusted for those a pull on daytargethad applied. A pull has every split effective before its day and none on it or later (pull_day), so_basisis 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 aftertargetand beforesource), over that of the ones the target had and the source had not; 1.0 for a row no split falls between. Atargetof the row’s own date gives the value as paid on that day.- Parameters:
- rowspl.DataFrame
Rows with
permaticker,dateand the two day columns named bysourceandtarget.- splitspl.DataFrame
The splits,
permaticker,dateandvalue(new shares per old share).- source, targetstr
The columns holding the two pulls’ days.
- Returns:
- pl.DataFrame
rowswith a_basiscolumn.
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