Different ways of aggregating trade data
Before diving into building a machine learning model or designing a trading strategy, we not only need reliable data, but we also need to aggregate it into a format that is convenient for further analysis and appropriate for the models we choose. The term bars refers to a data representation that contains basic information about the price movements of any financial asset. We have already seen one form of bars in Chapter 1, Acquiring Financial Data, in which we have explored how to download financial data from a variety of sources. There, we downloaded OHLCV data sampled by some time period, be it a month, day, or intraday frequencies. This is the most common way of aggregating financial time series data and is known as the time bars.
There are some drawbacks of sampling financial time series by time:
- Time bars disguise the actual rate of activity in the market - they tend to oversample low activity periods (e.g. noon) and undersample high activity...