# 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

-

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.

-

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).

-