quantlab.dataset.bad_prints#
Several datasets merged into one panel, with their bad prints masked (#223).
A bad print is a vendor’s wrong price for one bar: Sharadar SEP holds
closes of $0.01 between two of $7 and $9 (CNYD on 2009-06-19), a one-bar
return of -99.9% and then +89,900% that flows into every return-based statistic. It
can only be told from a real crash or jump by what is known at the bar,
since the price returning the next bar is not known live:
quantlab.dataset._support.cleaning.bad_print_mask flags a move of more
than jump times on ordinary volume.
BadPrintMaskedDataset is a MergedDataset whose panel has the price
variables of a flagged bar set to NaN, so the returns into and out of it are
missing. Give it to a consumer in place of the merged dataset (the factor
risk model and the Barra exposures read it in the Sharadar examples); the
stores are never changed, and a consumer given the plain dataset sees every
price.
Classes
A merged view of datasets whose bad prints have no price. |