Sunday, March 9, 2008

The Case for Multiple Exits, Part1

The next few posts are going to look at the substantial impact exits have on the results of any given trading methodology. For entries, I will be using a breakout entry that will perhaps be discussed in future posts with permission from the designer. For today’s purpose, the entries don’t really matter and would not dramatically change the nature of the results.

*Note: Pradeep Bonde from Stockbee (http://stockbee.blogspot.com/) gave me permission to disclose the entry. These tests use his IBD200 technical entry criteria. I will also add that Pradeep introduces another level of stock selection refinement based on some criteria that are difficult to backtest (float, relative linearity, etc) so those have been excluded from these tests. I have no doubt that proper use of his other methods would further elevate returns. I would also highly recomend the member's only section of his site as an invaluable information source.


8% Trailing Stop

The first example we are going to look at is about as simple as it gets and probably one of the most often used by those that actually use risk management stops. A trailing 8% stop. That’s it. The 8% number comes from William O’Neil’s maximum recommended loss per trade.







At $1000 per trade, this exit resulted in $78,815 dollars of net profit with a reliability percentage of about 40%, which is pretty typical for a trend following system. The average loss was $50.65 (5%) and the average win was $97.41 (9.7%). The average trade was $8.38 which means that we can expect to make an average of $8.38 per trade over the long run. If we take our AvgTrade/AvgLoss, we can calculate what our expectancy is per dollar risk. $8.38/$50.65 = .165, or for every dollar we put at risk, we have an expectancy of 16.5 cents. Risking 1% of our equity per trade, it would take approximately 600 trades to double our money, not including compounding.


8% Protective Stop+20% Profit Target

For the next example, we will use two separate stops, an 8% protective stop that is fixed at 8% below the entry price and a 20% profit target. We allow the price to hit one or the other before exiting. These are both figures taken from William O’Neil’s publications although he discusses several exceptions to the 20% profit target, which as we will find out later, are very important.







In this example, with the same exact entry criteria at $1000 per trade resulted in $185,919 dollars of net profit with a reliability percentage of about 38%. Our average loss increased to $82.52 (8.2%), but our average win is now $196.99 (19.7%). Our average trade is $24.21 which means that we now expect to make an average of $24.21 for every trade we make. AvgTrade/AvgLoss=$24.21/$82.52 = .293 - for every dollar we place at risk, we now have an expectancy of 29 cents. Risking 1% of our equity per trade, it would take approximately 340 trades to double our money, not including compounding.


8% Protective Stop+25% Trailing Profit Stop

Most people have heard the expression to cut your losers short and let your winners run.
In our last example, we will also use two stops to achieve this. We will begin with an 8% protective stop but instead of a 20% profit target, we will use a 25% trailing profit stop. This stop will follow the price up but will only become active when it raises above the initial 8% protective stop. This will give our winners PLENTY of room to grow without increasing our intitial risk. The point in which the trailing stop becomes active is when our stock price reaches a 17% increase over the entry price (25-8=17).






Well look at that. In this example, with the same exact entry criteria, $1000 per trade resulted in $438,165 dollars of net profit with a reliability percentage of only about 30%. Our average loss stayed about the same at $80.05 (8%), but our average win is now $503.96 (50.4%). Our average trade jumped to $92.93 which means that we now expect to make an average of $92.93 for every trade we make. AvgTrade/AvgLoss=$92.93/$80.05 = 1.16 - for every dollar we place at risk, we now have an expectancy $1.16. Almost 4x the amount of the previous example and 10x the reward to risk ratio of using an 8% trailing stop alone. Risking 1% of our equity per trade, it would only take about 86 trades to double our money, not including compounding.

I want to remind everyone to read the post on backtesting methodology to understand exactly what we are seeing here. These aren’t necessarily representative of the results you will experience but I can tell you that using these different stops on almost any basket of stocks with almost any entry criteria will yield the same relationships to one another. Stops are huge and the possibilities for using them are endless. Using each of these will create completely different psychological pressures and the drawdowns one might experience with such a large trailing stop might be too much for some to handle. It is important to find a methodology that works for you and your risk profile but not paying them proper attention is clearly a huge mistake.

20 comments:

James said...

thanks for sharing your backtesting data. i wonder how did you backtest a dynamic list of stock like ibd200? this list change every week?
i tried to backtest dynamic list but unable to find a method to do so.

thanks,
jt

James said...

what is the start out equity size? the equity graph seems to show that the start out equity is $1000, but what you discribe is $1000/trade.

base on what i understand from reading. it seems like the equity is $1000. each trade risk 1% of the equity. did i understand this right?

how about the entry? did you used the same entry as described by Pradeep on Stockbee?

thanks,
jt

bhh said...

http://ibdindex.blogspot.com/2008/03/backtesting-methodology.html

Portfolio is not dynamic, I am unable to do that as well. I will post same test with different portfolios this weekend to illustrate robustness.

No money management was used in these tests, only $1000 per trade. I will look at different money management strategies in the future. The way I caluclated how many trades it would take to double your money was to assume that the Average Loss (R-value) represented 1% of your portfolio equity. (AvgLoss*100)/AvgTrade=# trades to double. If I am risking $80 and that is 1% of my portfolio, I have $8000. If each trade makes me $96, $96*83.3 = $8000

bhh said...

Entry criteria was same as Pradeep's Telecahrt scans - no discretionary information was programmed (float, relative linearity, etc.)

Anonymous said...

1) Could you repost the entry criteria? Can't find the page on Stockbee's website.

