Forums  > Pricing & Modelling  > Sampling methods  
     
Page 1 of 1
Display using:  

gaj


Total Posts: 23
Joined: Apr 2018
 
Posted: 2018-07-14 09:18
Say I want to backtest some statistics such as "what is the probability of the price going up when my signal says buy?" How do I sample the market data to do this? Sample at fixed time intervals? Sample every tick as one data point?

The signal is high frequency and will be evaluated continuously, so sampling at fixed time intervals is not a good idea. Sampling at every tick is more realistic. But when my signal says "buy", it will probably keep saying "buy" for the next 20 ticks. I don't want to count them as 20 different samples, as they are actually one single event. My hacky solution is, if there are multiple samples in 1 second, just take the first one. It's somewhat arbitrary and I don't really like it.

EspressoLover


Total Posts: 320
Joined: Jan 2015
 
Posted: 2018-07-14 19:10
Unless computational resources are constrained, just EM resample.

Start with some base sampling scheme (fixed or tick) and fit the signal. Using the expectation from that signal, tag all the points where you'd have an actionable trade. (Probably something like signal flips while exceeding some t-cost threshold.) Now you've got a new sample set. Fit the signal again on that new sample. Then repeat and repeat. Eventually you'll converge to some point where the signal is hardly changing at all.

Also keep in mind, when evaluating continuously you need to be careful about how you define actionable trade points. There will be certain market data events where the price moves away faster than your latency window. These should never be included in the training set, otherwise the signal will likely be overconfident.

It's hard to imagine this problem being non-convex for anything but the most insane signals/markets. So, you're pretty much guaranteed to converge to the globally optimal sampling scheme.

Good questions outrank easy answers. -Paul Samuelson

johnstons


Total Posts: 1
Joined: Jul 2018
 
Posted: 2018-07-14 22:32
EspressoLover:

Don't quite follow your explanation, could you elaborate?

After you've converged on your sample set and fitted your 'final' signal on it, the only way to implement that optimal sampling scheme going forward is to keep each signal that you've fitted along the way?
Previous Thread :: Next Thread 
Page 1 of 1