tag:blogger.com,1999:blog-35364652.post7078827379111105701..comments2024-03-15T10:28:18.248-04:00Comments on Quantitative Trading: My interview, stop loss, and the Principle of Latest InformationErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger36125tag:blogger.com,1999:blog-35364652.post-87685800714158860822021-06-05T12:12:12.026-04:002021-06-05T12:12:12.026-04:00I have written about content related to the Stop l...I have written about content related to the Stop loss hunt topic with my experience. See more here https://forexfuel.blogspot.com/2021/05/stop-loss-hunt-avoiding-strategy.html Here is my way to place the stop loss. This works well. Forex Fuelhttps://www.blogger.com/profile/01352676131936241816noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-32712268790612722672021-06-05T12:11:44.654-04:002021-06-05T12:11:44.654-04:00I have written about content related to the Stop l...I have written about content related to the Stop loss hunt topic with my experience. See more here https://forexfuel.blogspot.com/2021/05/stop-loss-hunt-avoiding-strategy.html Here is my way to place the stop loss. This works well. <br />Forex Fuelhttps://www.blogger.com/profile/01352676131936241816noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-84777579094128901292009-09-17T21:08:05.233-04:002009-09-17T21:08:05.233-04:00Captain Kena,
Unfortunately the calculations are i...Captain Kena,<br />Unfortunately the calculations are in symbolic form only, not in software codes.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-66037727351939608292009-09-17T16:34:09.426-04:002009-09-17T16:34:09.426-04:00Ernie,
Is there any reference to code for the app...Ernie,<br /><br />Is there any reference to code for the approximate solution? If someone else has published a description of the algorithm, it would shorten my development time considerably.Regorlithhttps://www.blogger.com/profile/13333250664926555342noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-41765264946494858492009-09-17T14:59:07.567-04:002009-09-17T14:59:07.567-04:00Captain Kena,
You can follow the derivation in www...Captain Kena,<br />You can follow the derivation in www.edwardothorp.com, and plug in a non-Gaussian distribution. You will soon find that there is no analytical solution.<br /><br />(Of course, you can always find approximate solution using renormalization group theory.)<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-42901046107188006192009-09-17T13:55:57.525-04:002009-09-17T13:55:57.525-04:00Ernie,
You said: " Continuous Kelly formula ...Ernie,<br /><br />You said: " Continuous Kelly formula that does not rely on Gaussian assumption does not have a closed-form mathematical solution and requires complex numerical computations to use."<br /><br />Do you have a reference for the implementation of this computation?Regorlithhttps://www.blogger.com/profile/13333250664926555342noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-7355699237932934432009-09-08T08:49:45.852-04:002009-09-08T08:49:45.852-04:00Anonymous,
This principle applies whether or not t...Anonymous,<br />This principle applies whether or not the position is held overnight. If the price at the market close suggests that you should continue to be in that position, then by all means do so.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-30730004780402206332009-09-04T02:18:12.986-04:002009-09-04T02:18:12.986-04:00Ernie,
What are your thoughts on applying this (o...Ernie,<br /><br />What are your thoughts on applying this (or any other) principle to whether to leave overnight positions in momentum and reverse trades, profitable or not?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-88533744010440765392009-08-12T20:45:03.388-04:002009-08-12T20:45:03.388-04:00Benjamin,
Thank you for sharing your well-thought-...Benjamin,<br />Thank you for sharing your well-thought-out approach.<br /><br />We all accept that real-life spreads do not really have a normal distribution. Thus 4 or 5 sigma events are abnormally frequent. And z-scores are just a convenient way to model part of the distribution. <br /><br />Hence my opinion is that a 5-sigma event does not necessarily mean that the pair is no longer cointegrated. Only a persistent 5-sigma deviation would do that -- but then, the model would have told you to exit the losing position anyway, (by virtue of the un-cointegration), without resorting to an arbitrary stop-loss rule.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-79090528831305161232009-08-11T05:16:53.580-04:002009-08-11T05:16:53.580-04:00Here’s the approach I use for “stop losses” in ETF...Here’s the approach I use for “stop losses” in ETF pair trading ... <br /><br />I am comfortable that the approach is A) faithful to LIP (“Latest Information Principle”), while B) also recognising that you can never KNOW with 100% certainty what is going to happen next in the market no matter how good your model is (thank you Mark Douglas, “Trading in the Zone”!).<br /><br />BTW, I’m new to trading (“algo”, or otherwise) so this approach is simply me reading around the topic and applying what I, IMHO, think is common sense.<br /> <br />When I identify a good candidate pair of ETFs, I note the maximum z-score recorded for the spread over the backtested time period. In general, over several years of daily data I am comfortable if I see up to 3 short spikes up to a maximum z-score between 3 and 4 (if I see substantially more than, say, 3 spikes like this, I question the whole premise of whether this pair of ETFs is actually any good for the strategy!).<br /><br />Having noted the maximum z-score attained in the backtest (and using the principle that “real life” will often push to, and a little beyond, whatever the backtest sample data suggested were the boundary parameters!) I add an extra 15% to determine a parameter “MAXIMUM ALLOWABLE Z-SCORE”. <br /><br />If I am holding a position, I am relaxed for as long as the z-score remains below this value (as I believe the position is still behaving as it should do within the bounds of the backtest, i.e. this is faithful to LIP). <br /><br />However, if it crosses across this threshold, I then close the position as a) the pair no longer seems to be behaving as I observed it did in the past, and b) it’s behaving in a manner that calls into doubt the whole validity of the z-score statistic itself (i.e. “N normalised standard deviations from the mean spread” ... how can this definition make sense if z-score has a value of over 4 for a sustained period of time?!).<br /><br />Having my exit point defined in this way before I enter a position also helps me pick only the trades where the ratio of potential profit to potential loss is acceptable, and to ignore the rest. In practice, I end up taking the “deeper value” positions.Benjaminhttps://www.blogger.com/profile/03688597693578841376noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-82905050070942982062009-07-29T10:41:31.914-04:002009-07-29T10:41:31.914-04:00Hi Anonymous,
Thanks for your comments... but I di...Hi Anonymous,<br />Thanks for your comments... but I disagree that stop loss is an effective risk management tool. As I explained before, when a major news event occurred that cause a big discontinuous drop in stock prices, no stop loss can prevent you from losing a large amount of money.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-82661652754184443082009-07-29T10:28:50.112-04:002009-07-29T10:28:50.112-04:00Vicky,
You can read my article on Larry Connor'...Vicky,<br />You can read my article on Larry Connor's book http://epchan.blogspot.com/2009/06/good-book-for-quantitative-traders.html<br /><br />It contains several mean-reverting strategies worth investigating.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-25984567938039973992009-07-28T14:56:52.924-04:002009-07-28T14:56:52.924-04:00You always trade with a stop loss - it is your acc...You always trade with a stop loss - it is your account size if you do not choose one for yourself.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-34903640559669549202009-07-28T14:33:49.810-04:002009-07-28T14:33:49.810-04:00Hello, Ernie!
I first read your article about sto...Hello, Ernie!<br /><br />I first read your article about stop loss and found it refreshing. Now I read your "Principle of Latest Information" and thought it could be paraphrased as "if you use one model to enter, you should use the same model to exit." It all makes sense but...what happens if the model (or strategy) is NOT 100% correct? And we all know no strategy is 100% correct. Stop loss is a crude and yet elegant way that allows us to trade an imperfect but winning strategy day in and day out. It is elegant because with it we do not have to concern ourselves with knowing everything. We can either embrace stop loss or live in the hope that our model is always right. It appears that, while the Principle of Latest Information is an excellent guideline for exiting a position as expected, stop loss is foremost a tool for risk management. The confusion might come fom the fact traling stop are often used to exit a profitable position.<br /><br />Thank you for the opportunity to exchange ideas!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-70923124872598194662009-07-28T10:37:57.091-04:002009-07-28T10:37:57.091-04:00Hi Ernie,
I am a day trader trading crude oil fut...Hi Ernie,<br /><br />I am a day trader trading crude oil futures. My main area of interest in Mean Reverting Strategies. Could you please suggest me some book related to Mean Reverting Trading.<br /><br />-VivekVickyhttps://www.blogger.com/profile/14420099635625909711noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-63024657018880943512009-07-10T11:01:43.230-04:002009-07-10T11:01:43.230-04:00Hi Michael,
You can select the best pairs with the...Hi Michael,<br />You can select the best pairs with the lowest (most negative) t-stats.<br /><br />Alternatively, you can select the pairs to trade based on the backtest Sharpe ratio of that pair, assuming you have constructed a mean-reverting strategy on them.<br /><br />Otherwise, your procedure looks good.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-63897159251285953592009-07-09T07:46:47.479-04:002009-07-09T07:46:47.479-04:00Hi Ernie
I know this isn't the right post to ...Hi Ernie<br /><br />I know this isn't the right post to ask this question under but I wasn't sure if you see comments posted to old topics - I have never had a blog so I don't know.<br /><br />I ran a modified version of your cointegration code (Example 7.2) over 500 stocks. Though only 163 are shortable via my broker.<br /><br />This gave me about 2,000 that had tstats less than -3.08 (the approx DF value for 10% critical).<br /><br />For the stocks the z=results.resid result was bounded by various ranges some +/- 0.4, others +/- 1 etc<br /><br />Having got a good tstat and seeing a nice plot around z=0 what is the step to then determine the 'best' or better pair to trade.<br /><br />I was thinking of a zscore as per example 3.6 in your book and then entering +/2 std deviations.<br /><br />Am I on the right track?<br /><br />Thanks<br /><br />Michael<br /><br />PS. Wish I could get to your UK courseAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-47849267900398564182009-07-08T12:14:55.110-04:002009-07-08T12:14:55.110-04:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-4735569241641876002009-07-07T20:23:53.990-04:002009-07-07T20:23:53.990-04:00Hi Lofgee,
What you described was answered in my p...Hi Lofgee,<br />What you described was answered in my paragraph: "(Now, if we hold this losing long position long enough, the model will incorporate new historical prices into determining its long or short signals as it retrain itself, as the Principle of Latest Information says it should! At that time, it may indeed recommend that we exit the previously held long position at a loss. But this adjustment takes place at a much longer time scale, and therefore cannot really be considered a stop-loss in its usual sense.)"<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-39441043219268451602009-07-07T16:45:23.117-04:002009-07-07T16:45:23.117-04:00Hi Ernie,
I am just wondering what will happe...Hi Ernie,<br /><br /> I am just wondering what will happen if the regime changes and prices would never revert to its previous mean. In this case, would the stop loss help.<br /><br />LofgeeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-61710170311850150382009-07-06T14:28:24.451-04:002009-07-06T14:28:24.451-04:00Hi Anonymous,
The critical values are very much de...Hi Anonymous,<br />The critical values are very much dependent on the data you used. I believe I included some historical data for use with this example, so if you use that, the critical values should be the same. <br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-71518803263258159372009-07-06T07:31:07.365-04:002009-07-06T07:31:07.365-04:00Hi Ernie
I know this question isn't relevant ...Hi Ernie<br /><br />I know this question isn't relevant to your interview article but I just bought your book and ran Example 7.2.<br /><br />I downloaded the spatial-econometrics toolbox as the text says.<br /><br />My critical values are:<br />1% Crit Value -3.902 <br />5% Crit Value -3.327 10% Crit Value -3.037 <br /><br />yours are different -3.819,-3.343,-3.042, so our t-statistics are different.<br /><br />Is that because the DF critical values are dependant on the number of samples and you must have run a different number of dates to what is on the website??<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-91797007942446029682009-07-03T17:50:08.637-04:002009-07-03T17:50:08.637-04:00Rob,
You are correct to say that we should update ...Rob,<br />You are correct to say that we should update our positions with the latest analysis -- this is what I advocate with the Latest Information Principle (hat tip to Greg). However, in the absence of news, just because the trade goes the wrong way may not provide new information about your model. It could just be random fluctuation. I am not sure that a Bayesian model would incorporate short-term prices in updating the prior.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-48500131979159299352009-07-03T17:46:03.638-04:002009-07-03T17:46:03.638-04:00Hi bwc2000,
Kelly formula need to be applied only ...Hi bwc2000,<br />Kelly formula need to be applied only when you only have one pair position in your account that threatens to wipe out your equity. Typically, a trader has multiple pairs in an account, so the loss in any one pair is not significant. In this case, there is no need to reduce the position in the face of loss. In fact, one should increase the position linearly proportional to the loss.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-40756407665220559112009-07-03T10:46:57.815-04:002009-07-03T10:46:57.815-04:00Ernie,
Interesting post, but I'm going to arg...Ernie,<br /><br />Interesting post, but I'm going to argue this from a Bayesian Decision Theoretic POV, so I would have to disagree.<br /><br />Whether we realize it or not, there is always some prior probability that our model is wrong--horribly wrong. Your argument assumes that your model is 100% correct, which we should never do.<br /><br />A mean reversion model might recommend adding to losing trades, and that may be good advice. If the expected returns on the funds after adjusting for various risks (including model failure), then we should add to the position. <br /><br />Indeed, these scenarios should be planned for before even putting on a position. <br /><br />It may, however lead to ruinous losses when the model is trading in the wrong type of regime, as others have pointed out. <br /><br />Ideally, we would need to use Bayes' Theorem, and a subjective, informative prior probability to figure out if the new data is consistent with our model (ie. we are in a mean reversion environment), or some other model (ie. a trending regime that goes against us). <br /><br />With our priors, we could generate data to calculate the odds (ie. likelihood ratio) that our model of the market is still appropriate. <br /><br />If after an analysis of all of the information, (info from our prior beliefs, and the new evidence) says our model is still probably correct, then add to the trade. <br /><br />If we aren't sure, perhaps we should either do nothing, or possibly even get out.Rob Ryleyhttps://www.blogger.com/profile/01706863450544932517noreply@blogger.com