Other Microstructural Features¶
This module implements features from Advances in Financial Machine Learning, Chapter 18: Entropy features and Chapter 19: Microstructural features.
Note
Underlying Literature
The following sources elaborate extensively on the topic:
Advances in Financial Machine Learning, Chapter 18 & 19 by Marcos Lopez de Prado.
Message Encoding¶
Entropy is used to measure the average amount of information produced by a source of data. In financial machine learning, sources of data to get entropy from can be tick sizes, tick rule series, and percent changes between ticks. Estimating entropy requires the encoding of a message. The researcher can apply either a binary (usually applied to tick rule), quantile or sigma encoding.
Second and Third Generation Features¶
When bars are generated (time, volume, imbalance, run) researcher can get inter-bar microstructural features: Kyle/Amihud/Hasbrouck lambdas, and VPIN.
Features Generator¶
Some microstructural features need to be calculated from trades (tick rule/volume/percent change entropies, average tick size, vwap, tick rule sum, trade based lambdas). MlFinLab has a special function which calculates features for generated bars using trade data and bar date_time index.
Implementation¶
Example¶
Research Notebook¶
The following research notebooks can be used to better understand labeling excess over mean.
Presentation Slides¶
Note
pg 1-14: Structural Breaks
pg 15-24: Entropy Features
pg 25-37: Microstructural Features