Adapting Backtests for FX Tick Data with Time Bucketing
Summary
The document discusses the difficulty of finding backtesting libraries that support foreign exchange tick data. The questioner notes that two candidate tools they considered lacked FX support, while a suggested alternative was described as accepting only OHLC bars. The response proposes aggregating tick observations into one-second buckets so that tools built for bar data can be used.
This is a practical workaround rather than a complete backtesting method. The text does not specify how to construct each bucket, handle bid and ask quotes, model spread and slippage, or preserve intrasecond execution behavior. Aggregation can make existing tools applicable, but it may discard information relevant to order timing and fills. The document supplies no comparative testing or evidence that a particular library will produce reliable FX results after conversion.
Key ideas
- The document identifies limited support for FX tick data among the backtesting tools considered.
- Grouping tick data into one-second intervals is suggested as a way to use bar-oriented tools.
- The source does not specify the aggregation rules or how to model realistic execution costs.
- Time bucketing may remove intrasecond information that matters for trading and fills.
- The recommendation is a brief workaround, not a tested comparison of backtesting libraries.
Tags
Full text
# Are there any software libraries for backtesting FX algorithms against tick data? # Are there any software libraries for backtesting FX algorithms against tick data? I've read question, however it doesn't appear as if any of those libraries work for FX data. A Google search for `python forex backtesting` turns up this project, however I think it needs quite a bit more development before it can be considered useful. As far as I can tell the two most promising projects are Zipline and Quantlib, but again no FX support. After a bit more searching it looks like my question is a duplicate of this one. ## Answer by K3---rnc (score 2) https://quant.stackexchange.com/a/43568 Another option is Backtesting.py, but the website says it only works with OHLC data. Maybe you can group your tick data into 1-second buckets, afterwards finding that all sorts of tools apply.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.