Posts Tagged ‘selling’

Negative Divergences Abound

November 30th, 2009 by jackieannpatterson | No Comments | Filed in Exit Strategies

Since its not always easier keeping up with the market over a long holiday weekend, I thought to share my weekly “homework”.

Plenty of interesting red flags from my MACD Divergence Detector running on StockFinder®.   It found MACD and MACDH negative divergences on SPY, DIA, ISRG, BIDU to name a few.    Looking at the chart of SPY below, its clearly not the first negative divergence.

MACD Lines and Histogram do not confirm price action on SPY

MACD Lines and Histogram do not confirm price action on SPY (click to enlarge)

The other SPY negative divergences kicked off a slight decline, followed by a rally.   What’s to say that won’t be the case again?

First off, consider that the markets may very well rebound again.  It is, after all, a seasonally strong time of year.  I don’t want to make recommendations or predictions here, just share some observations.  See Truth About MACD BackTesting Reports  for data on the historical back test performance of MACD divergences.

The next observation to share is that breadth and New Highs / New Lows (NH-NL) exhibit extraordinary negative divergences of their own.   Here’s a chart with McClellan’s Summation Index to show what I mean.   (Note that I didn’t personally run a back test of McClellan’s Summation Index.   Tom McClellan told me he did.  I wish the strategies of other people who have told me that had performed better in my back tests.  Anyway, until I get around to doing the back test myself, I am taking McClellan’s word that the summation index that bears his name is a useful indicator to have in the toolbox.)

Red arrows highlight divergence between SPY (green) and McClellan Summation Index (yellow)

Red arrows highlight divergence between SPY (green) and McClellan Summation Index (yellow)

With these kind of negative divergences showing I am certainly not thinking of buying the dip!   In fact,  negative divergences are a signal to sell long positions in my book.    

If you are also standing near the door (so to speak), or working on your own stratgy for cutting losses and taking profits, you may want to take a look at the Exit Strategies series of BackTesting Reports.   They show back test results for various kinds of fixed stop losses, trailing stops losses, and profit targets.    That stuff isn’t as glamorous as buy signals but if you didn’t make a solid plan for when to sell before you bought, the next best time to think about these things is while the market is up.

Tags: , , , , , , ,

MACD Sell Signals

May 26th, 2009 by jackieannpatterson | No Comments | Filed in MACD, Reports

btr6_cover

If you’ve ever wondered:

  • which MACD sell signal has the best track record
  • whether to sell when the MACD Histogram ticks down or wait for the lines to cross
  • how far positions have dropped after a MACD by signal
  • whether stop losses really reduce risk
  • whether using an ATR stop is worth the effort

then you might considering investing in a copy of the MACD Sell Signals BackTesting Report.

The MACD Sell Signal Report builds on two of the MACD Buy Signals to backtest basic exit signals using MACD lines and histograms. This report gives the first look at Maximum Adverse Excursion - how far the position went against you — as a way to measure the risk of each strategy.   It also compares three different types of stop losses to reduce risk.   Read this report to find out how you would have fared by following the MACD and MACD Histogram.

 Subscribe to BackTesting Report Now or order MACD Reports separately

Tags: , , , , , , , , , ,

BackTesting Moving Averages

March 9th, 2009 by jackieannpatterson | 3 Comments | Filed in Backtesting Set Up, Moving Average, Reports, Technical Strategies

Why Moving Averages

As a trader or investor, the only reason to investigate moving averages is to gain knowledge to increase profits. Like many other technical indicators, moving averages are meant to help us objectively tell the market status at any given time. This helps us see through the emotions of the day and make rational decisions, which we’re told will lead to greater profits and/or fewer losses over the long run. Moving averages (MAs) smooth the series of prices for a stock. MAs are most often used to identify the trend of market direction, and are classed as a trend-following indicator. This doesn’t mean that MAs are only for long-term investors - short term traders use them also. Moving averages can be used to screen stocks for good candidates, signal buying opportunities, and offer sell signals.

Why Backtest - A Story

