Some Thoughts on Variance of True Range
Posted: Thu Jul 05, 2007 1:32 pm
I have been noodling around with volatility channel trading ideas for a while. I like the concept because it is, to a degree, self-tuning - as volatility increases so do the price channels, giving price more "room" to counter-trend without exiting prematurely.
One of the difficulties I encountered was that the true range (TR) sometimes gets noisy without changing the average true range (ATR). This is easy to illustrate with a thought experiment: if TR alternates between 1 and 2, ATR settles to approx 1.5; if TR alternates between 1.4 and 1.6, ATR will still be 1.5; same again with 1.49 and 1.51. So clearly, ATR is not capturing certain characteristics of volatility.
So I came up with the following:
Calculate TR and ATR as usual with filter factor f = 2/(n+1), where n is the filter period (as discussed elsewhere, not everyone calculates ATR the same way).
Then calculate an error-squared term for TR at each time period t:
ErrSq(t) = (ATR(t) - TR(t))^2
Then smooth the error squared term:
AErrSq(t) = f x ErrSq(t) + (1-f) x AErrSq(t-1)
Then calculate the smoothed error term:
AErr(t) = SQRT(AErrSq(t))
So now we have some measure that can be used to separate noise from signal not only as a function of TR but as a function of the noise of TR. Now we can test a system using a volatility channel width as a function of TR AND AErr. In this way, a position in an asset with more noise in the TR would have a wider stop, smaller position size, etc as compared to a position in an asset with the SAME TR, but less noise (i.e. smaller AErr).
I was thinking that instead of using, say n x ATR for the channel width with a fixed value for n, n could be a function of AErr or AErr/TR.
Has anyone travelled down this path?
Can this be implemented in TB?
One of the difficulties I encountered was that the true range (TR) sometimes gets noisy without changing the average true range (ATR). This is easy to illustrate with a thought experiment: if TR alternates between 1 and 2, ATR settles to approx 1.5; if TR alternates between 1.4 and 1.6, ATR will still be 1.5; same again with 1.49 and 1.51. So clearly, ATR is not capturing certain characteristics of volatility.
So I came up with the following:
Calculate TR and ATR as usual with filter factor f = 2/(n+1), where n is the filter period (as discussed elsewhere, not everyone calculates ATR the same way).
Then calculate an error-squared term for TR at each time period t:
ErrSq(t) = (ATR(t) - TR(t))^2
Then smooth the error squared term:
AErrSq(t) = f x ErrSq(t) + (1-f) x AErrSq(t-1)
Then calculate the smoothed error term:
AErr(t) = SQRT(AErrSq(t))
So now we have some measure that can be used to separate noise from signal not only as a function of TR but as a function of the noise of TR. Now we can test a system using a volatility channel width as a function of TR AND AErr. In this way, a position in an asset with more noise in the TR would have a wider stop, smaller position size, etc as compared to a position in an asset with the SAME TR, but less noise (i.e. smaller AErr).
I was thinking that instead of using, say n x ATR for the channel width with a fixed value for n, n could be a function of AErr or AErr/TR.
Has anyone travelled down this path?
Can this be implemented in TB?