The article below first appeared in the Nov/Dec 2012 issue of YourTradingEdge Magazine and has been reprinted here with their permission.
Ben Power is a writer, journalist and trader. He has written on politics, economics and finance for numerous publications.
Rob Hanna is a full-time trader and publisher of the highly regarded Quantifiable Edges website.
Hanna became attracted to trading when he worked as an investment software salesman. His initial forays used popular strategies, such as William O’Neil’s momentum system, CAN SLIM.
He had initial success, but was hit by a slump in 2004, prompting him to closely review his trading and to launch his first quantitative study.
Hanna now trades like a research scientist, watching markets closely – price, breadth, volume, sentiment and other indicators – for something unusual. He then uses historical data to test how a similar scenario played out in the past, then determines whether that gives him an edge.
Hanna’s scientific method, which was featured in Dr Brett Steenbarger’s book ‘The Daily Trading Coach’, gives him a tested edge and a dynamic process that allows for changing markets.
One of Hanna’s favourite strategies is overnight trading. A lot of news happens when the market is closed, and he has found fertile edges in trading the gap between market close and open. His new product Overnight Edges publishes research on overnight trading.
Hanna spoke with YTE’s Ben Power about how he finds and tests for edges, how he backtests, when he takes profits, overnight trading and whether CANSLIM still works.
How did you get into trading?
My first intro to trading came in college when I had a summer internship at Garvin Guybutler inNew York. I worked on the desk that traded overnight Fed Funds. However, I went to college in Boston, and after graduating, decided I wanted to stay in the Boston area. A few years out of school I ended up with Thomson Financial and worked in their investment software division selling portfolio management software to large institutions. This gave me exposure to both the front and back office, and I began to dabble in trading stocks. I did a fair amount of CAN SLIM trading, mixing that with short-term swing style and sometimes quick daytrades in the first half-hour or so of trading, and the returns were good.
Can you describe your trading now?
A lot of it is index-based, trading some derivative of the Standard & Poor’s 500. I also trade volatility index exchange traded funds (ETFs) and have found great edges there over the past few years. I trade other highly liquid large cap stocks and ETFs. My strategies are primarily swing trades or overnight. I do some trend trading but no longer dedicate much time to researching it.
Do you make a living from trading?
Yes. I have been a full-time trader since 2001. Although these days, I also have my websites. So I work a few ‘full-time’ jobs.
In 2004 you had a trading crisis that triggered a more quantitative approach to trading. Can you tell us what happened?
It was a great year for me in 2003 – profitable every month, with sizeable gains for me and my investors. The next year started off strong, with mild profits in the first three months.
So after 15 straight months of gains I felt pretty smart, but four of the next five months returned a loss. My strategies, mainly breakout strategies, began to falter. The market entered a rotational period in which one group began to lead then was quickly struck back. A new group started to break out and was also quickly knocked back. I got chopped up quite a bit.
So I did a detailed examination of my trading. Although my strategies did a nice job of catching trends and riding them while they lasted, I was often over-invested near market tops and underinvested (or net short) at market bottoms.
I began some studies to see if other techniques would allow hedging near tops, possibly benefiting from the sharp reversals that happened at bottoms. The studies covered broad market behaviour, sector behaviour, and behaviour of leading and lagging stocks at market turning points. This was my first ‘quantitative’ research study, and it was initially designed to provide strategies complementary to those I was employing.
What are the benefits of a quantitative approach?
A quantitative approach is useful for several reasons. It helped me understand what is working now. Is the market trending or consolidating? Are we seeing follow-through on a daily basis or is the action choppy? What trade types are working and what strategies are struggling? Monitoring and understanding this helps me focus trades in strategies that are working best.
Quantitative analysis is also very helpful in understanding how the market performed in the past under similar conditions. It can alert me to potential changes in behaviour and allow strategy adjustment as I observe the market evolving.
Understanding how the market is likely to act, based on history, gives me the necessary confidence to manage trades in an optimal manner rather than an emotional, reactionary way. This is extremely important. Without this confidence and understanding I could easily be scared out of a trade too early or get greedy and try to hold it too long. Quantitative analysis lets me know when my edge is gone and it’s time to get out.
Where do you find potential edges; ie, where are your ideas generated from?
Most of my ideas come from simple market observations of price action, breadth, volume, sentiment, seasonality, relative strength, and so forth, to note anything unusual. Any unusual conditions are then tested to see if they were predictive in the past.
Nowadays it’s a bit easier than it was four or five years ago. I have a huge stable of studies that often trigger something. So I try to look at things with a ‘clean slate’ each night, but past studies offer things to work with.
Can you briefly explain what a ‘study’ is, and how that might trigger a trade?
A study is a simple back-testing query that examines how the market has performed under certain conditions. Most of the work I publish is based on the idea of comparing the current market setup to prior similar situations.
The question I always ask is whether there are conditions in the market that suggest a significant edge based on historical precedent. I look at years of data and filter it to look only at situations in which the market did something unusual, extreme or interesting.
I then look at how the market performed over the following few days, weeks, or months. If there’s a strong tendency in these results, it is recorded and included in my market analysis.
What software do you use for testing?
I use Tradestation. I don’t know if it’s the best, but I’ve used it for a very long time, and it suits my needs. I have a lot of custom calculations, indicators, and functions built in, so switching to something else at this point would be daunting.
How can the average trader learn how to backtest?
First, traders need a tool that they are comfortable with. That may be back-testing software such as TradeStation, or it could be a spreadsheet such as Excel. For the most part it’s just a matter of digging in and playing with different ideas to see what might help you identify edges.
There are plenty of books and courses available from developers that develop back-testing software. If you want to start with Excel, then I suggest grabbing a copy of Brett Steenbarger’s book ‘The Daily Trading Coach’. A few chapters describe exactly how to use Excel to back-test an idea, and there’s a lot of other great stuff for traders.
When you back test, what results are you actually looking for; ie how do you define an ‘edge’?
Basically I look for a consistent bullish or bearish reaction to the set-up being studied. A simple example is that the market has generally performed very well on the first day of the month, but it was not always the case.
This behaviour began to exhibit itself in the late 1980s. Some attribute it to the rise of 401(k) programs, the retirement savings accounts in the United States. Money is often invested in 401(k) accounts at the beginning of the month, and mutual fund managers need to do something with the excess cash. The increased liquidity lifts the market.
Of course it doesn’t happen every month, but on average the first day of the month has been bullish. To see this and evaluate it I often look at a profit curve of a study that would buy the market at the close on the last day of the month and sell at the close on the first day of the new month. This helps me visualise all the information I’ve mentioned before and see how the edge has played out over time.
Is there a recent example of a research project where you generated a hypothesis and tested it?
Some of the most interesting and helpful research I’ve had over the past few years has been related to US Federal Reserve policies and programs and their influence on the S&P 500.
Through the Permanent Open Market Operations (POMO) the Fed buys and sells securities in order to stimulate or cool the economy. It has maintained a daily operations schedule on its website since 2005.
In 2010 I developed an intermediate-term indicator with a 20-day lookback that would measure the POMO flows. Each day’s value is based on the values over the previous 20 days on a rolling basis. After interest rates were driven down to zero, POMO became the Fed’s number one tool for impacting liquidity.
The net effect of buying treasuries in the open market is an influx of cash into the system. It seems that a portion of that cash makes its way to the stock market and works as a bullish influence. At times when the Fed had net selling there was a contraction in liquidity and the market suffered. My indicator simply counted the number of net buying days over the 20 days and subtracted from that the number of net selling days.
Applying my indicator to a chart shows that over the past seven years there was a very strong correlation between liquidity flows and market performance.
In late 2011 I was inspired to study whether a short-term version of the indicator would be of use. A simple five-day (1-week) lookback turned out to be highly effective. Since then I have looked for divergences between the market and the indicator and it has helped me to spot opportune times for taking positions.
The basic idea is that if the market is oversold and there was a strong inflow over the previous week, then the inflow should be a positive influence. Combined with the oversold nature of the market, a strong upside edge is suggested. It also works when there are strong outflows and the market is overbought.
Do you have an example of how you’ve traded that research?
There haven’t been too many signals this year (2012) because pullbacks have mostly happened when liquidity was not strong (as should be the case). A recent example can be seen in accompanying chart. Leading up to August 30th there had been 4 days of POMO buying versus one selling day. The SPX meanwhile was right near the bottom of its 10-day range. This triggered a long signal. The signal came off four days later when the market exploded higher and the oversold condition was worn off.
Will bullishness to continue with QE3?
It will, for a while at least. The government is trying to engineer a recovery. The influence on the economy is complex, but the effect on the market is more straightforward.
The problem with government-engineered rallies is that the market becomes dependent on stimulus in order to rise. The liquidity effect can easily be seen with my long-term POMO chart. What can also be seen is that it typically takes more stimulus each time for the same effect. This is like drugs to a drug addict: it feels good at first, but then it takes more and more to get the same high. When the drugs are no longer enough, the addict crashes.
The same can happen to the market when liquidity stimulus is no longer enough. But, for now, it seems a reasonable assumption that QE3 will push prices higher for a while.
When you decide to enter a trade?
It depends what I’m trading, but I still use multiple methods. Although I used to primarily be a trend trader, most trades these days are reversion based. With trend trades the buy point is easy – you look for breakout and when it occurs, you buy. Mean reversion entries can be a little more nuanced. Often I will scale-in to positions. Certain systems give me entry signals.
For index trading, which is a large portion of what I do these days, recent price action is compared with recent expectations based on estimates provided by my studies.
Do you have an example?
Assume that over the past three days the estimates from my studies suggest that the market should be up a total of 1%. If the market rises 2% over that period, I consider it overbought and too risky to hold a long position, even if my estimates for the next few days are for further upside.
If the market has risen only 0.75 per cent while my estimates suggested it should be up 1%, then it would not be overbought and I could continue to maintain my long position (or initiate a new one).
And if my estimates were for a 1% rise and the market had declined, then again a long position would be justified.
The combination of an underperforming market with positive expectations or a market that has outperformed and has negative expectations means I want to hold a position.
When do you exit?
When I no longer have an edge. I don’t mean to sound coy, but that is my general rule. It sounds simple, but it takes discipline to get out of a trade when the edge is no longer there. Of course, how this is determined differs depending on whether it is a trend or a reversion-based trade.
You’ve really got only three choices: sell at the exact moment the market tops out, sell too early or sell too late. I haven’t figured out how to do the first one yet. So it’s either the second or third.
For a mean-reversion trade you generally want #2. You bought an oversold condition with an upside edge, and now the oversold condition no longer exists. Your edge has gone. Don’t think twice, take your profits and get out.
A trend trade is the opposite, and you need to commit to #3 and sell too late. You can’t worry whether the market is about to top out. You simply need to stay in the trade until after it does. If you sell before it tops out, you are not doing your job. A top has to be put in to signal that the edge (trend) is no longer present.
When do you cut losses?
Taking losses is much the same. With trend trades I put in a stop point as soon as I get in. But with a reversion-based trade I rarely use stops. If I enter an oversold position and it goes against me, becoming more oversold, in most cases the upside edge is then even greater.
That doesn’t mean I won’t re-evaluate. Index trades are reevaluated every night. If my studies suggest that the edge continues to lie in the direction of my position, then I stick with it. Sometimes studies will emerge that suggest the directional move is more likely to continue against me than to reverse. In those cases, I simply take my lumps and get out.
Just stepping back a bit, a lot of traders are looking for exact rules, and exact entry and exit points – I guess to try and gain some certainty and control — but your trading is a lot more ambiguous and flexible: you’re after tendencies, not rigid rules?
I tend to look at things with shades of grey, rather than black-and-white. Rigid rules are fine, but traders still need to be able to put everything into context.
For instance, if someone is trading a trend-following system for a year or so and making tons of money doing it, they may believe that the system is just a killer, incredible system. In fact, the best system at any point in time is generally the system that is best suited to the current market environment. So the trend following system will continue to make a killing as long there is a strongly trending market. But if the market becomes extremely choppy, the system’s effectiveness will probably suffer.
Traders can elect to muddle through difficult periods when their systems or strategies are not aligned with the market, or they can try and determine what strategies are most likely to succeed based on market conditions and expectations.
I take the second approach. Rather than trying to find the indicators and entry triggers that provide the best backtest, I generally use simple systems, and try to employ them strategically to take advantage of market conditions.
What are some of the popular market myths that you’ve found to be false?
I used to do ‘Mythbuster’ posts on Quantifiable Edges, and I should probably go back and do a few more. Some of the most popular and controversial posts were studies in which I examined Investors Business Daily (William O’Neil’s CAN SLIM) market timing tools, such as ‘follow-through’ days (FTDs), and ‘distribution’ days.
For those who may not be aware, FTDs are used as a bottoming signal. A simplified description is that you wait for a few days after the market has put in an intermediate or long-term low, then look for a strong up day on increasing volume. IBD has changed some of the rules over the years, but the idea remains.
Distribution days are supposed to warn of a market top. The idea is that during an uptrend you look for a cluster of days in which the market declines on higher volume. This is supposed to suggest institutional selling and an impending down move.
In general, I’ve found FTDs to have poor predictability and only mild value. Distribution days are worse. If you are trying to time a market top, and you look to get out after a series of distribution days, that is generally a huge mistake. Much more often you will be selling at the bottom of a short-term pull-back in a longterm uptrend. In my researched opinion, the whole concept of distribution days is wrong, and traders should not try to use them as a way of identifying possible market tops.
Is CAN SLIM still potentially useful?
While I strongly believe the market timing principles are flawed and ineffective, I don’t disagree with everything.
A lot of money can be made buying stocks of strongly growing companies as they emerge from basing patterns and then riding the trend higher. Win rates are generally not very high on these kinds of trades, but they don’t have to be. If you can catch a few good winners a year, as long as you keep your losses small, you can do very well with a CAN SLIM type of approach. I simply suggest traders use different methods for the “M” part of CAN SLIM than those that IBD teaches.
You don’t often talk about psychology. Do you think a lot of trading psychology problems would be solved if traders focussed on research and finding a genuine edge?
Few people make the connection between research and psychology. When I began doing market research and conducting studies on a nightly basis, I found it extremely therapeutic. If I got beat up in the market that day and had a lot of positions going against me, the questions arose: did I do the wrong thing, should I have got out, should I get out now?
By researching the market each night I was able to answer these questions. Yes, I would rather not be this much underwater, but there still seems to be a strong upside edge, so the right thing to do is stay long. Knowing that makes it a lot easier to actually stay long.
It’s when traders don’t know what to do that they panic and make wrong decisions. Knowing the odds makes it a lot easier to stick to your plan and execute your trades in an optimal manner. Conducting the research allows me to make more cold, calculating decisions and reduces emotional strain. It is still an emotional game, but it’s a lot easier controlling those emotions when you know the odds are in your favour.
I mentioned Brett Steenbarger earlier, and he is a great example of the important connection between psychology and research. He is a psychologist. But if you ever read his Traderfeed blog it was filled with research as well. With knowledge comes confidence, and you need confidence to be able to properly execute on a consistent basis in this business.
One of your favourite strategies is overnight trades.
I developed some overnight trading methods late in 2004 and began implementing them the next year. I noted at the time that all the gains in the S&P 500 over the previous 10 years had occurred during the overnight session.
I did some research and found some highly consistent tendencies. That research has been expanded a great deal over the years, and adaptive techniques have been incorporated into my original trading strategies.
Can you explain what they are?
Most market-moving events occur when the stock market is closed. This is partly because the stock market is closed more than 80% of the time. So if a global event occurs there is an 80% chance that the market will be closed.
Additionally, most company and economic reports occur when the market is closed. Companies generally release earnings before the open or after the close of trading. In the US, most economic reports, such as the employment report and CPI, are released before the market open. The large, lone exception is Fed meeting announcements.
Because of this, the market rarely opens exactly where it closed the day before. And, using index futures, you can track market movements around the world nearly 24 hours a day. Overnight trading looks to take advantage of movements that occur when the market is closed.
Where do you exit overnight trades?
The exits there are the easiest of all. I use stops and targets for those trades (though I haven’t always, and neither is necessary). If neither my stop nor target is hit, then I get out right before or at the market open.
It’s one thing I really love about overnight trades – I know when the trade will be done. With day trades you don’t know if the trade will last for minutes or hours. With overnight trades I generally know what time my exit is going to be when I enter it, which makes it very easy mentally.
Can you tell us about your new product Overnight Edges?
Overnight Edges publishes odds based on my research. I also publish a lot of overnight-focused studies on the site and have begun teaching traders my methods for using the research to make trading decisions.
As a swing trader, I often have a large amount of my account in cash. So being able to put that cash to work on an overnight basis when odds are in my favour has been beneficial for me. It’s an approach rarely discussed by others, and I know of no other sites or services dedicated to teaching it.
Having an overnight strategy could be beneficial for traders that typically hold large amounts of cash. The concept is new and different for most people, but I hope that one day in the future daytraders will think it’s preposterous not to also have a night trading strategy.
Do you have a recent example of an overnight trade?
An example of a recent overnight trade triggered on 30 August 2012. Similar to how I look at studies for short-term or intermediate influence, I examine them for possible overnight edges. A study in the 30 August Overnight Edges blog examined days when the following conditions held:
1) ES (emini futures) closed down for at least the fourth day in a row.
2) Today was the largest gap down of the last four days.
3) ES closed above the 200-day moving average.
Since 2000 there had been 12 instances of this. Eleven of them were followed by gaps up the next day, and the lone gap down only gapped down half a point. Meanwhile, the average gap up was nearly eight points.
I also use a statistics table each day – my ‘Odds Sheet’. It provides odds based on (1) price action, (2) internals, and (3) seasonality. Odds were strong across the board that day. I also had another study that supported the idea of a gap up the next morning.
With so much pointing towards an overnight rally, I went long at the close. I trade futures so I typically use price targets with many of my overnight trades. In this trade I was able to make 7.75 points. If I had held until the open it would have been nine points.
They don’t all line up so easily or work out so nicely, but it gives you the basic idea of what I look for. I want a combination of evidence to point to a bullish or bearish edge. If I believe the combination is strong enough, I take a long or short position for an overnight trade. The Overnight Edges website is designed to provide traders with the same information I use, including the Odds Sheet and any studies I am considering.
Wall Street had bad press in the years after the financial crisis. Who in the industry do you admire?
I mentioned Brett Steenbarger, and he would be near the top of the list. Over the years I have learned from and gained great respect for several bloggers, newsletter writers and website owners. They include Tom McClellan, Charles Kirk, Bill Luby, Jeff Pietsch, Michael Stokes, Scott Andrews, Corey Rosenbloom, John Forman and Ray Barros. I would also recommend checking the works of John Bollinger, Larry Connors and Larry Williams.
Finally, what is one thing traders can do now to improve?
Start testing your own ideas. It will lead to so many other ideas. And it will keep you curious. You won’t learn if you aren’t curious.