hudson-and-thames / mlfinlab

MlFinLab helps portfolio managers and traders who want to leverage the power of machine learning by providing reproducible, interpretable, and easy to use tools.
Other
3.97k stars 1.15k forks source link

Mistakes in the Micro-structural Features Documentation #200

Closed Harkishan-99 closed 4 years ago

Harkishan-99 commented 4 years ago

The example that was given at the end of the documentation page https://mlfinlab.readthedocs.io/en/latest/implementations/microstructural_features.html has a couple of things not going right. 1) The usage of whole tick dataset to form the quantile mapping will cause look-ahead bias as we are now computing the quantile based future data for a bar. (I have pointed the usage of full dataset)

2) The example takes the DateTime Index of the bars and puts in tick_num_series param of the MicrostructuralFeaturesGenerator class, which is invalid a will output and error. (Highlighted in the below image) microstructure mistakes

It should have been like.

tick_num = compressed_bars.tick_num

proskurin commented 4 years ago

Hi, @Harkishan-99 Thank you very much for your comments! You are absolutely right, we will fix docs bugs in our next release