Hi @fan27,
For backtesting I just evaluate a selected trading algo for each candle. It's a simple loop that iterates through the candles and calls the algo interface. I got a bit of generic C++ template code there to make sure it's all compile-time optimized (i.e. no virtual calls), which is important for parameter optimization performance where this code gets executed a lot. Also the code is thread-safe to kick off tons of backtests to all cores on my PC and of course it's designed so that the same algo code works for parameter optimization, backtesting & live trading. I'm adding OpenCL support though to be able to run parameter optimization on GPUs to cut down the optimization time further.
For candles I store only 5sec candles on disk but can create different aggregates in run-time to use with the algos. I also recently added custom candle compression which cuts down the data size on disk to ~4.5% of uncompressed Polygon JSON data or 5.5bits/candle (OHLC, VWAP, volume & trades data), which is good for storage and when I need to move the data around.
For backtesting I just evaluate a selected trading algo for each candle. It's a simple loop that iterates through the candles and calls the algo interface. I got a bit of generic C++ template code there to make sure it's all compile-time optimized (i.e. no virtual calls), which is important for parameter optimization performance where this code gets executed a lot. Also the code is thread-safe to kick off tons of backtests to all cores on my PC and of course it's designed so that the same algo code works for parameter optimization, backtesting & live trading. I'm adding OpenCL support though to be able to run parameter optimization on GPUs to cut down the optimization time further.
For candles I store only 5sec candles on disk but can create different aggregates in run-time to use with the algos. I also recently added custom candle compression which cuts down the data size on disk to ~4.5% of uncompressed Polygon JSON data or 5.5bits/candle (OHLC, VWAP, volume & trades data), which is good for storage and when I need to move the data around.