# Derivative of the stock price and volume at time t

According to Forecasting of Jump Arrivals in Stock Prices: New Attention-based Network Architecture using Limit Order Book Data at page 9, I would be interested in deriving the the price (ask and bid sides) and volume (ask and bid side), but I am struggling how to do it.

Be aware I reconstructed the order book each second from the full market depth. So the idea would be to get the volume and price derivative each second for each side of the market, i.e. ask and bid sides. https://www.algoseek.com/static/files/sample_data/equity_and_etf_etn/IBM.FullDepth.20140128.csv.zip <-- Here a sample of the full market depth.

How can I compute the derivative of the price and the volume with Python?

• Is your question on how to get limit order book data? If yes, then either you find a data provider that gives you limit order book snapshots at each point in time or that provides you with order book update instructions that you need to "replay" in order to recover the book state. – LocalVolatility Feb 9 at 14:46
• @LocalVolatility No, this is not my question. I have already the full market data for several years from a vendor. Here is a sample algoseek.com/static/files/sample_data/equity_and_etf_etn/…. I have all the display and non-display data. Can you help from there? – fgauth Feb 9 at 14:58
• The file you linked has order book updates. So you do know how to construct the market depth at different times from those? If yes, then please clarify your question because I still don't understand it. – LocalVolatility Feb 9 at 15:04
• @LocalVolatility Yeah, I reconstructed the order book each second. So the idea is the get the price (ask and bid) and volume(ask and bid) derivative each second. – fgauth Feb 9 at 15:07
• If you understand the algorithm conceptually, then the implementation should be clear. I generally don't like question like "how to do X in language Y". If you understand X then it is a purely technical problem and off-topic here. If you don't understand X, then ask about X only. – LocalVolatility Feb 9 at 15:21