NexusFi: Find Your Edge


Home Menu

 



Categories Help    






 
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.

Spreads
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:

https://www.cmegroup.com/trading/interest-rates/files/ics-ratios-2015-12.pdf

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
Comments/ratings
5 * Devil Man September 7th, 2015 09:01 PM
This is very useful thank you @timendaGain
5 * stef September 8th, 2015 03:22 AM
Thank you !
5 * Zondor September 13th, 2015 03:34 PM
No Comment
5 * leonex September 15th, 2015 04:12 PM
Grazie
5 * jmagaia September 27th, 2015 07:14 PM
Thanks
5 * phantomtrader October 14th, 2015 07:00 AM
Great indicator -
5 * ericson March 6th, 2017 11:28 AM
GREAT

 
Sort by

 




© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top