Thursday, April 26, 2012

A few announcements

First, an iPad version of this blog has been launched, so if you are reading this on an iPad, the look will be different. If you want to go back to the old look, just hit Page Turn in the bottom left corner and choose the option there. Any comments or suggestions on this new look are most welcome!

Second, and this is probably irrelevant to most of you reading this blog, a Chinese translation of my book Quantitative Trading is now available.

Third, and most interesting, Larry Connors will be hosting a webinar on "How to Trade High Probability Stock Gaps" on Tuesday, May 1, 2:00pm ET. (Click on link to register.) It is sheer coincidence that I was just writing about stock gaps in my previous post! I have always found Larry's strategies to be clear, concise, and simple - exactly the ingredients for out-of-sample as opposed to in-sample returns!

59 comments:

Anonymous said...

hi Ernest

.Do you have any plan to publish your second book?

ek said...

I find that Connors doesn't provide risk adjusted returns or robustness tests in his books, although I have to say that I enjoy reading them. Ec do you still reside in Toronto?

Ernie Chan said...

Hi Anon,
Yes, I just started writing a second book and plan to publish sometime in 2013.

ek: We shouldn't take any published strategies "as-is". We should always backtest and modify them ourselves.
I reside in Niagara-on-the-Lake.

Ernie

Ernie Chan said...

Hi all,
Just a quick reminder about Larry's webinar tomorrow -- make sure you register online beforehand!
Ernie

LWL Investment Group said...

I missed the webinar today. Do we have it recorded? If yes, could you please put it online? Thanks a lot!

Weifei

Ernie Chan said...

Actually, Larry postponed it till end of May. Please register online to get on the email list.
Ernie

Anonymous said...

If a trader could make money with the methods he is teaching then (a) he would not have time to teach (b) he would not reveal his edge.

No rational trader will ever teach a method that works. People that teach trading methods are either irrational or do not trade. There may be another class that deceives traders purposely with losing methods and takes the opposite side, just like market makers do. This is speculation from my part.

I expect the counterarguments and I tell you that teaching trading is not like teaching math. Math is a positive sum game whereas trading is a negative sum game.

Ernie Chan said...

Hi Anon,
Naturally, I disagree with you!

My counter-argument is based on my own experience.

I used to work at banks and hedge funds as their prop trader. We are not allowed to discuss our strategies even with colleagues in another group. The result: I never made a dime for my employers, nor do I know of any colleagues that have done so consistently.

Once I started to write my blog and discuss bits and pieces of my strategies, and further teach classes on the basics of these strategies, I have learned far more from my readers and "students", so much so that I have no problem coming up with live trading profits anymore. Most of my strategies come from ideas that are triggered by readers' comments or emails. (An example was in my previous post's comment section.)

As I emphasized in my book, nobody will disclose a profitable strategy in its entirety to you. But books and classes are still valuable because they serve as inspirations for your own ideas, and they teach basic techniques that are valuable to any strategy.

Professional traders are often on the phone many times a day with colleagues in another institution. Do you think their colleagues will spill all their secrets to them? If not, what do they talk about? The weather? No, the sum of information increases between the communicating parties, at the expense of traders who do not communicate. So while it is a zero-sum game, it is our own loss if we don't give and take from other traders.

Ernie

Anonymous said...

Hi Ernie, in the previus post you said:"I have seen some strategies that have the opposite behavior: poor performance prior to 2009, and stellar performance since then"

Could you give us some info?
Thanks

Ernie Chan said...

Hi anon,
Generally, I find short-term momentum strategies didn't work as well before 2009.
Ernie

millman said...

Hi Ernie,

I have a couple of back-tested only strategies on the SP emini that I am not sure whether to continue investigating as I am new to quantitative trading. The holding periods would vary from a few minutes to a few hours. Both rely on tick data.