The goal of backtesting is to find out if moving averages really do lead to better results and what are the most promising ways to apply MAs. Let me tell you a short story. While I was putting together the results for one of the moving average BackTesting Report issues, I happened to visit a friend. At her house, I came across some reading material from a well-advertised discount stock broker. In it was an article that advising its customers to use a particular moving average length applied in a certain way to get the best results. I had my comprehensive tests right in front of me and I can tell you that broker’s method did not get the best results although they did mention a MA length that is useful in other ways. I had in my hand test results that showed that the way that broker applied the moving average had a win rate worse than the baseline when tested on 7147 stocks over 14 years of stock market data. Clearly the broker wasn’t running that kind of testing. It’s up to the customers - us! - to fend for ourselves and find out what works versus what doesn’t.

How to Calculate MAs

When backtesting moving averages, the first decision is how to calculate the moving average. Do you want a simple moving average (SMA)? Or something designed to track price better such as an exponential moving average (EMA)? You might consider an experiment to compare the win rates of the two different averages. I did just that a couple years ago, and while I don’t have the results to publish, I came away with the notion that it didn’t make a big difference whether I chose SMA or EMA — just pick one and use it consistently. So for this project, I choose to use simple moving averages because I see them mentioned in commentary most often. To actually do the calculation, I relied on the built-in function which came with TradeStation. (The choice of backtesting engine is another decision which is general enough to write about in another post.)

How to Use MAs

Next you need to pin down how exactly you want to apply moving averages. How will you interpret the relationship between price and moving average? What rules will you use to decide when to buy and sell? You don’t have to read long about stocks before coming across a bullish reference to a stock trading above its 200-day moving average or its 50-day moving average, or even the 10- or 20-day MA. Or advice about buying stocks as they cross their 50-day or 200-day moving average. These are important rules to test in the backtesting engine. And then there’s the moving average crossover - a classic method of technical analysis. That makes three distinct ways of using moving averages to test.

Going more in-depth, some trading texts talk about the slope of a moving average. If you hark back to algebra and consider the MA as a line, to find its slope you would pick two points on the line and apply the usual formula ((x2-x1)/(y2-y1)). This brings up the question of how far apart to pick the two points which can make a difference to results. Really, since the MA is being used to identify the trend, we just want to know if it is sloping up or down. Then we can simplify the whole calculation by noticing that if the price is above the moving average, it must be pulling the average up, and a price below the MA pulls it down. Thus another reason to test the efficacy of price above the moving average.

Parameter settings

Once you decide on how to use the MAs, you need to pick a selection of various lengths to test. Beware of over-optimizing. Somewhere out there is a guy with backtesting results showing 3895% gain or whatever using just the right moving average. Too bad he doesn’t know what MA will produce those results in the future. That said, you need to try more than one length to make sure that your results aren’t a fluke. Stick with defaults settings or the ones you hear about most in the media. Finding the one perfect parameter setting is not going to make you rich. Finding a cluster of good, robust settings just might do you a great deal of good though.

As a practical matter when backtesting allow enough data lag before measuring. All tests must begin measuring at the same place for apples-to-apples comparison among different MA lengths. For example, if you’re testing a 200-day moving average, it will take the first 200-days of data to calculate the first point of that moving average. That means that the first day you could possibly have a signal is 200-days into the data set. To make a fair comparison with, say, the 10-day moving average, you need to make sure not to count any signals from the 10-day moving average before the 200-day is ready to go. Fortunately TradeStation has a way to set the “Maximum number of bars study will reference” in “Properties for All” strategies which forces the backtesting engine to wait that long before tabulating data.

More Profit from Buying or Selling?

Moving average rules, and in particular moving average crossover rules, are often discussed as a reversal system. This means that one signal, say the MAs crossing upwards is a buy signal and then its opposite, say MA lines crossing down, is not only a sell signal but also the trigger to go short. Theoretically, that’s just fine but many people are not interested in shorting the market. They are looking for techniques to help them buy and maybe sell. Even a person who regularly sells and sells short might use different techniques for buying and selling. For these reasons, it’s wise to test the buy signals separately from the sell signals.

This poses a dilemma because it’s hard to evaluate a buy signal in isolation. One way to do this is to use timed exits - that is, exit the trade or sell the stock after a certain amount of time elapses. I chose to run each backtest three times with three different times exits because different people have different styles and different needs. To produce backtesting results useful to swing traders, I exit after 2 days. To model position traders, 20 days. To meet the needs of active investors, backtesting holds each position for 200 days. This gives a way to isolate the buy signals and find out just how useful the moving average is to stock buyers of various temperaments.

