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$
4
  • $\begingroup$ what are "standard time bars" and "volume bars" $\endgroup$
    – develarist
    Apr 28, 2020 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$ Apr 28, 2020 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, 2020 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, 2020 at 2:02

2 Answers 2

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.

$\endgroup$
1
  • $\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, 2020 at 19:52
0
$\begingroup$

I'm also wondering about the same issue. There is even an exercise(2.3) that requires readers to "Apply ETF tricks" "On DOLLAR BAR series of E-mini S&P 500 futures and Eurostoxx 50 futures". There're are few code implementations floating around on Github, however, all of them assume that the bars are already aligned.

I think the alignment should be done when generating the dollar bars, the volumes of all assets need to be considered in the process. For example, we could generate a dollar bar for each of the assets whenever the sum of asset volumes reaches a certain threshold.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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