Friday, May 03, 2013

Nonlinear Trading Strategies

I have long been partial to linear strategies due to their simplicity and relative immunity to overfitting. They can be used quite easily to profit from mean-reversion. However, there is a serious problem: they are quite fragile, i.e. vulnerable to tail risks. As we move from mean-reverting strategies to momentum strategies, we immediately introduce a nonlinearity (stop losses), but simultaneously remove certain tail risks (except during times when markets are closed). But if we want to enjoy anti-fragility and are going to introduce nonlinearities anyway, we might as well go full-monty, and consider options strategies. (It is no surprise that Taleb was an options trader.)

It is easy to see that options strategies are nonlinear, since options payoff curves (value of an option as function of underlying stock price) are plainly nonlinear. I personally have resisted trading them because they all seem so complicated, and I abhor complexities. But recently a reader recommended a little book to me: Jeff Augen's "Day Trading Options" where the Black-Scholes equation (and indeed any equation) is mercifully absent from the entire treatise. At the same time, it is suffused with qualitative ideas. Among the juicy bits:

1) We can find distortions in the 2D implied volatility surface (implied volatility as z-axis, expiration months as x, and strike prices as y) which may mean revert to "smoothness", hence presenting arbitrage opportunities. These distortions are present for both stock and stock index options.

2) Options are underpriced intraday and overpriced overnight: hence it is often a good idea to buy them at the market open and sell them at market close (except on some special days! See 4 below.). In fact, there are certain days of the week where this distortion is the most drastic and thus favorable to this strategy.

3) Certain cash instruments have unusually high kurtosis, but their corresponding option prices consistently underprice such tail risks. Thus structures such as strangles or backspreads can often be profitable without incurring any left tail risks.

4) If there is a long weekend before expiration day (e.g. Easter weekend),  the time decay of the options value over 3 days is compressed into an intraday decline on the last trading day before the weekend.

Now, as quantitative traders, we have no need to take his word on any of these assertions. So, onward to backtesting!

(For those who may be stymied by the lack of affordable historical intraday options data, I recommend Nanex.net.)

===

There are still 2 slots available in my online Mean Reversion Strategies workshop in May. The workshop will be conducted live via Adobe Connect, and is limited to a total of 4 participants. Part of the workshop will focus on how to avoid getting hurt when a pair or a portfolio of instruments stop cointegrating.

28 comments:

Neil said...

Excellent post.

Tom said...

I think options are actually very simple, the difference is there are more strategies "out of the box" than other tradables.

Determining probability of win/lose is very straightforward, although it can be challenging to decide expiry dates (too soon and price may not move enough).

Some plays are basically sucker bets....tiny chance to win big bucks while other plays barely get you breakeven. I've had the best success with directional strategy- looking at volatility and whether stock price overextended at rally or fade. It takes a lot of practice because the biggest issue is timing.

I think Black-Scholes is outdated, and although it is popular there are much more accurate pricing models that better account for tail risks. I use the trinomial pricing model, but there are Excel and Matlab files for other models too (I've heard that adaptive mesh is good one). Global-derivatives.com has a bunch.

Aside from timing my biggest complaint is commissions. In general the fees are higher than any other security I've traded. If I was larger trader (i.e. more than 1 contract a side) this would probably not be such a big deal since you get bulk discount. But for smaller traders it's a killer.

You can box spread indexes (riskless) but the commissions are too high to take advantage unless you trade many contracts. Someone with floor access could easily make a bundle. And if you get broker with good API it would not take much effort to code up automated options strategy.

Anonymous said...

Have you seen Moodley's paper on the Heston Model? He includes the Matlab code.


http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf

Ernie Chan said...

Thanks all for the comments and links!
Ernie

HK said...

Hi Ernie,

Good post. I am thinking about creating my own trading system, is there any book recommendation?

This book: Building Automated Trading Systems: With an Introduction to Visual C++.NET 2005 (Financial Market Technology)

http://www.amazon.com/Building-Automated-Trading-Systems-Introduction/dp/0750682515/ref=cm_cr_pr_product_top

Author info:
http://www.stuart.iit.edu/about/faculty/benjamin_vanvliet.shtml

seem like alright but the author is a professor and never worked in financial industry.

I cannot find any other book that focus on the programming part of creating trading system.

Thanks.
-HK

Ernie Chan said...

Hi HK,
Are you focusing on a backtesting program, or a live execution program?
Ernie

HK said...

Hi Ernie,

I want to do both, but definitely work on backtesting first.

-HK

Ernie Chan said...

Hi HK,
For the programming aspects of backtesting, I don't see why you need to read any book in addition to mine. However, to find new trading ideas to backtest, you can read some of the Recommended Books that I listed on the right sidebar.
Ernie

HK said...

Hi Ernie,

I mean building my own trading platform to do backtesting and live trading. Do you mean I can just use excel or matlab to backtest as you describe in your book?

Thanks,
HK

Ernie Chan said...

Hi HK,
I would recommend that you do your backtest in Matlab.
Ernie

HK said...

Hi Ernie,

Thanks.

If I will use hsi future to trade, can I use the hsi index to backtest? Because the index is continue while the most active future is always the current month future and it always expires at the end of each month, so it is very hard to backtest it. I know I can somehow calculate and connect the futures month by month, but would it be reasonable if just using the index to backtest? My strategy will be holding days or weeks but not day trade kind.

My strategy is only for hsi future, so I backtest it with hsi/hsi future data. If I can come up with a good Sharpe ratio and better than normal benchmark, is there any good way to show it is not because of random and luck but the strategy truly has some prediction ability?

-HK

Ernie Chan said...

Hi HK,
You can backtest on HSI index to get a rough idea of your strategy's profitability, but I would not trade real money with it unless I backtested it with futures data.

The best way to detect data snooping bias is to forward-test/paper trade your strategy for a few months.

Ernie

DR said...

Not a big fan of Taleb. Don't know why this fragile/anti-fragile verbiage seems to have caught on so widely in the trading world.

There's a perfectly fine pre-existing way to talk about these concepts: skew and kurtosis. One can just as easily speak on whether a strategy has positively/negatively skewed returns or fat/thin tails.

Moreover these concepts fit into an already very well grounded and rigorous framework of the (co-)moments of a probability distribution. In contrast if you actually look into how Taleb tries to mathematically define "fragility" you'll find an incoherent, contradictory and very unrigorous mess.

Despite trying to present himself as some sort of revolutionary think in the world of mathematical statistics no one even pays attention to him.

HK said...

Hi Ernie,

Thanks. High frequency trading has been more than half of the transaction volume in US market, does it make it much harder for non HFT speed traders to make money because HFT may destroys a lot of "used to work" predictable factors? Just like simple trend following may works in like 25 years ago but it doesn't work in this decade.

-HK

Ernie Chan said...

Hi HK,
Definitely HFT makes it harder to make money for slower algos, especially for stocks.
Ernie

Anonymous said...

Hi Ernie,

i am retail trader and interested in algo trading. I am currently going through your book and i must i really like it. Anyway i have couple of questions.

1. I see that you try to keep math at minimum in your book, but what subjects of math should i know for algo traidng.(I have working knowledge of single variable calculus)?

2. What do you think of Metatrader 4 or 5 as trading platform(Backtest in MATLAB).

3. Is it possible for retail to find returns in fx trading on really short term time scales(from seconds to couple of minutes)?


Thank you

Ernie Chan said...

Hi Anon,
1) For statarb, statistics is the most important math, followed by linear algebra. First year college level math is enough.

