Question for different Data Prep AND Example Codes #80
-
Hello, I'll try to keep this concise. Thanks much in advance! Data PrepI'm trying to use another data source (traditional assets) for this libraries as I don't have long historical data as messages, but I do have Order book snapshots at ticks events and trades events. Currently, I convert my LOB snapshot into state changes for each price level that has its quantity change or sign changes For example ,
time 0: bid price 100 has 50 qty
I will do this for all my LOB updates, where if price disappears from the snapshot, I assume nothing happen until the price level appears in the snapshot again. Then I convert my trades into your format and join the two table and sort by exchage ts Is this wrong? Or should I just use event type 4 and put in the prices and qty? Backtesting ExampleReferencing your GLFT example, From what I understand, you are requoting every 100ms, at around 10-25 halfspread (depending on the coef and vol) ticks. it just surprises me that it trades that much with such a fast quoting around mid price, but it's possible for ETH with delays included. Hopeful |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
If I correctly understand what you intend, this is the right approach. You can refer to this method, which converts the snapshot into incremental changes. You may need to check if the conversion is correct. Regarding the second point, the GLFT model is derived from a high-frequency grid-trading model that fixes the quoting price within a given grid. Therefore, even though the quoting interval is short, it does not update orders at every interval since the quoting price remains fixed within the grid. |
Beta Was this translation helpful? Give feedback.
-
@nkaz001 Hello, I wanted to revisit this question regarding creating valid data from market snapshot (orderbook) + trades data. I tried running simple live data model and compared the bid/ask mid against the backtest and I found some discrepancies. I wanted to revisit your code, but It appears that in the new version, you have taken /hftbacktest/data/utils/difforderbooksnapshot.py out. Was there something that prompt it to be removed? Much Appreciated! |
Beta Was this translation helpful? Give feedback.
If I correctly understand what you intend, this is the right approach. You can refer to this method, which converts the snapshot into incremental changes. You may need to check if the conversion is correct.
Regarding the second point, the GLFT model is derived from a high-frequency grid-trading model that fixes the quoting price within a given grid. Therefore, even though the quoting interval is short, it does not update orders at every interval since the quoting price remains fixed within the grid.