The Elite Circle - atgPairsCorrelation
futures io futures trading

Categories Help    

The Elite Circle
File sharing for Elite Members only, includes any and all platforms and file types

atgPairsCorrelation 5 *
atgPairsCorrelation - NinjaTrader correlation indicator

Exported using NT version 7.0.1000.29.

Change Log
2015-09-08 - Added support to automatically label the plots.
2015-09-14 - Speed enhancements. Reduced 5 loops through the correlation period to 1 loop.

The atgPairsCorrelation indicator plots the correlated logarithmic returns of two data series.

Thanks to @Oysteryx for helping me make this indicator.

The inputs to the indicator are standard price series data. The indicator internally generates the logarithmic returns and calculates and plots the correlation between them. The value ranges between -1 and +1. A positive value means that the two data series are correlated ( moving together ) while a negative value means they're moving in opposite directions. The magnitude of the value expresses the fidelity of the correlation. A value of 1 is achieved if you compare an instrument with itself.

In addition to comparing pairs of data series, special functionality is included that allows you to compare with an interest rate spread.

A template to load the indicator as displayed in the screen shot is available on the support thread. The template displays the correlations of the following instruments:

ES -> ZN/ZT spread
ES -> 6J
ES -> CL
ES -> GC
ES -> ZB
ES -> 6A
ES -> 6E

Itís assumed that the primary data series loaded on the chart is one of the two data series to be correlated. The chart series is always compared with one other series that the indicator loads internally. You may of course use any data series you want on the chart and in the settings for the indicator to run correlation studies on pairs of interest to you.

To use the template (see support thread ) load it on a chart of the ES with at least 365 days of daily data. This template loads 7 instances of the atgPairsCorrelation into a single chart panel so that their plots are overlaid.

Here are some basic property settings to configure the indicator to compare the ES to the 6J contract ( USDJPY futures contract ):

You must maintain the property settings for each instance so that the contract months are current.

For running a correlation on an interest rate spread you must enter the two instruments involved in the spread into SpreadLeg1 and SpreadLeg2. In addition you must enter weights for each leg of the spread. the CME publishes these weights here:

They are frequently changed so be sure to check it regularly. Hereís an example of how to configure an interest rate spread:

The SecondInstrument parameter ( set to ES 09-15 ) is ignored if SpreadLeg1 and SpreadLeg2 are populated.

The CME weights found on the aforementioned web page for each leg are specified in SpreadLeg1Weight and SpreadLeg2Weight.

Known issues:
  • Inefficient correlation algorithm
  • Chart stays on top of the z-order.

Category The Elite Circle 
Suggest other entries I might like
Details: atgPairsCorrelation
Category: The Elite Circle 

September 8th, 2015
Size: 3.71 KB
Downloaded: 965 times


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.