Both enter at a price target and exit at a count of ticks. The first has a shorter holding period, and the average profit per trade is 1 tick before costs and slippage. It has a unlevered Sharpe ratio of 4. It is based upon tick bars of 5000.The second has an average profit per trade of 2 ticks, and an unlevered Sharpe ratio of 3. It is based upon tick bars of 25000.

Given your experience, are either of these worth pursuing further?

I am concerned that the profit per trade will be very tight, if it would exist at all, after I take into account the bid/ask spread, slippage, and commissions.

I have used TickData for historical data, and suppose if I did proceed would need to begin by finding a live data feed from a brokerage house (like IB) whose data is a relatively close match to TickData's.

Any suggestions or comments would be greatly appreciated.

Ernie Chan said...

Hi millman,
If your ES strategy can be implemented with limit orders, then 1 tick round trip profit is reasonable. But we don't know what opportunity cost you will incur. The only way to find out for sure is to paper trade it, or even better, trade it live with small size.
Ernie

Anonymous said...

Hello Dr Chan,

in yuor 2nd book, can you discuss how to do stat arbs or spreading for spot currency?

spot currency is rather different as by nature it is already in a pairs.

thank you.

Ernie Chan said...

Hi Anon,
Yes, in fact I have a section on trading FX pairs in the new book.
Ernie

Zarbouzou said...

Hi M chan,
Based on your book and blog, you seel to use co-integration in pair trading. Does you coming book treat the problem of co-integrated systems with more than two variables. You have talked before about methods closed to the one of avellaneda and lee. Have you got any chance with other methods to build such systems? Do you mention these methods in your next book?
In particular I have two problems with their method:
1/ They use a single linear equation with ADF test instead of a VAR/VECM approach with johansen test.
2/ They use all the stocks (series) to build their model which results in high transaction costs.

One simple way to go about the second problem would be to use best subset, forward-backawrd selection or least angle regression to select the best model.(All these based on a co-integration statistic) Any thought on that?

Thanks in advance and sorry for the multiple questions.

Z

Ernie Chan said...

Hi Zarbouzou,
Yes, in my new book I discussed using Johansen test for cointegration, which can test multiple time series together.

Typically, Johansen test will give you a subset of time series which cointegrates best, with large coefficients for only a few stocks, so you won't have problem with transaction costs.

Ernie

Ernie Chan said...

Hi all,
An update on Larry Connors' webinar on gap trading: it will happen next week. You can register here: http://presentations.tradingmarkets.com/1580186/special-presentation-to-ernie-chans-trading-group-connors-research-trading-strategy-series-w?utm_source=CREmailPartner&utm_campaign=None&utm_medium=EChan

Ernie

Zarbouzou said...

Thanks for your answer,
Weirdly enough while there are numerous papers on pair trading, I can't find any paper that uses johansen tests for mean reverting baskets (>2 securities). Do you have any reference?
Z

Ernie Chan said...

Hi Zarbouzou,
No, I am afraid I have not read any papers on using Johansen test on trading stock baskets. I am afraid you would have to do the research yourself.
Ernie

Anonymous said...

Hi Ernest,

I am following you blog with great interest, thanks for sharing your ideas! As being interested in the industry, i wonder how lucrative quant trading for the providers of the algorithms is. Say i managed a proprietary quant fund for one or more investors that generates 20% return per year. What percentage of that would i be able to keep as the algo provider? In other words, how is the return splitted between the providers and the investors?

For the record, I am not asking about your paycheck, more about what is common in the industry.

Ernie Chan said...

Hi Anon,
Typical incentive fee due the fund manager is 20% of the profits.
Ernie

Anonymous said...

Hello Dr Chan,

may i know for intraday cointegration test how many data points are considered necessary and sufficient?

Ernie Chan said...

Hi Anon,
I don't think running cointegration tests on intraday prices make sense, since you can't concatenate all the different days data together (assuming we are dealing with stock prices).
Ernie

Anonymous said...

Hello Dr Chan,

I was thinking of testing for cointegration on m5 and higher bars for forex.

Ernie Chan said...

