How to align MarketDepth with TimeAndSales?

liu.chen
liu.chen Newcomer
edited December 2024 in TRTH

Hi, I want to build a model to forecast the price impact of a trade with additional features of LOB, like depth imbalance.

So I need a dataset kind of like the MarketDepth now but for each row, I want to know what action (trade/quote) trigger this LOB update. For example, each row should have:

Trade price, Trade Size + LOB L1-L10 immediately before the trade is executed (or immediately after the trade is executed).

Currently, I am downloading market depth and trade data separately and try to merge them. However, for trade in TimeAndSales, the time stamp doesn't match with MarketDepth

Is there any way, I can merge this two dataset correctly? Or using other dataset to derive the similar stuff?

Thank you!

Following are templates I used to extract trade and depth. And an example of the same trade but different time stamp in TimeAndSales and MarketDepth. In this example, the first row of two df should be matched, but their time stamp is very different and there might be duplicate time stamp as well.

Screenshot 2024-12-01 at 21.05.45.png Screenshot 2024-12-01 at 21.21.38.png

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @liu.chen

    Thank you for reaching out to us.

    The timestamp field is the Tick History server timestamp when the server retrieved data. It shouldn't be used for mapping among extractions. You need to check if there are any content fields in report templates that can be used for mapping.

    Otherwise, you can contact the Tick History support team directly via MyAccount to verify this.