## Intermarket Divergence – A Robust Method for Signal Generation

In this research, we introduce you to a still current method, which allows you to generate robust trading signals in Easylanguage.

This can be very useful when creating or improving your own trading strategies. Many markets are interrelated. These interrelationships can offer predictive capabilities for many markets. The study of these interrelationships is called intermarket analysis.

In this article, I will briefly explain a robust method for generating robust signals for a wide range of markets. I’ll also offer you a free TradeStation tool to help you explore inter-market relationships. Standard inter-market correlations are not useful if our goal is to predict future prices or generate profitable signals because the current correlation tells us nothing about future prices.

A methodology we originally developed in the mid-1990s, called intermarket divergence, allows us to gauge the predictive power of an intermarket relationship and produce 100% objective signals. For the last 17 years we have used this methodology to develop trading systems that have produced robust and reliable trading signals even 17 years after the models were originally developed without any re-optimization.

Other intermarket relationship processing methodologies to develop trading signals may work just as well during sample periods, but not as well during walk forward periods and during actual trading. A widely known intermarket relationship is the one between the S&P 500 and the 30-year Treasury bond. Bond prices are generally positively correlated with the S&P 500 (while yields are negatively correlated), although this is not always true, bonds should generally lead stocks at turning points.

Another important fact is that one of the best trades to make on the S&P 500 is when the 30-year Treasury diverges from the S&P 500; For example, when (a) bonds are going up and the S&P 500 is going down, buy the S&P 500 and (b) bonds are going down and the S&P 500 is going up, sell the S&P 500. Although this relationship has been lost in the In recent years, its long-term existence is of historical importance to the science of intermarket analysis.

### A simple but powerful method to predict the market

We’ll use the classic mechanical methods of trading intermarket relationships, applying them to the 30-year Treasury note using a concept called “intermarket divergence” (first coined in 1998), which is when one traded market moves in an opposite direction to the other. expected.

For example, if we were trading the S&P 500, for the 30-year Treasury to go up and the S&P 500 to go down would be a divergence, since they are positively correlated. If we were to trade the 30-year Treasury, both bonds and gold going higher would be classified as divergence as they are negatively correlated.

We will define an uptrend when prices are above a moving average and a downtrend when they are below the moving average. We can now predict with some reliability the future direction of bonds, stocks, gold, oil, and even currencies using this simple intermarket divergence model. The pseudocode for this basic model is as follows:

### Price relative to a simple moving average

### Positive correlation

### Negative correlation

This simple concept depicted above has proven to be a robust methodology for predicting future price action using inter-market analysis. In 1998, I published a simple intermarket-based system for trading 30-year Treasury bond futures. This model used “The NYSE Utility Average (NNA)”, which was a basket of utility stocks. The NNA was deprecated in 2004. Another utility index that also performed quite well was the Philadelphia Electric Utility Index, which was used as a surrogate for the NNA in our research. In 1998, when I did the original research and article, both indices functioned similarly, but the NNA had a longer price history than the UTY. The original analysis using NNA was done as follows: We used a positively correlated intermarket divergence model with an eight-day moving average for the 30-year Treasury note and an 18-day moving average for the NNA. We did the test during the period from January 1, 1988 to December 31, 1997. We do not discount anything for slippage and commission. My original published results were as follows:

- Net profit: $111,293.00
- Operations: 126
- Winning Percentage: 60%.
- Average trades: $883.38
- Drawdown: $-8,582.00
- Gain Factor: 2.83

Let’s now see how the UTY worked during this same period using the original set of parameters used with NNA. This parameter set was not optimal for UTY, but we used the NNA parameter set for consistency to show the robustness of our model:

- Total Net Profit: $83,557.98
- Total number of operations: 141
- Profitability percentage: 58.87%
- Average Trade (profits and losses): $592.61
- Intraday Max Drawdown: ($11,722.50)
- Gain Factor: 2.03

## Out-of-sample results

Let us study only the out-of-sample period with a first operation after 01/01/1998 to 10/25/2011.

- Total Net Profit: $129,166.32
- Total number of operations: 257
- Profitability percentage: 61.87%
- Average Trade (profits and losses): $502.59
- Intraday Max Drawdown: ($26,133.36)
- Gain Factor: 1.67

We can see that these out-of-sample results are very similar to the results for the entire period and the average trade differs by less than 20% between the in-sample and out-of-sample periods. Let’s look at the out-of-sample results year by year (see table I).

Divergence between markets – Table 1

We have seen that intermarket divergence is a powerful concept. When an intermarket divergence occurs, we hold that position until an opposite divergence occurs. You have to ask yourself: “Why does this concept of divergence work?” Also, what’s interesting is that my research shows that zero crossing is significant, we can’t improve intermarket divergence results by using a non-zero threshold. I think this concept works like an officiating play. Since we do not know the relative balance between the traded market and the underlying market, for example in the case of Treasuries and UTYs, divergence is the only confirmed valuation error; we have in terms of a reliable refereeing play. We know that this cannot be the most efficient signal. If we study our operations with Treasury bonds, we will see that some operations are brought forward; in others, we return a large percentage of open profits, and sometimes big wins can turn into losers, even as intermarket divergence continues to produce extraordinary results.

Divergence Trades Example

Here we have a very profitable trade, but we gave back almost all of the profit, and then the market moved back in the direction of the trade. This shows a problem with intermarket divergence, ie the “Reversal Strategy” that is always in the market. There are other cases that include (a) a winning trade that ends up losing and (b) trades that never become profitable. Despite these problems, our results are surprising. One solution to this problem is to build a finite state machine that covers all possible states of the intermarket relationship during the process of going from “long to short” or “short to long.” My research has shown that this state map of all possibilities is the key to vastly improving the performance of these simple divergence models. We can also create a state map that allows us to combine multiple intermarkets with a market in which we are operating. Intermarket forward correlation and correlation analysis can also be used to filter and refine these models. Correlation analysis can sometimes make long-term out-of-sample performance less robust if it is not integrated carefully. Therefore, it is important to perform the surface analysis discussed above to ensure that the correlation relationships we are observing are robust and stationary.

## Closure:

Intermarket divergence is not something that only works in the bond market. It works across a wide range of markets, from bonds to equity groups to currencies; even in markets like gold, crude oil, live cattle and copper.

Intermarket analysis is an exciting area of market production. New methodologies for representing these relationships will help not only the development of classical trading systems, but also the use of advanced technologies such as, for example, the use of a finite state model can allow machine learning methods to easily see patterns. that can be used to build more reliable models.

Build robust and profitable systems that predict market turning points with this tool.

This article was written by Murray Ruggiero and published on May 27, 2019.

## Quantified Models Youtube Channel

On our YouTube channel we have several videos available that you may find very useful for developing trading systems. To access, click this link: Quantified Models YouTube Channel

We hope this information has been useful to you.