Hi Anon,
For any markets, there is no reason to test for cointegration at any frequency other than daily. Higher frequency data does not give better test statistics, since the data would be serially correlated.
Ernie

Anonymous said...

Hello Dr Chan,

many thanks, i was thinking that if we test for cointegration using different time frames, we can get different degrees of conintetration.

e.g M5 may show 2.5SD while H1 will show 1.5SD, so we can make trades on M5.

am i being mistaken?

best regards.

Zarbouzou said...

Hi,
Does this mean that you don't trade pairs (based on cointegration) intraday or just that you don't test for cointegration intraday.
While I theoreticaly agree with you about about concatenation, wouldn't this be the same problem for any model driven strategy?
Z

Ernie Chan said...

Hi anon,
You can certainly trade at different time scales. But cointegration is not the way to compute that. If a time series does not cointegrate in long time frame, it won't cointegrate even if you increase the sampling frequency. However, you can indeed test cointegration on this high frequency data one day at a time, without testing all these days together.
Ernie

Ernie Chan said...

Hi Z,
I certainly trade pairs intraday. I just would not use cointegration to test on the concatenated data set, since that is a meaningless procedure for my trading strategy.

I don't know what you mean by saying this is a common problem for any strategy. For strategies that hold overnight positions, it is obviously useful and important to test for cointegration on daily prices concatenated together.

Ernie

Zarbouzou said...

Hi Ernie,
What I meant is that if you concatenante the series of say 5mins bars of different days and build a model on price/return you will have a problem to fit a model to such series. The returns from close of the day to open of the next day will certainly not have the same agnitude as the returns from 5mins bars which could be seen as a deterministic heteroscedastic effect.

Zarbouzou said...

Completly unrelated, do you know good references (reviews are even better) on optimal order execution algorithms? I'm not thinking of very large orders but more optimaly sending orders for equity/futures quant trading.
Z

Anonymous said...

Hello Dr Chan,

thanks for the explanation.

just to check if i am correct:

1) check for cointegration on daily prices

2) if 2 pairs are conintegrated on daily TF we can trade the pairs on intraday TF to get better entry prices.

i have another question:

If 2 pairs are cointegrated, does it mean it will alo be cointegrated on weekly TF?

best regards.

Ernie Chan said...

Hi Z,
I agree with exactly what you just said. If you are not trading FX which has data 24 hours a day, there is no sense to concatenate intraday data to test for cointegration. But that certainly does not prevent me from trading stock pairs intraday!
E.

Ernie Chan said...

For optimal execution, the classic paper is "Optimal Execution of Portfolio Transactions" by Almgren and Chriss.

Ernie Chan said...

Hi Anon,
Correct.

Yes, if 2 pairs are coint with daily prices, they should coint on weekly prices too.
E.

Anonymous said...

Hi Ernest,

I have learnt alot from your blog and book. I have a basic question regarding the usage of data for FX trading.

Given FX trades 24-hours, the Open,High,Low and Close data obtained might differ between a user in say Asia versus London versus US.

Does it matter in backtesting which data to use or if it works in one set of data, it is bound to work on other timezone datasets?

Thanks.

Ernie Chan said...

Hi Anon,
Yes, you should make sure that the open and close refers to 17:00 ET. And if not, you have to be careful with strategies that refer to specific times of open/close.
Ernie

stmoneymantra said...

i found your blog very useful in getting knowledge about trading.i am a great fan of larry conner.i found your articles on quantitative trading very useful.your first book is remarkable. i am waiting for your second book so eagerly.

Noah said...

Hi Ernie,
On a slightly unrelated topic, are the subfolders and util folder for your cadf function still available on your website? I purchased your book, and went on to the premium content page but couldn't find it there.


Thanks,
Noah

Ernie Chan said...

Hi Noah,
I did not create the cadf function. You can get this function from the spatial-econometrics.com package. Remember to add ALL the subfolders of that package to your Matlab path in order to use any function!
Ernie

