Skip to content
All library documents

Detrending Strategy Returns for Bootstrap Significance Tests

Article Quant Q&A · Author: Vazgen

Summary

The discussion explains how detrending can help test whether a trading signal has predictive value. It recommends matching the detrending frequency to the frequency being tested, such as using one-minute returns for a one-minute strategy. Log returns are favored over percentage returns because they may better meet stationarity and independence assumptions used by some statistical tests.

For bootstrap testing, one answer recommends detrending across the full backtest period to remove market drift and the strategy’s long or short bias, then subtracting the strategy’s average detrended return to center the null distribution at zero. This is a post-signal statistical calculation, so the full-period statistic does not affect trading decisions. The discussion distinguishes this from live signal construction and notes that choosing a rolling or expanding window is not settled; out-of-sample evaluation and cross-validation can help assess whether conclusions generalize. These are forum explanations rather than a comparative empirical study of detrending methods.

Key ideas

  • Match the detrending interval to the return frequency being tested.
  • Log returns may better satisfy assumptions used in parametric statistical tests.
  • Full-period detrending can remove market drift and strategy position bias for a bootstrap test.
  • Centering detrended strategy returns at zero creates the bootstrap null distribution.
  • Out-of-sample evaluation can help assess whether test conclusions generalize.

Tags

Full text
# Detrending price data for analysis of signal returns


# Detrending price data for analysis of signal returns












I'm looking to conduct hypothesis tests on some of my trading signals to see if the signal returns are statistically significant enough to falsify my null hypothesis that the signal has no predictive power.

A signal's returns can be distorted by 2 things: (1) the signal's long/short position bias, and (2) the market's net trend during the back-test period. Both of these components can apparently be eliminated by de-trending the data.

An excerpt from "Evidence Based Technical Analysis" : "To perform the detrending transformation, one first determines the average daily price change of the market being traded over the historical test period. This average value is then subtracted from each day's price change." He goes on to say to use log returns over percentage-based returns.

A few question arise:

1) What if my strategy is intraday, should I still be using the average DAILY price change to detrend the data, or should I go down to the frequency on which I trade and calculate the average 1 minute price changes (strategy trades on 1M)?

2) Should I really be using a future statistic (the average price change of the market over the backtest period) that is not known until the backtest is complete to detrend past data, post-backtest? I fear this will result in a statistical conclusion that is only valid for the backtest period. Or should I calculate the detrended market return every bar? In that case should I use a cumulative or rolling window to calculate the average market return (to be subtracted from the current return)?

3) I know there's other ways to detrend data other than:

( Log(CurrentPrice/LastPrice) - Average(Log(CurrentPrice/LastPrice)) )

Does anyone know of a method that is particularly better suited for my problem domain?

Thank you

## Answer by babelproofreader (score 1, accepted)

https://quant.stackexchange.com/a/4304

In answer to your question 2, you should detrend over the entire range of the back test period. The purpose of the detrending is to satisfy/create the null hypothesis for the boot strap test (it's not strictly necessary for the permutation test). This hypothesis is that the return from your strategy is zero. To create this zero null hypthesis you have to

1) detrend over the entire data set to eliminate any long term trend, in effect removing the return that could be obtained from simple buy and hold, and this also removes the long/short bias of your system

2) then remove the average return of your system on this detrended data from above to create the null hypothesis distribution for boot strapping

Your concern about "future statistic" does not apply here - none of the above informs the decision making process of the system as this test is run after you have generated your signal vector. It is simply a statistical test run on data after it has been collected.

## Answer by pat (score 2)

https://quant.stackexchange.com/a/4289

You should de-trend to whatever frequency scale you are testing. I.e. 1 min means de-trend 1 min data. Merely by moving to higher frequency data, you are eliminating much of the systematic bias present at higher scales -- as

1) you have many more samples to compare (minimizing standard error) 2) At smaller intervals, the drift component also shrinks progressively smaller.

If you are trading at much higher sampling interval scales, e.g. 1 month, it would make more sense to compare returns over the higher period to be consistent in comparisons.

Log scale return transformations are often preferred as they can be more stationary (and closer to IID assumptions for parametric based statistical testing).

The choice of using a rolling window vs. all historical is a bit of art vs. pure science. Nowadays (post 'Evidedence Based TA'), there is a lot more focus being given to out of sample performance and ability to generalize (cross-validation is one way to approach this).

## Answer by rage (score 0)

https://quant.stackexchange.com/a/38420

Since I don't have enough reputations to add a comment, so I comment here.

> 1) detrend over the entire data set to eliminate any long term trend, in effect removing the return that could be obtained from simple buy and hold, and this also removes the long/short bias of your system

this is the real detrend in the EBTA book, which compare the strategy with the random strategy with the same long/short bias, the appendix give a proof that detrending is equivalent to benchmarking based on position bias.

> 2) then remove the average return of your system on this detrended data from above to create the null hypothesis distribution for boot strapping.

This is **zero centered adjustment ** in the EBTA book, as you say this creates the null hypothesis for the bootstrapping.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.