Trading The Equity Curve

October 5, 2015 5:00 am11 commentsViews: 12186

Some trading systems have prolonged periods of winning or losing trades. Long winning streaks may be followed by a prolonged period of drawdown.  Wouldn’t it be nice if you could minimize those long drawdown periods? Here is one tip that might help you do just that. Try applying a simple moving average to your trading system’s equity curve and use that as a signal on when to stop and restart trading your system. This technique just might radically change your trading system’s performance.

How to do this? Well the moving average applied to your trading system’s equity curve creates a smoothed version of your trading system’s equity curve. You can now use this smoothed equity curve as a signal on when to stop or restart trading. For example, when the equity curve falls below the smoothed equity curve you can stop trading your system.  Why would you do this? Because your trading system is under performing, it’s losing money. Only after the equity curve starts to climb again should you start taking your trades once again. This technique is called trading the equity curve.

Trading the equity curve is like trading a basic moving average crossover system. When the fast moving average (your equity curve) crosses over the slower moving average (your smoothed equity curve) you go long (trade your system live). When the fast moving average crosses under the slower moving average you close your long trade (stop trading your live system).

Trading The Equity Curve

In the image above the blue line is the equity curve of an automated trading system. The pink line is a 30-trade average of the equity curve. When the equity curve dips below the pink line, such as around trade number 60, you would stop trading the system. Once the equity curve rises above the pink line, around trade number 80, you would start trading the system once again.

It’s a great idea and with some systems this technique can really work wonders. In essence, we are using the equity curve as a signal or filter for our trading system. In the most simple case, it’s a switch telling us when to stop trading it and when to resume trading. But you could also use this signal to reduce your risk or switch to a different system instead of simply turning off the system.

How Do You Do This?

Obviously, you need to track all trades somewhere in order to generate the complete equity curve and moving average. If your live system has stopped trading you will need to still record the theoretical trades it would be taking. Basically you will need to have two copies of your system running. One will be dedicated to taking every trade in simulation mode. This simulation system would be tracking the theoretical equity curve and computing the smoothed equity curve. No real trades would be taken by the simulated system. Its job is to simply track the two equity curves.

The second system will be dedicated to trading live. This live system will have the ability to trade or not trade based upon the results computed by the simulation system. Think of the simulated system as an indicator. It’s always running collecting data and crunching the numbers. This information will then be used by the live system to tell it when to trade and when not to trade.

One method to accomplish this would involve passing data between two charts in TradeStation. Both charts are trading the identical trading system. One trades live while the other trades only in simulation mode. The chart running in simulation mode acts as your indicator by taking every trade and tracking both the equity curve and smoothed equity curve. This indicator chart then passes a simple variable to the live chart indicating if trading should continue as normal or if we should stop trading. The live chart then simply acts on the live market.

This type of setup produces a dynamic trading system that adjusts its trading behavior based upon the system’s performance. It’s a simple concept, but it’s complex to build in TradeStation. Some solutions that I’ve seen are also not very flexible. Overall solutions have proven to require complex programming skills and tedious setup to get this to work.

In short, building custom Easylanguage code to trade the equity curve has been very difficult to do. In fact, it has been well outside the ability of most programmers. But, not anymore.

Equity Curve Feedback ToolKit

I’ve recently been introduced to the Equity Curve Feedback Toolkit. This kit allows me to use a simple EasyLanguage function within my code to perform the simulation I need to trade the equity curve. It’s super simple and will only take a few minutes to set up.  Let me show you.

I took an example trading system that appeared on System Trader Success called, A Simple S&P System. I then added the Equity Curve Feedback function to my code. Finally, I made a couple minor adjustments to my code. Once that was done, the Equity Curve Feedback function now returns the simulated value of simulated trading system’s equity curve. It does this without DLLs or other complicated setups. With this information you can make a determination if the equity curve is above or below the smoothed equity curve. In other words, you can now turn-off or turn-on your live system based upon the equity curve!

Here is the line of code which does all the magic! That one line, highlighted with a red box, is what computes the simulated trade of your system. You can then use this information to make determinations if your system should be trading or not.

Trading EQ Curve Example

 

Here is section of the equity curve of the system without using the equity curve feedback.

Trading EQ Curve Example

You can see in the above equity curve we had an 83% drop in equity. Also, there is a six year lag between new equity highs. Below is the the equity curve when a 20-period simple moving average is applied. This means we only take trades when the current equity curve is above it’s 20-period simple moving average.