2) Are you buying the next bar after a signal or on the same bar? Important to consider when comparing volume, closing price, etc. on a mechanical system.

Thank you!

bhh said...

I am not going to give the specifics of his system here but the criteria was:
% breakout
min. volume
volume change
10-day relative weakness
1-month relative weakness

2) Good question, I will add this to the methodolgy post. My data is EOD only so all entries are market orders at open on the day following the signal. Exits are standing Stop/Market orders for protective and trailing stops and limit orders for profit targets. You will note in the results that we get gapped down on and had some large maximum losses. These "real-world" situations are not omitted from the results.

Michel Lahaye said...

I did some tests myself (with www.prorealtime.com - free end-of-day).

// Based on the Stockbee SCANNER
// After a confirmed rally, we select a strong CANSLIM stock.

// Anyway ...
// We make a purchase the day after when:
// 1. 4% Breakout
// 2. Higher volume breakout
// 3. 1 month weakness
// 4. 10 days weakness
// 5. MA(50) and MA(200) both rising

// SELL when:

// 1. 20% Profit

// RUN AWAY WHEN:

// 1. Price falls trough MA(50) + high volume

// More rules to be added

c1 = 100*((close - close[1])/close[1])
c2 = 100*((close[1] - close[22])/close[22])
c3 = 100*((close[1] - close[11])/close[11])

v = Volume
masvol = v > v[1]*2

ma = Average[50](close)
ma200 = Average[200](close)

IF c1 > 4 AND c2 <=10 AND c3 <=10 AND v>v[1] AND v>200000 and ma>ma[1] and ma200 > ma200[1] THEN
BUY 100 %Capital AT MARKET TomorrowOpen
ENDIF


REM Run to exit when cuts trough 50 MA

IF close < Average[50] AND masvol THEN
SELL AT MARKET
ENDIF

Michel Lahaye said...
This comment has been removed by the author.
Michel Lahaye said...

still have to add a stop. I also saw that the system only works when the stock is of course 'supported by institutionals' above 50 MA.

While testing GILD I saw the profits disappeared when the trend wasn't clear (just kept on breaking 50 MA).

I heard that you even can draw a trendline on your equity curve and then enter when equity curve has the right trend ...

greetz
Michel

Anonymous said...

And what were the results using a 25% trailing stop alone?

bhh said...

The expectancy per dollar risk on this portfolio with a 25% trail only is $1.08 - which is nice but a little less than the with the 8% protective. My own personal issue with this is that if you are using percent/risk position sizing, you will end up with 1/3 the number of shares for the same percentage of portfolio risk per trade... Fully invested though and you would hold 3x times the number of securities so you would be more diversified I guess. The holding time for losers also goes from 22 days to 55 days which is going to tie up dead capital longer. Win % goes up to 48.59% though. Interesting to think about.

Anonymous said...