Anonymous said...

Dr Chan,

for mechanical trading system, have you ever try Design of Experiment techniques to test and optimize the parameters?

Ernie Chan said...

Anon,
I don't normally spend much time optimizing parameters. I believe that optimal parameters in-sample are usually not optimal out-of-sample.
Ernie

Anonymous said...

I tried the link again. Is there any place to view the recorded webinar?

Thanks

Ernie Chan said...

Anon,
The recorded webinar can be viewed at http://tradingmarkets.adobeconnect.com/p7jkbjhy3tx/
Ernie

Anonymous said...

Hi Ernie,

regarding half life. You advocate regressing change in spread onto the spread as in a OU process.

How about fitting a standard AR(1) to the spread instead and compute the half life based on the ar-coefficient? Would that be correct?

Thanks,
Thomas

Ernie Chan said...

Hi Thomas,
No. Mean-reverting process is represented by an error-correction model. I.e. it is an autoregressive model of first differences, and not in the prices themselves. So you cannot obtain the half-life from an auto-regression of the prices.

See the documentation of the spatial-econometrics.com package for details.
Ernie

Anonymous said...

Thanks Ernie. But an AR(1) is simply the discrete time counterpart to an OU process. So should be fine to fit an AR(1) to the spread (not the prices) I think.

/Thomas

Ernie Chan said...

Hi Thomas,
I know that the Wiki article on OU claims that AR(1) is the discrete version of OU, but I disagree. Error correction models are not the same as AR(1).

Also, when I said "price", I meant the price of the spread. The price of one side of the spread does not mean revert and so we don't even want to model it.
Ernie

Anonymous said...

Ernie,

Well, it is a well established fact and not only something Wikipedia claims.

OU in discrete time:
x_t+1-x_t=theta*mu - theta*x_t + dW

Rewrite as AR(1): x_t+1=theta*mu+(1-theta)*x_t

Hence the constants are identical and the autoregressive coefficients tightly linked.

The half-lifes are not identical but close enough.

I don't think one lose any information by simply estimating the half life from a standard AR(1).

/Thomas

Dennis said...

Hi,
If I buy the Chinese translation of your book, can I find the password also?

Ernie Chan said...

Hi Dennis,
Yes, the password is also in example 3.1 in the Chinese translation.
Ernie

Noah said...

Hi Ernie,
Is it possible to put constraints on the regression.betas from the spatial econometrics function ols? If not, is it possible using the matlab fucntion regress?

Thanks a lot,
Noah

Ernie Chan said...

Hi Noah,
No, ols does not accept constraint. If you have Matlab's Statistics toolbox, you might be able to find a constrained regression function. I know they have, for example, stepwise regression.
Ernie

Anonymous said...

Hi Ernie,

Thanks for a great blog.

Do you think it is important to use intraday day when backtesting pairs-trading as opposed to only closing prices?

I have realized that many strategies look much better than they actually are when I use closing prices.

The problem is that you can't trade on closing prices...

Any thoughts on this?

Thanks,
Jack

I

Ernie Chan said...

Hi Jack,
Yes, if you can use intraday prices to backtest, then it eliminates/reduces slippage as one source of transaction cost. But you can also use primary exchange closes to backtest: such closing prices can be achieved in reality with little slippage.
Ernie

Swiss_Dragon said...

I bought the chinese translated book in Malaysia ^_^

Ernie Chan said...

Hi Swiss_Dragon,
Enjoy!
Ernie

AMIT said...

Respected Sir,

Let me first congrats & thank you for your wonderful post .sir my name is amit,from india, i am a NanoTech.professional,i also wanna to learn analytics for trading,please guide me how to start from scratch as i am novice in this field .your little guidance will change the life of many layman like me.

sir i can offer free on/offline assistance to any assignment.




Warm Regards
AMIT (bigfm987@yahoo.in
)

Ernie Chan said...

Hi Amit,
I suggest you start by reading my book "Quantitative Trading".
Ernie