Trading EQ Curve Example

In this example you can see the drawdown was significantly reduced along with the time between new equity highs. I’ve created a short video demonstrating how I used the Equity Curve Feedback Tool kit with this example system.

Video Demonstration

I created a video demonstrating using the Equity Curve Feedback Toolkit here.

STS_Video

Does It Always Help?

The short answer is, no. Trading the equity curve works well on some trading systems that have prolonged periods of drawdown. Yet, other systems don’t benefit because the drawdowns are rather shallow and you end up hurting your equity more than anything. But like most things in the world of trading, you’ll have to perform some testing. Test different moving averages and test between halting all trading or reducing contract/share size. Remember, some systems do not benefit from this technique at all.

The Equity Curve Feedback Toolkit can also be use to create even more dynamic systems. For example, you can separate your long and short equity curves. Perhaps during a bear market you should only be taking short trades. Well, you can have your system disable long trades if they stop performing well. Likewise for short trades. In this regard, you could build a regime filter based upon the performance of the strategy.

You could also dynamically adjust your risk. That is, if your equity curve begins to fall you can reduce the number of shares or contracts you trade. Maybe when the equity curve is climbing, you need to increase your risk by buying more shares or contracts. You could also start or stop trading based upon drawdown or if the percentage of winners falls below a threshold. These are all possible with this kit.

Download

If you would like to get your own copy of the Equity Curve Feedback Toolkit, you can do so right here.

Jeff is the founder of System Trader Success – an inBox magazine dedicated to sharing great ideas and concepts from the world of automated trading systems. Read More Google

Facebook Twitter 

Tags:

11 Comments

  • Jeff, you recommend to “test different moving averages and test between halting all trading or reducing contract/share size.”

    Is this not curve-fitting? If it is then is that particular moving average probably going to help or hurt me going forward?

    • IT could be. Anytime you pick a parameter it could be curve fitting or it could just be optimizing. What I often recommend when testing a range of values, a look-back period for a moving average for example, is to test the robustness of the parameter. That is, I would expect to see many different values that produce favorable results. However, if simply changing the look-back period a small amount drastically changes the results, I would be worried about curve fitting. If or when I find a region which appears stable, I will then take the mean or median value.

  • Jeff, have you taken a look at MSA software? It will allow for monte carlo testing using an equity curve.
    http://www.adaptrade.com/product.htm

    I did not find equity curve trading worked for me as the curve can take you out just as the best trades are setting up. Especially, when you have strategies where 20% of your trades make up 80% of your profits.

    Ryan
    http://www.daxgaptrading.wordpress.com

    • I have a copy of the MSA software. I really like it. That’s a good observation about where “traditional” rules for trading the equity curve may not work. In this type of situation you may find it interesting to test increasing your risk when under the equity curve average and reducing risk when it’s above.

  • Actually it’s a completely re-written article written in the last few days! The original article from 2012 did not have a equity curve solution. It only talked about the topic as a theory. There was no solution. So, once I found an EasyLanguage solution I re-wrote the article as the old article become completely obsolete. Thanks for the links to Kevin’s articles. I have yet to read them. It’s true that this technique may not work for all systems. I would never expect a single technique to work on all markets. It does not even need to work on most markets to be valuable. If it only works on less than 5% of strategies developed, it’s worth keeping. Remember, this is just another tool in your toolbox that you may find helpful. I would test this technique like I would test any other technique. How do you test that a trailing stop works or an open range breakout works? What steps are taken to boost the probability of success when incorporating those techniques in your trading? The same steps would apply here. There is nothing different. In all cases, your own system development process should be applied.

    • Thanks for the link! I’ve heard of this concept before and it’s really an interesting idea. In fact, you could use the Equity Curve Feedback tool to do something similar. For example, you could have a single strategy which trades both a mean reverting strategy and a trend following strategy. Using the functions within the Toolkit you could have it switch between these to types of trades based upon historical performance in real-time.

  • Hi Jeff,
    does it work also with limit and stop orders?

    If i am not wrong it works only with market orders….

Leave a Reply


Time limit is exhausted. Please reload CAPTCHA.

LEARN HOW TO OPTIMIZE WITHOUT 
CURVE FITTING

Download these four simple steps to help ensure you make money on the live market!

x