How do you sample your data?

Lately I've been really thinking about the way Marcos Lopez de Prado (Advances in Financial Machine Learning) goes into detail on something as (seemingly) simple and fundamental as considering what kind of data to even use in the first place.

So my question is: how many of you actually keep a database of tick data and build your own bars (time based or not) for research/testing?

My naive impression is that seems like the sky is the limit when doing this.

  • by default you have many more observations that would increase the chance of finding statistically significant signals
    • conversely this also means there is a lot more noise which could lead to false discoveries
  • you can resample into any time interval you want or need
  • you have access to all kinds of information and activity that is lost in time-based bars
  • but to me the most important part is that you have the necessary granularity to make it easier to resample into bars that are not time based
    • he talks about volume bars, dollar bars, imbalance bars, CUSUM filter, etc...
    • I like the idea of starting right off the bat with data that supposedly has better statistical properties, thus decreasing the need for an unnecessarily complex or convoluted model

Posted Apr 16, 2020, 12:37 AM UTC

77
tidemp•

I don't see a point in keeping a database of data, especially tick data. Lots of companies already store this data for us. Maybe keep a cache to prevent re-downloading data again during testing. The most important thing is to have fast internet so you can download data quickly.

If I'm going to backtest, then I'll backtest at least for the last decade. No need to sample, just backtest the whole lot. Maybe sample data when doing optimizations trying to fine tune variables. Though if you have enough computing power it may not be necessary at all to sample data.

2
BrononymousEngineerOP•

No need to sample, just backtest the whole lot.

It seems like you misunderstand what I'm asking, maybe I wasn't clear. I'm talking about sampling in the sense of signal processing.

Standard OHLC bars measure price at some constant time interval; whenever x units of time pass, take a measurement. I'm interested in making x something else besides units of time.

1
tidemp•

Most data providers allow you to create bars any way you want, whether time or ticks. So I'm still not really sure what you mean.

1
[deleted]•

[removed]

1
[deleted]•

[deleted]

2
Yogi_DMT•

I build my "candles" out of raw trade data using a weighted average.

You do need to at some point sample your data and yes i definitely agree that more granularity = better information but high granularity is also prone to noise.

With something like a NN, noise coming from small sample frequency usually isn't really the issue because if you provide a large enough amount of lookback, the model will figure out how to appropriately de-noise the data and extract signals.

The issue is more with having the resources to deal with samples that have a large enough window to allow your model to see past the noise. So yes there is a tradeoff but it's more of a time/cost one.

I've done some empirical analysis on the edge i get from different sample frequencies. The analysis does indeed show a point of inflection where you get the most edge per unit of time value.

Also you are absolutely right in that OHLC bars are basically useless in the real world.

2
BrononymousEngineerOP•

Thanks. I am not currently using any kind of ML. I'm more interested in being rigorous about preventing 'garbage in, garbage out.'

1
pro__acct__•

I’m currently working on creating “dollar bars” from tick data. I like all MLdP says about their robustness and from a game theory perspective appreciate the benefits of moving into a space with less competition. I wonder if there’s even another style of hybrid bars that can be constructed to take advantage of volume...

1