Never Book a Loss (And Why That’s Bad For You)

Screen Shot 2016-03-14 at 8.39.08 AMI have got a great trading system for you. I mean, look at that equity curve! It’s very straight, no drawdowns, and $30,000, compounded, became almost $120,000 over time.

What’s the catch?

They say (and I’m not sure who “they” are) that the average retail investor hates to book a loss, and takes profits too soon. The reverse of the “cut your losses early and let your profits run” mantra of the momentum crowd. But how bad is this “never book a loss” (“NBAL”) method anyway?

Let’s propose a system, just for fun. You, the uninformed retail investor, vow never to sell at a loss. You will buy at the close of a down day, and sell at the close of the first profitable day. If it’s not profitable, you refuse to sell, so that you can tell your spouse that you never lose money. That system generates the graph above…on a per-trade basis. No drawdowns, because there are no losses.

Oh but wait, let me throw the dates in there.

Screen Shot 2016-03-14 at 8.51.42 AMThat doesn’t look quite right, does it? That’s because there are long periods where the market is down from its peak. In this system, you end up buying at a market high, and then sit and wait for the market to come back. After the dot-com bust, you’d be waiting over six years! That’s a lot of time sitting and waiting for your money to do something.

In the NBAL system, the vast majority of your trades are one or two days long. But every once in awhile, the music stops and you’re the one without a chair. And your daily equity looks very different to your per-trade equity.

all-prof gt 0 equityall-prof gt 0 DD

Apologies for the different chart styles…anyone know how to export daily equity from AmiBroker?

[Thanks to everyone who chimed in with suggestions on exporting the equity curve!]

As you can see, your daily equity curve looks suspiciously like buy-and-hold:

BnH equityBnH DDThat said, you’ll notice that our NBAL system made a little more profit than buy-and-hold, and the current drawdown is not quite as bad. However unless your trading fees are almost nonexistent, the NBAL system would have fared worse. For the purposes of this discussion though, we’ll pretend either a) your grandma owns a brokerage and lets you trade for free, or b) you’re trading with these guys.

(At this point, you’re thinking “what moron would trade like this?!” That’s because you’re a sharp trader – or is that Sharpe trader? But bear with me, because it gets interesting-ish.)

Can our NBAL system be improved? What if we tried to book more profit before we sold? This flies in the face of our naive investor who wants to sell at the earliest sign of success. But let’s say we convince this investor to hold onto his/her money until the closing price is x % over the purchase price or greater. What would that look like?

Turns out our naive investor was correct. The best returns occur when you set your profit target just above 0:

Screen Shot 2016-03-14 at 9.15.12 AMThese are the optimization results for profit target, testing between 0 and 10 in .1 % increments. As you can see, the .1 % target shows the best results. That’s a win of sorts for the Naive Investor.

Let’s say we talk this person into considering a maximum time to hold a position. Yes, that’s right, we convince him or her to book a loss. That will be hard battle, because there will be drawdowns. The spouse might even find out about these booked losses. This concept is going to be tough. But perhaps charts will convince our investor to consider this option.

Screen Shot 2016-03-14 at 9.18.35 AMAbove is a chart optimizing for maximum days in a trade before selling. As you can see, there are quite a few durations that yield a higher profit potential than the NBAL system. The best is at 9 days, but this is a) spiky optimization results and thus probably an anomaly, and b) benefits from hindsight.

Just for fun, what if we use the NBAL system, but exit after 9 days and start over if we didn’t book a win? Here’s what our daily equity chart would look like:

all-prof dur9 pft gt0 equity all-prof dur9 pft gt0 DDThat’s a nicer looking equity curve! Profit is much higher, and the drawdowns are much smaller than either the NBAL system or buy-and-hold. All accomplished with the simple addition of a time-based ‘stop’. You still had a painful 2008 – but less so. And you still had an extended drawdown after 2000 – but shorter.

I hope it’s obvious that the 9-day duration is not something that’s guaranteed to work in the future. And this is yet another Stupid┬áSystem that is intended only as an exploration. This does show though that taking losses can make you more money in the long run.

9 thoughts on “Never Book a Loss (And Why That’s Bad For You)”

  1. Great post Matt! It resonated with me because I’ve been recently engaged by two separate private traders to code up systems that never book a loss. Both systems used elaborate hedging strategies to get out of losing positions, but at the end of the day they require an infinite bankroll to succeed long term. The efficacy of this approach is, of course, a complete fallacy. Despite my warnings, they insisted that I complete their respective projects, so I did.

    In my exploration of these systems, I had a very similar revelation to the timed exit version of your NBAL strategy. I found that these systems actually may have had an edge in their trading logic, but by prolonging losing trades, the system misses out on many more good ones that would have occurred between the losers.

    Lesson: take a loss, it’s part of the game!!!

    1. Thanks, Kris! Now I feel validated. ­čÖé Now if I could just get myself one of those infinite bankrolls….

  2. Thought I’d answer your question regarding exporting the Daily Equity Curve from Amibroker……What you do is create a custom ticker symbol using the AddtoComposite Function. In this case I’ve called it ~~~EXPORT_EQUITY. After running your backtest pull up this symbol and then run an Exploration over this same time period for just this Symbol pulling out the Closing Price (Equity Price) of each day……Export to CSV and there you go!

    Assuming you’re just using standard Buy and Sell setup rules your code would be as follows:


    if( Status(“action”) == actionPortfolio )
    bo = GetBacktesterObject();
    AddToComposite( bo.EquityArray,
    “~~~EXPORT_EQUITY”, “X”,
    atcFlagDeleteValues | atcFlagEnableInPortfolio );

    // Use this for the Exploration to
    // Get Daily Prices of the ~~~EXPORT_EQUITY Symbol

    Filter = 1>0;

    AddColumn(C,”Daily Equity”,1.2);

    1. Thanks John! This is a good way to incorporate the equity curve creation with the script, and to save it somewhere other than the temporary file “~~~EQUITY”.

  3. Nice Post. As to extracting portfolio equity from AmiBroker, you can just Explore the data as you would do with any other stock and then copy the same to Excel.

    1. Thanks Prashanth! I thought the ~~~equity data was refreshed every time a backtest/explore button was hit, but I guess that’s only for backtests. I was able to explore the equity curve as you’ve described, and got it working.

  4. Hi there, nice post!

    I’ve used amibroker for years now and since I’m to lazy to come up with some custom backtest automation technique in order to export daily data, what I’ve always done is;

    1 – copy backtest data from Amibroker
    2 – paste into Excel
    3 – create column of dates
    4 – sumIf(if trade results are from same day , sum all of them)

    Really straightforward and gets the job done.

    Ask if you have any questions!

    Best Regards

    1. Thanks Eduardo! I was looking for something that would show me the intra-trade equity though, not just the per-trade equity. Like what AmiBroker shows on its charts, but in data format. I probably wasn’t clear in my post, sorry. A couple of others have posted solutions though, so I’ll have consistent charts in the future (unless I get lazy).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.