With this python script you can connect to the binance API and correctly manage a local orderbook Please install this python package before running the script: https://github.com/binance/binance-connector-python