tag:blogger.com,1999:blog-35364652.post709974332562319000..comments2017-12-11T07:34:40.528-05:00Comments on Quantitative Trading: Mean reversion, momentum, and volatility term structure Ernie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger93125tag:blogger.com,1999:blog-35364652.post-7012624022470389402017-09-25T07:17:54.588-04:002017-09-25T07:17:54.588-04:00Hi Andrew,
Thanks for letting us know!
ErnieHi Andrew,<br />Thanks for letting us know!<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-74065743207523070612017-09-24T20:48:47.037-04:002017-09-24T20:48:47.037-04:00Hi Ernie
I feel I was able to create the hurst e...Hi Ernie <br /><br />I feel I was able to create the hurst exponent by your procedure: <br /><br />https://flare9xblog.wordpress.com/2017/09/24/modelling-the-hurst-exponent/<br /><br />Andrew Bannermanhttps://www.blogger.com/profile/01681759786853960574noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-31461915563035476502017-08-25T15:20:08.427-04:002017-08-25T15:20:08.427-04:00Hi Cherkassky,
Thank you for your kind words.
The...Hi Cherkassky,<br />Thank you for your kind words.<br /><br />There is no "true" volatility. Any volatility measurement is a function of the time scale it is measured. You should use the volatility for the time scale of your trading strategy.<br /><br />In particular, I was not comparing sample (unconditional) variance vs the conditional variance (1 in your example) of an ARIMA process. I was measuring the unconditional variance at various time scales.<br /><br />Hope this clarifies.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-12413174956539383302017-08-25T14:54:22.231-04:002017-08-25T14:54:22.231-04:00Hi Ernie,
Great blog - I'm a fan of your book...Hi Ernie,<br /><br />Great blog - I'm a fan of your books as well. I was wondering for some clarification on this part of your post:<br /><br />If we annualize the volatility of a mean-reverting price series, it will end up having a lower annualized volatility than that of a geometric random walk, even if both have exactly the same volatility measured at, say, 5-min bars. The opposite is true for a trending price series.<br /><br />Are you saying that when returns are negatively autocorrelated (mean reverting time series), if you take the standard deviation as a measure of volatility then you will underestimate the "true" standard deviation of the process? And vice versa for positively autocorrelated (trending) returns?<br /><br />This makes sense intuitively, but I ran some simulations in R and am not finding results that match with my intuition. We can simulate an AR(1) model in r with positive and negative autocorrelation:<br /><br />> sd(arima.sim(model=list(ar=.5),sd=1,n=1000))<br />> sd(arima.sim(model=list(ar=-.5),sd=1,n=1000))<br /><br />and it turns out both of these actually overestimate the true standard deviation (which is 1). Does this match with your intuition? Or am I examining a different phenomenon<br /><br />Also, if you look at the wikipedia article here <br /><br />https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation#Effect_of_autocorrelation_.28serial_correlation.29<br /><br />it seems like from the equation stated at the top - having a negative autocorrelation parameter would lead to sample variance overestimating the true variance and vice versa - which I think is opposite to your statement about mean reverting/trend following variance. <br /><br />Cherkasskyhttps://www.blogger.com/profile/02641659632312867760noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-69712921786779614792017-08-03T19:33:31.811-04:002017-08-03T19:33:31.811-04:00Andrew,
Your first scheme is closer to the way.
Y...Andrew,<br />Your first scheme is closer to the way.<br /><br />You don't just compute the returns on one day. You should, for e.g., compute the 1-min log returns on all days, and then compute the variance of them. There is also no need for 3): no need to subtract anything from the variance.<br /><br />You have now a set of tau (1-min, 1-hour, 1-day, etc.), and a corresponding set of variances. Plot the log of those variances against the log of tau. <br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-72777286058278805772017-08-03T18:39:16.151-04:002017-08-03T18:39:16.151-04:00Ok so for each day I would , lets say mid prices o...Ok so for each day I would , lets say mid prices of 1 minutes to 2^10 minutes (1024 minutes)<br />Lets say start date of: 2013-01-06<br /><br />1. Compute log returns from 1 minute to 1024 minutes ( so 1 minute bar for each incremental step to 1024 minutes)<br />2. Compute the variance of those returns <br />3. Subtract the variance of those returns - the log returns? <br /><br />How does one form the plot especially over date range: 2013-01-06 to 2016-01-15 <br /><br />We are plotting the variance of log returns against the log returns right? <br /><br />Just struggling with how to structure it and how 1 minute to 1024 minutes relate over the 'n' range period.<br /><br /><br />OR<br /><br />for the first 1 minute bar to the last 1024 1 minute bar... <br />we do the log returns and the variance of the log returns... <br /><br />From date range: 2013-01-06 to 2016-01-15 <br /><br />log(Var(1min bar)) - log(1min bar)<br />We do that for every bar... first 1 minute bar up to the last 1024 minute bar.... <br /><br />and the result of that... is what we plot? <br /><br />I can get this, just need a lil more 'dumbing down' again!<br /><br />I do see the value in it, if i could view the markets nature in this way, it means could 'fit' a model suited to exploit the characteristics of the that market. At least that's the initial thinking<br /><br /><br />Andrew Bannermanhttps://www.blogger.com/profile/01681759786853960574noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-74924881594838369902017-08-03T16:56:06.357-04:002017-08-03T16:56:06.357-04:00Hi Andrew,
No, you do not annualize the volatility...Hi Andrew,<br />No, you do not annualize the volatility in this study. The whole point of the exercise is that we should not assume a Gaussian diffusion process for the log prices. I.e. Hurst exponent is not necessarily 0.5.<br /><br />Yes, the window for computation is entire data set.<br /><br />For any given time t taken from the data set, the time bar for the computation of log return is tau. I don't want to call it a "window", since it is just a bar (1 minute? 1 hour?) So it is just log(price(t+tau))-log(price(t)). You will have as many data points as the number of t in your data set. You will compute the variance of these data points (log returns). For different tau, you get different variances. These different variances vs tau form the plot.<br /><br />Ernie<br /><br />Ernie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-46531630001001103052017-08-03T16:14:22.688-04:002017-08-03T16:14:22.688-04:00Hi Ernie
I have a question regarding this formul...Hi Ernie <br /><br />I have a question regarding this formula. I am aiming to replicate your study: <br /><br />volatility(τ)=√(Var(z(t)-z(t-τ)))<br /><br />z = log price <br />τ = time interval? <br />t = what plugs into t ? <br /><br />if i understand the process is below: <br />Take variance over many sample times, in this case... mid price of 1 minute to 2^10 (1024 minutes or 17 hours) for intraday<br /><br />Once we do the above calculation, we need to multiply the daily volatility by √252? to obtain annualized volatility? or is that not needed? <br /><br />for the plot: <br /><br />plot the log(Var(τ)) against log(τ)<br /><br />is this a rolling window across a start date to end date in your example:<br />2013-01-06 to 2016-01-15 <br /><br />for τ<br /><br />would i take the width of the window, lets say for intraday.. 1 minute to 2^10. And i slide that width of window up to the end date. So a rolling variance you could say? <br /><br /><br />Or do i just take to and from and work out plot the log(Var(τ)) against log(τ)? <br /><br />If that is the case, then how would i plug in the time periods into τ?? <br /><br />It would be log variance of mid price from 1 minute to 2^10 2013-01-06 to 2016-01-15 to enter in log(Var(τ))... then against log(τ).. what would I enter in here? <br /><br />Let me know if you can perhaps make it in simple terms for someone like me :) <br /><br />Thanks a lot! <br />Andrew<br /><br /><br /><br />Andrew Bannermanhttps://www.blogger.com/profile/01681759786853960574noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-76412360834609485032016-08-07T09:11:35.764-04:002016-08-07T09:11:35.764-04:00Hi Pavel,
The log2(t) on the x-axis is for display...Hi Pavel,<br />The log2(t) on the x-axis is for display purposes only. In my actual linear regression, I have taken the natural log of both variance and timescale.<br />Hope this helps.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-30539367713548184672016-08-07T08:50:47.420-04:002016-08-07T08:50:47.420-04:00Hi Ernie,
I was trying to replicate your results ...Hi Ernie,<br /><br />I was trying to replicate your results and noticed that because of you are taking logarithm from time based on 2, i.e. log2(Time), you should also take log2 from variance, i.e. log2(Var). Please correct me if I'm wrong. You didn't make this explicit, so I was straggling a bit. Thank you for the great topic.<br /><br />PavelPavelBhttps://www.blogger.com/profile/06264109362858532526noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-89102258751978717962016-08-02T11:48:57.415-04:002016-08-02T11:48:57.415-04:00Chris,
The significance testing in this specific c...Chris,<br />The significance testing in this specific context is to see if the Hurst exponent for random data of the same size will have the same value as what we obtained. The conclusion is that if we assume Gaussian distribution of such values, the chance that this happens is less than 2.5%. Hence with better than 97.5% probability this is a trending price series.<br /><br />See also p. 16 of my second book, section on Statistical Significance of Backtesting: Hypothesis Testing.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-41927684193210811982016-08-02T11:35:48.161-04:002016-08-02T11:35:48.161-04:00The mean of what exactly?The mean of what exactly?Chris Jakobsenhttps://www.blogger.com/profile/17214334228257970653noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-18612087303348076702016-08-02T11:01:01.964-04:002016-08-02T11:01:01.964-04:00Hi Chris,
Yes, I use the word "significant&qu...Hi Chris,<br />Yes, I use the word "significant" in a specific sense. It means that it is more than 2 standard deviations away from the mean.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-60915897482953820582016-08-02T10:43:08.676-04:002016-08-02T10:43:08.676-04:00Sorry, between 0 and 1, my bad.
I was referring t...Sorry, between 0 and 1, my bad.<br /><br />I was referring to the following you wrote: "We can do the same analysis for USO (the WTI crude oil futures ETF). The intraday H is 0.515±0.001, indicating significant trending behavior. The daily H is 0.56±0.02, even more significantly trending."<br /><br />ChrisChris Jakobsenhttps://www.blogger.com/profile/17214334228257970653noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-64766076121904682982016-08-02T10:09:58.782-04:002016-08-02T10:09:58.782-04:00Hi Chris,
Actually H is between 0 and 1. It isn...Hi Chris,<br />Actually H is between 0 and 1. It isn't realistic to have negative H, because that would imply prices remain constant over the long term.<br /><br />Whether a price series is trending or not depends on whether it is statistically significantly greater than 0.5. Some of the price series I noted in the article passed this significance test by a good margin. However, I failed to find the adjective "strongly" mentioned in my article above. Can you please point out the sentence?<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-49154137785321615262016-08-02T08:52:01.018-04:002016-08-02T08:52:01.018-04:00Hi Ernie,
If I understand it correctly from your s...Hi Ernie,<br />If I understand it correctly from your second book p. 45, the Hurst Exponent can be between +1/-1. When 0.50 is random walk, it strikes be as bold to claim that H = 0.56 is STRONGLY trending as you do in the above article. I would have guessed that strongly trending would be H = 0.8 or thereabouts??<br /><br />Chis.Chris Jakobsenhttps://www.blogger.com/profile/17214334228257970653noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-72352929653976998672016-06-29T12:32:39.984-04:002016-06-29T12:32:39.984-04:00Great article!Great article!Sqrt Alphahttps://www.blogger.com/profile/14496960785936577254noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-18730673890269784872016-06-16T11:23:35.289-04:002016-06-16T11:23:35.289-04:00You are correct.
ErnieYou are correct.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-48840017700520700972016-06-15T21:57:52.686-04:002016-06-15T21:57:52.686-04:00Hi Ernie,
Thank you for quick response.
Is it be...Hi Ernie,<br /><br />Thank you for quick response.<br /><br />Is it because of ill-liquid for small cap stocks?<br /><br />Thanks.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-51749342668998390682016-06-15T21:30:23.702-04:002016-06-15T21:30:23.702-04:00Not at the moment.
ErnieNot at the moment.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-3965639440849261272016-06-15T20:03:58.875-04:002016-06-15T20:03:58.875-04:00Hi Ernie,
Do you trade Russell 2000?
Thanks.
Hi Ernie,<br /><br />Do you trade Russell 2000?<br /><br />Thanks.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-64283255163360431752016-06-13T07:34:37.151-04:002016-06-13T07:34:37.151-04:00We trade mostly intraday strategies, because of th...We trade mostly intraday strategies, because of their higher statistical significance and lower risk. Yes, they do have lower capacity, but then we don't have billions to manage at this point. We are, however, working on strategies with longer holding period and higher capacity, and will be able to launch soon.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-37888576305098451022016-06-13T04:12:05.485-04:002016-06-13T04:12:05.485-04:00Hi Ernie,
Do you trade only intraday strategies?
...Hi Ernie,<br /><br />Do you trade only intraday strategies?<br />Are the capacity of intraday strategies limited?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-14296394427513707302016-06-05T18:06:28.968-04:002016-06-05T18:06:28.968-04:0010 bps one way.
Ernie10 bps one way.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-28066592060524818732016-06-05T17:51:04.542-04:002016-06-05T17:51:04.542-04:00Hi Ernie,
What is the reasonable assumption of tr...Hi Ernie,<br /><br />What is the reasonable assumption of transaction costs for Russell 2000 stocks?<br /><br />Thanks.Anonymousnoreply@blogger.com