Before back-testing may begin, your trading idea has to be turned into trading rules that
are objective, reproducible, and able to be optimized. One common mistake is to try to
back-test a trading strategy or idea that is based on subjectivity. Many popular methods leave out important parameters that you have to guess at. For example, methods under
the umbrella of “Elliott wave counting” are notorious for being difficult to back test,
because where the wave is measured from profoundly affects the back-test outcome far
more so than the technique itself.
As you develop trading rules, you will be amazed how many trading slogans such as
“The trend is your friend” become meaningless, since they can be objectified into hard,
cold trading rules.
Finding the Fittest System
Once an initial set of trading rules is established, you can begin simulating what would
happen if they were strictly followed over a period of time. The time series is the collection
of dates and times when you will be testing the trading system. The fitness function
is a function or measure that you use to compare systems and the basis on which
you optimize a system’s parameters. For example, a fitness function could be net profit
or loss.
More sophisticated measures, such as the Sharpe ratio, Sortino ratio, and riskadjusted
return, compare different systems as to their performance measured by
volatility, loss volatility, and portfolio risk, respectively.
Quick Back-Testing with Excel
Initial back-tests can be easily done in Excel. Simply paste your historical time series
into Excel, enter your formula, and apply it to all cells in the time series. The easiest
way to express this is by assigning each type of market position by a –1 (sell), 0 (out
of market), or a 1 (buy). Then calculate profit or loss, subtracting out a spread and/or
transaction cost.
I recommend mastering Excel thoroughly before buying an expensive back-testing
tool. This ensures that you know how back-testing works from the ground up.
Typical articles on back-testing typically suggest two contradictory rules for the size
of your historical data set. On the one hand, they suggest you use as large a data set as
possible, in order to “prove” that your trading system can work under any circumstances.
Additionally, it is often said that you should only test your trading system under conditions
similar to the current market. Subtly enough, these suggestions again introduce
subjectivity. Instead of the trading rules’ being subjective to the trading system owner,
now market conditions become entirely subjective. For example, you read typically on
a web site about a trading system that has an annual return of 22 percent. It has had
a consistent winning record over the last 12 months, and you’re ready to purchase the
system (probably for far too much!) After you buy the system, you trade the system
rules exactly. When you fail to realize a 22 percent return and perhaps even a negative return, you are told that the market conditions have changed! So the trading system rules
cannot predict market conditions any more than they can predict future prices based on
the past!
This phenomenon reveals another common mistake made when back-testing. Curve
fitting is a term taken from statistics, usually used to refer to nonlinear regression. I will
explain with an example. You are back-testing a simple trading idea that takes two parameters.
The first time you run the back-test, you get a negative return. However, as
you continue to change the parameters, you notice that certain values produce higher,
positive returns. If you choose the two parameters that, together, produce the highest
returns, you are essentially predicting that the time series of market data will look exactly
like your historical test in the future. So, counterintuitively, the harder you work at
back-testing, the worse your results in live markets. How do you mitigate this inherent
problem?
There are several techniques for reducing curve fitting in a back-test. The first technique
is to keep your trading idea intact. If you are unable to express your trading idea not
only in market actions, but also market action sizes, you need to go back to the drawing
board and continue work on your trading idea. Additionally, you can back-test on
multiple markets and move the window of the back-test forward and backward to seek
out market conditions, setups, or patterns that are ideal for your system. For example,
you may want to back-test only on days where a certain economic indicator is released.
Back-testing on the most recent data can capitalize on recent market “shocks.”
Advanced mathematics provides many back-testing methodologies that are producing
results pointing to the fact that volatility and volume exhibit short-term memory. This
is because markets are made up of all the information held by the people with positions
in the market that intuitively remember the short-term past. This is why long-term backtesting,
while at first intuitive, can result in overoptimization and curve fitting.
Market Inefficiencies
It should be obvious that finding trading rules that are able to be profitable is always
an ongoing commitment. Remember, you are competing against traders who most likely
have far more experience, capital, and research to back up their trades. Finding those
market inefficiencies and capitalizing on them with trading rules can be challenging, but
there is certainly plenty of market inefficiency to drive huge proprietary trading teams
at investment banks, thousands of hedge funds, and many individual traders like you to
post double-digit returns year in and year out.
Back-Testing for Risk Management
Banks, hedge funds, and savvy traders also use back-testing for risk management.
Managing risk is accomplished by measuring and planning for loss. Even if your trading ideas are sound, not having enough capital for the long-term execution of that trading
idea will keep you from realizing maximum success. Standard risk measures include
drawdown, value-at-risk (VaR), leverage, and historical volatility. Maximum drawdown
tells you the maximum amount, in currency, of your biggest losing streak. This is calculated
based on when your trading system or idea would have had a position in the
market. VaR is quite different in that it measures, statistically, the 95 percent or 99 percent
maximum volatility (movement) in an instrument over a given period of time. This is
a far more sophisticated measure of risk because you can compare across portfolios and
asset classes (types of instruments). Also, you have a single number that you can apply
to many different trading systems for a given market. Back-testing for risk management
is probably the most overlooked important piece in a trader’s tool kit.
By ABE COFNAS
Sunday, April 22, 2012
TURNING A TRADING IDEA INTO A TRADING SYSTEM
4:42 AM
No comments
0 comments:
Post a Comment