Python script for computing ivpin according to "An Improved Version of the Volume-Synchronized Probability of Informed Trading " from Ke et al.
Takes trade data and creates volume bars from "Advances in Financial Machine Learning" by Dr. Lopez de Prado. We then assign a portion of the volume as either buy or sell using the Bulk Volume Classification algorithm, and measure the volume time as the time between the first trade of the current bar and the first trade of the following bar. Using MLE, we find alpha: the probability of information event occurrence, mu: the informed traders’ arrival rate, Epsilon: the uninformed traders’ arrival rate, and Delta: the probability of bad news.