The backtest uses a Context struct for the backtest time range, which uses a DateRange.
DateRange is a fixed timeframe iterator. To support tick by tick another custom iterator must be provided (either a vector of dates with nanosecond precision or an implementation of the iterator interface).
The trades execution still relies on OHLCV data for fills and slippage logic. So even when backtesting tick by tick OHLCV data with a proper timeframe (depending on the order time in force) would still be required. Alternatively a tick by tick backtesting could branch into different trade execution logic that would take into account future trades for slippage and fills and slippage.
If someone wants to currently backtest with tick by tick data it has to:
- resample the trades into OHLCV (up to Millisecond candles if trades are in nanoseconds)
- set this ohlcv data in each asset instance
- run the backtest with a strategy with main timeframe of 1ms (or a Context with a DateRange of 1ms resolution)
In paper/live mode the polling frequency respects the strategy main timeframe.
You don't need to construct OHLCV data during paper/live (unless your strategy depends on them)
The backtest uses a Context struct for the backtest time range, which uses a DateRange.
DateRange is a fixed timeframe iterator. To support tick by tick another custom iterator must be provided (either a vector of dates with nanosecond precision or an implementation of the iterator interface).
The trades execution still relies on OHLCV data for fills and slippage logic. So even when backtesting tick by tick OHLCV data with a proper timeframe (depending on the order time in force) would still be required. Alternatively a tick by tick backtesting could branch into different trade execution logic that would take into account future trades for slippage and fills and slippage.
If someone wants to currently backtest with tick by tick data it has to:
In paper/live mode the polling frequency respects the strategy main timeframe.
You don't need to construct OHLCV data during paper/live (unless your strategy depends on them)