NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-20-2012, 09:12 PM   #1
outstretchedarm
Senior Member
 
Join Date: Jun 2011
Posts: 120
Thanks: 10
Thanked 3 times in 3 posts
Default Is there an indicator that can measure the correlation between two instruments?

I'd like a lower level indicator that would measure what is the correlation, in the mathematical sense of the word, between two data points, in this case between the price of two instruments, say the Emini S&P and the 30 year bond.

The math for such correlation is :



(from wiki)

So, if there is some inverse correlation for those two instruments say for the last 3000 periods, it would show as -.89 for the current bar, as it compares the prices of those two instruments.

Not asking anyone to code this for me, but could someone point me in the right direction--where to start?
outstretchedarm is offline  
Reply With Quote
Old 06-21-2012, 03:05 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

To get started for this project, you could check into the Correlation indicator work already shared here on the forums - http://www.ninjatrader.com/support/f...elation&desc=1

All the best,
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-05-2012, 05:28 PM   #3
outstretchedarm
Senior Member
 
Join Date: Jun 2011
Posts: 120
Thanks: 10
Thanked 3 times in 3 posts
Default

Forgot to thank you for this. Thanks
outstretchedarm is offline  
Reply With Quote
Old 11-05-2012, 05:40 PM   #4
outstretchedarm
Senior Member
 
Join Date: Jun 2011
Posts: 120
Thanks: 10
Thanked 3 times in 3 posts
Default

Hmmm, this works like a charm. I thought this would be difficult, but I'm off to an awesome start with this.

This software is really powerful.
outstretchedarm is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Correlation Beng986 Market Analyzer 1 06-11-2012 03:21 PM
Correlation indicator dvercher Charting 5 03-14-2012 06:33 AM
Correlation Indicator klassej Version 7 Beta General Questions & Bug Reports 22 09-08-2010 11:09 AM
Correlation between two instruments bernypaul ATM Strategies (Discretionary Trading) 5 09-30-2009 05:47 AM
Pairs Correlation Indicator FXSurfer Indicator Development 3 04-01-2009 07:17 AM


All times are GMT -6. The time now is 07:31 PM.