stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
12.87k stars 4.11k forks source link

Can't print Limit Order Price Distribution #259

Closed BibiTheLamb closed 1 year ago

BibiTheLamb commented 1 year ago

Describe the bug While working with file 02_rebuild_nasdaq_order_book.ipynb, at the very end there's a print of the Limit Order Price Distribution. The graph comes but there are no bars. Code has been correctly executed previously, with no errors.

To Reproduce

Steps to reproduce the behavior:

  1. Run 02_rebuild_nasdaq_order_book.ipynb file
  2. For data, consider Nasdaq file 01302020.NASDAQ_ITCH50.bin
  3. In Buy-Sell Order Distribution section, plotting the graph throws error

Capture d’écran de 2022-09-15 21-29-04

Expected behavior Plot the graph

Environment If you are not using the latest version of the Docker imag:

Additional context Python 3.6.9

BibiTheLamb commented 1 year ago

solved: setting the price in the distplot function must be coherent with the security's daily price. In my case AAPL price for that day was quoted between 320 & 330. In your example it was between 240 & 250