Need to Define Goodness

One more very important thing to consider if you are backtesting moving averages to find out how well they do in the stock market: How will you know what is good? You need objective criteria for success. That means identifying the key statistics such as win rate, expectancy, hypothetical equity gains, etc. It also means setting standards for acceptable performance in each of these areas.

An example illustrates why this is important and why it’s not as easy as it first appears. Say your tests show a win rate of 55% for a particular indicator. That may might not be so good if, say, 62% of all stocks went up during the same period of time. Or if only 25% of stocks rose during that time period, your 55% win rate would be spectacular. What is good depends on how it compares to baseline market performance under the same conditions.

You can download a free copy of the BackTesting Report Baseline issue by clicking here.

Test Set

For a meaningful backtest, you need to have enough data to make a statistically valid comparison. At the minimum, that means 30 trades. Even if you are trading just one instrument - just one stock or just one currency pair - I think it’s important to test your trading strategy on many different instruments to prove its robustness. I went over the top with an extremely large test set — 7147 stocks over 14 years — to make sure my results would apply in a wide variety of market conditions.

You can get your copy of my backtesting reports on moving average buy signals by clicking here.

Tags: , , , , , , , , , , , , , , , , , , , , ,

Short Definition

October 16th, 2008 by jackieannpatterson | No Comments | Filed in Glossary

Shorting is simply selling a stock you have borrowed but you haven’t yet bought.   The idea is to sell when the price is high and buy later when the price is lower.    Buying the stock then closes the short trade as the stock is paid back to the lender (usually the broker).  

Details on how to sell short are in Sell and Sell Short by Dr. Alexander Elder.

Extra Insight:

Short selling is more difficult to model for backtesting because not everything is reflected in the price.  Extra rules are imposed by the SEC such as no shorting until the price ticks up.  The SEC recently removed this one.    The stock also needs to be available to short — meaning someone has to be willing to lend out the shares. Often shares are not available when the price is in free fall.   As we see in the current crisis, new rules are created on the fly such as the one-month hiatus on shorting bank shares.  To be super-accurate, a model would need to have different shorting rules for different dates– something that is beyond the scope of most backtesting engines.   The upshot is that backtesting doesn’t model short strategies as well as it does long strategies.

Risk management is more important for short selling because a short seller loses money when the stock rises without limit.   In contrast, a buyer of a stock can only lose as much as they paid for it.

A portion of the proceeds of a short sale are available immediately.   Some traders (and mutual fund managers) will use the proceeds to buy shares of a different stock thus making their money go farther.

(Backtesting Blog is an Amazon Associate.)

Updated 11/12/08.

Tags: , , , , , , ,

Signal Definition

October 16th, 2008 by jackieannpatterson | No Comments | Filed in Glossary

A Signal is the specific event that says when to get in or out of a stock. 

Extra Insight:

Some signals are objective, for example price hitting a 52-week high.   Others are more subjective, for example magazine covers depicting emotional extremes can signal the end of a trend.

For backtesting, we need objective signals that can be evaluated by a computer program.

During backtesting, the computer will take every signal promptly. 

A human trader may ignore a signal or delay taking action — particularly if it is painful!  A human trader may also act even in the absence of a signal, buying when they feel like shopping or selling when they feel fearful, regardless of the signals from their trading strategy.   In this case, the profit/loss performance will differ from the backtesting result.

Updated 11/22/08.

Tags: , , , ,

Trader Type

October 8th, 2008 by jackieannpatterson | No Comments | Filed in Glossary

Trader Type is defined by how long a person likes to hold a position.  My categories are:

  • Buy ‘n’ Hold = practically forever = no pre-defined exit
  • Active Investor = measure in years with pre-defined exit
  • Position Trader = measure in weeks
  • Swing Trader = short term, measure in days
  • Day Trader = don’t hold overnight
  • Market Maker = always have an offer to buy and sell outstanding

Extra Insight:

I’m most interested in the swing trade and position trading.   I’d like to hear what readers think is the most interesting area and have set up a Buzz Dash poll.    Please vote for your favorite type:

Many experts say you need to find the style that suits you best and that timeframe is often a matter of temperment.   Maybe, but I do find my temperment changes as I see the various track records from backtesting!

Updated 11/17/08.

Tags: , , , , , , , ,