3
$\begingroup$

Looking at the book "Advances in financial machine learning" the author proposes a way to sample high frequency financial data in several fashions which are not only the standard time bars. I was trying to prepare a dataset for doing multivariate analysis using time series of several different futures. In doing that I would use volume bars, which are considered more representative of the effective flow of information provided by the market and also have desirable statistical properties like the recovering of normality, just looking at the returns.

Unfortunately, when I create volume bars for different assets given a threshold of traded contracts that signals to close the bar, the resulting bars are obviously not aligned. Actually, every future contract has its own volume path during the day, so there is no chance to get them aligned in time.

My concern comes when one wants to do some multivariate regression between the assets considered. How do I solve the problem of differently aligned timestamps? Is there a common way to solve this in practice?

I suspect that working with volume bars (or even tick/dollar bars) implies that you have to deal with the timestamp issue.

$\endgroup$
  • $\begingroup$ what are "standard time bars" and "volume bars" $\endgroup$ – develarist Apr 28 at 19:12
  • 1
    $\begingroup$ @develarist 'standard time bars' are set by the clock, such as 5 minutes, 10 min etc. 'volume bars' are set as 'new bar every time the market has traded X amount of stocks'. $\endgroup$ – python_enthusiast Apr 28 at 20:11
  • 1
    $\begingroup$ Time bars are the standard used among academic, but also practitioners as far as I know. Essentially time bars are constructed by sampling uniformly in time raw ticks of financial transactions. Volume bars are obtained by changing the logic while sampling. We don’t sample ticks after certain amoint of time (for instance, 5 minutes), but after certain amount of traded contracts (for instance, every 1000 traded contract). For more information refer to the book of Marcos Lopez De Prado I cited in the initial post. $\endgroup$ – AleB Apr 28 at 20:13
  • $\begingroup$ can volume bars and dollar bars be calculated for daily data (closing prices end-of-day over a horizon of 252 days for example) instead of minute-to-minute intraday data? $\endgroup$ – develarist Jun 4 at 2:02
1
$\begingroup$

It's not about timestamps. You just need to assign the same meaning to each bar.

Choose a fixed percentage of daily volume each bar should represent. Then for each individual day, compute the bar size from that percentage:

today's bar size = today's total volume * chosen fixed percentage

For example, I can choose that each bar should be 2% of the daily volume. So for each day, I will have a different bar size to get that 2%. And voila, I'll have the same number of bars within each day.

| improve this answer | |
$\endgroup$
  • $\begingroup$ This is a good solution to uniform the choice of the bars for just an asset. What if I want to create volume bars with the method you proposed for several assets? Then create a single dataset from those volume bars. The problem of aligning volume bars for different assets still remains I think $\endgroup$ – AleB May 31 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.