March 29

0 comments

Trading Multiple Strategies With The Same Instrument – Part 3 [Updated for 2021]

By Kevin Davey

March 29, 2021

Automated Trading Development, EasyLanguage, free easylanguage, Kevin Davey, portfolio management

In the last two articles (article 1article 2), I discussed the need for trading multiple strategies with the same instrument in the same account. This type of capability is very important to a trader who wishes to trade a diversified portfolio, while at the same time efficiently managing margin. Unfortunately, with many platforms this capability is very tough to achieve.

In the last article I introduced a template that could be used to convert a “standard” strategy into a strategy that could eventually be combined with other strategies, and produce the same overall performance that each strategy combined would produce.

Unfortunately, with that method, certain nice and arguably critical features (such as standard stop losses and profit targets) have to be replaced by alternatives (such as exiting next bar at open when a big loss is recognized at the bar close). But, if a trader is willing to accept these tradeoffs, he can obtain an equity curve which is very similar to the original strategy.

Since I previously demonstrated that this method produced acceptable results for one strategy, let’s see if we can combine two of these strategies into one strategy with similar performance.

To do that, we will combine a momentum strategy, shown in Figure 1, with a moving average strategy, shown in Figure 2. These have already been converted into what I call a “summing” strategy – a strategy that can easily be combined with other similar strategies into one “master” strategy. Complete code for both systems is given at the end of the article.

Fig 1

Fig 2

Fig 3

The combination summing code is given at the end of the article. The results are shown in Figure 4.

Fig 4

Since there appears to be only one curve, it means the two results are identical – precisely what we wanted! So, this proves the summing template can be used effectively to trade two strategies in one “master strategy.” Plus, the method is not limited to two strategies – the developer can actually combine as many strategies as he or she desires.

One important note: In the example above, I assumed zero commissions and slippage. So, when you combine strategies, the results should be identical. In reality, though, with commissions and slippage the master strategy will actually have slightly better results, since occasionally conflicting trade signals will cancel out, instead of each being executed.

To recap the method:

  1. Create strategy number 1 in the summing strategy format given in part 2.
  2. Create strategy numbers 2-N in the summing format.
  3. Combine the N strategies together in a new strategy. Care must be taken to have different variable names associated with each strategy. One way to do this is to identify strategy number 1 variables with the suffix “01,” strategy number 2 with “02,” etc.
  4. Insert the master summing strategy created in step 3.
  5. Compare the equity curve of step 4 with the sum of equity curves of strategies in steps 1-2. This check ensures that the strategies were combined correctly.
  6. If the results are the same, then the strategy can safely be traded. Now you are trading two or more strategies with the same instrument in the same account! Tradestation Trade Manager can still be used to check that actual positions match the strategy.

The key to using this method effectively is to create the strategies from the start with the summing code. That is, create it with the end goal of adding it to other strategies. Then, you can run your standard development process (I use my rigorous Strategy Factory process to develop and fully test each strategy) on each component strategy. Once this is done, these component strategies can be added together to create one master strategy – one that will faithfully trade all strategies at the same time.

EasyLanguage Code Download:

The workspace and strategy are availble to subscribers of EasyLanguage Mastery. It's free to join!

When you download the TradeStation WorkSpace and files first, try running each of the summing strategies by itself. Then run strategies 1 and 2 together in that chart. You will see that the results look nothing like they should. Then run Master strategy 03. You will see that its results match strategy 1 plus the results of strategy 2.

If you would like to learn more about building trading systems be sure to get a copy of my latest book, Building Winning Algorithmic Trading Systems.

Other Articles in This Series

Trading Multiple Strategies With The Same Instrument – Part 1 [Updated For 2021]
Trading Multiple Strategies With The Same Instrument – Part 2 [Updated For 2021]

Kevin Davey

About the author

Kevin Davey is a professional trader and a top performing systems developer. Kevin is the author of “Building Algorithmic Trading Systems: A Trader's Journey From Data Mining to Monte Carlo Simulation to Live Trading” (Wiley Trading, 2014.) . He generated triple digit annual returns 148 percent, 107 percent, and 112 percent in three consecutive World Cup of Futures Trading Championships® using algorithmic trading systems.

His web site, www.kjtradingsystems.com, provides trading mentoring, trading signals, and free trading videos and articles. He writes extensively in industry publications such as Futures Magazine and Active Trader and was featured as a “Market Master” in the book The Universal Principles of Successful Trading by Brent Penfold (Wiley, 2010).
Active in social media, Kevin has over 15,000 Twitter followers. An aerospace engineer and MBA by background, he has been an independent trader for over 20 years. Kevin continues to trade full time and develop algorithmic trading strategies.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Learn To Code & Build Strategies
Using EasyLanguage. 

>