tag:blogger.com,1999:blog-35364652.post709974332562319000..comments2018-04-24T07:28:18.681-04:00Comments on Quantitative Trading: Mean reversion, momentum, and volatility term structure Ernie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger96125tag:blogger.com,1999:blog-35364652.post-72747548779570760622018-04-14T08:51:45.896-04:002018-04-14T08:51:45.896-04:00I would greatly appreciate if you comment upon fol...I would greatly appreciate if you comment upon following strategy--<br />THIS METHOD INVOLVES TRADING WITH THE TREND WITH ENTRY ON INTRADAY MEAN REVERSION REVERSALS ONLY WHEN THERE IS INTRADAY SPIKES IN VOLATILITY.TRADES LAST NO MORE THAN FEW DAYS.HIGH TURNOVER HELPS WITH STATISTICAL EDGE WITH IN BROWNIAN MOVEMENTS. Daily charts are used to determine market direction.<br />There are days when volatility increases intraday— but we just do not know when. Those are the days when mean reversion has higher chance of making $$.<br />This method works better in cross currencies which have better & longer trends compared to pairs which have U.S. Dollar in the pair. To control draw downs we only trade in the direction of the trend. Let us say for discussion that british pound cross currencies are trading up (GBP/JPY, GBP/AUD, GBP/CHF ect)<br />Daily pip range for GBP/AUD presently is 140 pips(as of April 14,2018)<br />Over thousands of runs one can state that GBP/AUD has daily range of 140 pips—70 pips up & 70 pips down from opening price. But on any given day anything can happen. Since trend is up. We only trade long.<br />Everyday around 5PM EST ,we put order to buy GBP/AUD as limit order 100 pips below opening price with take profit 50 pips & stop loss of 50 pips on the same ticket. We let the market close the position either at profit or at a loss—no human intervention. Only one open order in each cross currency at any given time. This distance of 100 pips can be adjusted up/down based on volatility, balance in the account & number of open positions already in account.<br />Next day again new orders are entered based on the then current prices in different cross pairs. Unfilled orders get cancelled at the end of every day. Similar orders are put in daily in several cross pairs to spread the risk.<br />Since daily pip range for GBP/Aud is 70 pips up or down, volatility has to increase before buy order gets executed—and that is the day when mean reversion has higher chance of making money.<br />Since buy limit order & stop loss are on the same side of market price, chances are higher for buy order to get executed compared to stop loss getting hit. Every thing is on the same ticket—so when take profit is hit, stop loss order no longer exists.<br />How much more often market would travel distance of 100 pips (D1)compared to distance of 150 pips(D2) in the same time interval(t) , can be roughly computed as follows based on random motion( distance travelled is proportional to square root of time intervals— option formulas)<br />150 X 150/100 X 100 which is—<br />3x3/2x2 =2.25 . This means out of 3.25 runs we win 2.25 times & lose one time & THAT IS THE MATHEMAICAL EDGE. Trading with the trend gives additional mathematical edge above & beyond this number which cannot be computed but is common sense..<br /> We already know that in up market, corrective moves are shallow & that controls draw downs during that day—risk control is there on every ticket order with stop loss. No playing around with any ticket—win or lose. Trading with the trend gives additional mathematical edge above & beyond this number. Each position lasts only couple of days.There is also built in stability if trader mixes up good number of cross currencies. If Australian dollar goes up, pairs where Australian dollar is second entity(GBP/AUD,EUR/AUD) go down but pairs where Australian dollar is first Item go up(AUD/CAD,AUD/CHF,AUD/NZD).This balances fluctuations in equity/draw downs.<br />Similar other orders are entered in other cross currencies in the direction of the trend of that pair. If trend is not clear, no order in that pair & select another pair with trend. No orders in pairs with U.S. dollar in the pair.<br />I thank you for all your help.<br />Respectfully Submitted,<br />Prem Nath M.D.<br />Email INDUS68@GMAIL.COM<br />pnath01https://www.blogger.com/profile/02702242379200371670noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-26465655577878134192018-03-18T16:41:21.630-04:002018-03-18T16:41:21.630-04:00Hi Felix,
Such diffusive processes typically exhib...Hi Felix,<br />Such diffusive processes typically exhibit power-low dependence only when diffusion is a bit far away from the original (long-horizon). In the short term, there are other complicated dynamics at work requiring complicated functions to describe the time dependence of their distance from the origin.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-58005662371836437692018-03-18T14:09:28.423-04:002018-03-18T14:09:28.423-04:00Hi Ernie!
The literature says rescaled range (R/S...Hi Ernie!<br /><br />The literature says rescaled range (R/S) (and therefore Hurst…) is a measure for “long-term dependence” or long memory. Lo (1991) then modified the test to be robust to short-term dependence.<br /><br />Do you know if there is an argument against using R/S or Hurst on a short-horizon (i.e. why must Hurst describe long-term and not short-term dependence?)<br /><br />Thank you!<br /><br />FelixFelixnoreply@blogger.comtag: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.com