#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

### Correlation of market indicators

Updated on 2010-05-11

In the previous post, which can be found here How to create a market timing system, we started to introduce a technique to create a market timing system using several market and composite indicators. We began by assembling market indicators and creating composite indicators using the composite plug-in, and then we used the rules analyzer to simulate various strategies. Finally, we picked the most profitable rules, the ones that may have a predictive power.

The first part was easy, the second won't be as easy, but it won't be very difficult either.

There is something important we need to consider; even if the rules we have gathered use different formulas, they may be highly correlated. In the next paragraph, we will calculate the correlation between the trading indicators and dismiss some of those with high correlation.

Create a new list of rules and add a new time series for each market indicator.
Example: for the number of stocks closing above their 10-bars moving average, you should create the following rule/time series:
GetSeries("_SMA10", close, LastData)

Click on "Mass Rules" to create several trading rules from the previously added time series. Your formulas should appear on the left panel. Under the "Masks" formula editor, type the following formula
Then click on "Create Rules".

"Correl" is a QuantShare function that calculates the correlation between two vectors. The third parameter specifies the period to use in the calculation; in this example, the value is set to 30. The first and second parameters contain predefined variables that instruct the trading software to update these values with the rules that are specified in the left panel - the one you created.
The idea is to detect how many times or the number of bars where the correlation between two market indicators is higher than 70%. If the rule is true during a high number of bars, then we dismiss the indicator that have less predictive power, according to the simulations we did previously - in the older post.

To start the simulation process, click on "Analyze the list". There are not a lot of things that need to be changed. Make sure that your index ticker symbol is selected and then go the Outputs control. Uncheck all outputs, select the "N-Bar stop" and set the number of bars to zero.
When the report is complete, sort the table by the "Positions" Column; the higher the "Positions" value is, the more correlated the two time series are.
The "Positions" value represents the number of bars where the 30-bar correlation between the two time series is higher than 70%.

Note:
- Make sure that the indicators' first bar starts before the "Start Date" defined in the Analyzer Settings form.
- we could have created a metric to determine whether to accept or reject a time series depending on its correlation with other indicators.

You finally come up with a list of profitable and non-highly correlated market indicators. We will now combine these rules and that is what the next post will be about.