2) Metatrader seems fine for executions.

3) It is hard to find retail FX trading opportunities shorter than a few minutes.

Ernie

Anonymous said...

Hi Ernie,

Do you believe that we can scalp Forex using Bollinger band?

Thanks.

Ernie Chan said...

Hi Anon,
Sure, you can use Bollinger bands for FX mean reversion strategies.
Ernie

Anonymous said...

Hi Ernie,

Thank you for quick response.

Do you mean we can scalp one currency pair (e.g. EUR/USD) or trade long/short (two pairs) as we trade stocks/ETFs?

I am looking forward to read your new book. The "Contents" look very nice.

Do you read Irene Aldridge's "High Frequency" 2nd edition? Do you have any comments?

Thank you.

Ernie Chan said...

Hi Anon,
You would have to come up with the specific strategy and pairs for Bollinger bands, of course. But sure, you might try that on EURUSD or EURCHF on their own.

I haven't read Aldridge's book yet. Do you recommend it?

Ernie

Anonymous said...

Hi Ernie,

I only read Irene Aldridge's 1st edition which is a little bit like literature review.

It is said she provides tick data and some tools on the website with her 2nd edition.

Therefore, I may buy your new book and hers to read.

I expect that you may provide some useful strategies on currency and futures which individual traders may be able to implement.

For Irene Aldridge's book, I only expect that I may know something new in high frequency area, but I do not think individual traders can implement low latency strategies.

Thanks.

HK said...

Hi anonymous,

Of course you can use Bollinger bands for FX mean reversion strategies but you need to find out if you can win money from it or not. We can use whatever strategy we want to trade, the question is just can you constantly make money from it.

-HK

Reid Minto said...

Hi Ernie,

(Stats grad student who just started following your blog here) -- I wanted to comment on the use of OLS and WLS. For those who may not know, WLS is a special case of Generalized Least Squares (GLS) when we have no autocorrelation in the model errors (in other words all the off-diagonal terms in the covariance matrix are zero). GLS outperforms OLS (among all other linear unbiased estimators) in terms of efficiency when there is heteroskedasticity (non-constant variance) and/or autocorrelation in the error terms by essentially weighting observations according to the magnitude of the model errors. If you use GLS/WLS and choose the weights according to time periods instead of giving relatively larger weights to observations with smaller errors and giving less weight to the ones with larger errors, then you will indeed get some funky results which I think explains why you weren't getting better results using WLS over OLS. If there is strong evidence of heteroskedasticity and/or autocorrelation (usually at least autocorrelation in financial time series) then WLS/GLS should give you better results than OLS.

BTW - Great blog. I'm just recently getting into computational finance and I'm enjoying your blog along with all the comments. It's been very helpful.

Tom Starke said...

Hi Ernie,

in point (1) you say that spikes in the volatility surface might result in interesting arbitrage opportunities. How, in your opinion, could those be exploited?

Thanks, Tom

Ernie Chan said...

Hi Tom,
Suppose we find the implied volatility based on call options at a particular strike and expiration is a local valley on the 2D surface, we may expect it to go higher in the future, and thus buying call options now would be profitable.
Ernie

Max said...

Hi Ernie,

I'm having difficulty contacting Nanex.net to request a quote. Do you have a ballpark estimate of the price per exchange that these guys charge for historical option data?

Many thanks,

Max



Ernie Chan said...

Hi Max,
Nanex charges approximately $2.5K for a year of data from 3 exchanges.
Ernie