Do you understand the concept of "swapping"? That is converting stocks into options and protecting profits?
Basically if a stock is up 20% and you own 300 shares, you sell all your shares and buy 3 call contracts at the money. You pay the price of the premium, but your profit at that point that you take off the table is the profit minus the premium. So you have the same potential for gain minus the lost time value of the option, but you have a significant less downward risk.
This strategy is a fantastic way to give your winners a chance to run without worrying about losing a big gain.
I would absolutely love it if you could find some way to backtest this strategy...
By the way, what software are you using to backtest?

Michel Lahaye said...

Hi everyone! Very interesting posts! In the stock market we just can't permit ourselves not to do some serious backtesting. After all: you can win the race, but you can't beat the races :)

Anyone has a good reference on using options? I'm used to trade stocks, 'cause options seem like very confusing to me ...

I use ProRealtime, but i've heard some use ninjatrader.

gr
Michel

Anonymous said...

Brandon,

Mechanically, how does the 25% trailing stop work? I assume your backtesting software only uses OHLC data. Is the stop raised each day by the distance to the high of the day (since it traveled that far during the course of the day) or is it only raised from one low to the other? Thanks.

bhh said...

You are correct, data is OHLC.

The high point is the highest high since entry. Stop price is calculated as percentage of that.

HH=Highest(High,BarsSinceEntry,0)
TrailStopPrice=HH-(HH*(25/100))
ExitLong(TrailStopPrice,Stop,Day)

They way the backtester uses this is if a daily lower is lower than the stop price, it exits you at your stop price. It is "smart" enough however that if your stop price is between a daily close and the following day's open, it exits you at the opening price rather than your stop price.

Damian said...

That's a pretty interesting approach - so, basically, you have an 8% protective stop based on the entry price. As soon as you clear 8% on the upside, you widen the stop to 17% and you let it run until it hits the 17% exit.

What's interesting to me about this is that it is, as usual, completely non-intuitive. Meaning, giving back 17% on any trade would probably drive most people crazy, but I've found this is quite a fair tradeoff in most trend following systems.

Am I interpreting all this correctly?

bhh said...

Hi Damian,
The way these tests actually work, the trailing stop is 25% from the highest high since entry so it can actually give back 25% once the price is 17% above entry price as the 8% protective stop is fixed.
You could of course lower the trail to whatever you feel comfortable with knowing that the EDR will decrease proportionally.
This is a long-term strategy, the avg winning trade was 171 days compared to 22 days for the average losing trade. It gives the market maximum room with the "market's" money.

Anonymous said...

Hey Brandon,

Just discovered your blog, very educational so far! Re. the backtester you use: So suppose you set your 8% protective and 25% trailing stops beginning at entry "X". Then the next day's historical OHLC show a bar range touching both the 0.92X and the 1.18X levels. How does the back tester know which of those stops tripped and when during the day?

I'm actually working on a backtester using excel (mining historical daily OHLC data from a couple of sites). I have to make rather simplistic assumptions about how the price moves within the day. For instance, if the open is lower than the close for a given bar or if open is in the lower 50% of the total bar range, then I favor the following price movement sequences:

Previous Close --> Open
Open --> Low
Low --> High
High --> Close

I was just wondering how the backtester you use handles such large price swing bars.

Regards,
Wayne

bhh said...

Hi Wayne,
I am moving this site over to a new URL/site soon with a partner so it is pretty dormant at the moment. Anyway, to answer your question, my backtester assumes worse case scenario at that point and will always take a loss before a win. It is always better to surprise yourself with real-time performance that is better than expected although that is rarely the case (but it does happen). In reality, the situation you describe happens so rarely with this large of stops that the any errors resulting from this are tiny when compared against something as mundane as rounding errors resulting from split-adjusted OHLC data that uses only two decimal places. With tighter stops however, it will become an increasingly bigger issue. I would suggest that if your stops fall within one ATR multiple for a specific market, you should be using intraday data to test with.

Robert said...

Hey! i have read your blog, it is very nice information you had share hare. i have learn too many things related trading indicators. thanks you for sharing it.
You can also check something here related trading indicators,
Ninjatrader Market Profile
Supertrend Ninjatrader 8