Other Microstructural Features


This module implements features from Advances in Financial Machine Learning, Chapter 18: Entropy features and Chapter 19: Microstructural features.

Kyle's Lambda

Closing prices in blue, and Kyle’s Lambda in red

Note

Underlying Literature

The following sources elaborate extensively on the topic:

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.

Implementation

Code implementation demo
Code implementation demo
Code implementation demo

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.

Implementation

Code implementation demo
Code implementation demo

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

Code implementation demo

Example

Code example demo

Research Notebook

The following research notebooks can be used to better understand labeling excess over mean.

Notebook demo
Notebook demo

Presentation Slides

../_images/lecture8.png

Note

  • pg 1-14: Structural Breaks

  • pg 15-24: Entropy Features

  • pg 25-37: Microstructural Features

../_images/micro_slides.png