NexusFi: Find Your Edge


Home Menu

 





correlation matrix in C# for use in NT?


Discussion in NinjaTrader

Updated
    1. trending_up 2,840 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 2 attachments




 
Search this Thread

correlation matrix in C# for use in NT?

  #1 (permalink)
 drolles 
London, UK
 
Experience: Beginner
Platform: TradeLink, OpenQuant, considering anything that works...
Trading: if it trades...
Posts: 94 since Oct 2010
Thanks Given: 24
Thanks Received: 39

All,

Could someone help?

Has anyone seen a simple implementation of a linear correlation matrix for C# to use in NT?

I’ve found this so far: Linear correlation and statistical functions - CodeProject

I thought the c# implementation of QuantLib might help, but I can’t seem to track it down (https://www.quantlib.org/docs.shtml)

Cheers,

drolles

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


drolles View Post
All,

Could someone help?

Has anyone seen a simple implementation of a linear correlation matrix for C# to use in NT?

I’ve found this so far: Linear correlation and statistical functions - CodeProject

I thought the c# implementation of QuantLib might help, but I can’t seem to track it down (https://www.quantlib.org/docs.shtml)

Cheers,

drolles

The answer is already in the link that you found. Are you trying to take a 2D array as argument instead?

Reply With Quote
  #3 (permalink)
 drolles 
London, UK
 
Experience: Beginner
Platform: TradeLink, OpenQuant, considering anything that works...
Trading: if it trades...
Posts: 94 since Oct 2010
Thanks Given: 24
Thanks Received: 39


Hi,

I’ve managed to craft something using the link above.

It is a simple case of looking at the correlation of 2 instruments. But it is a starter. Code attached here.

It prints the correlations on the necessary timeframe.

I’ve also done an little bit of initial analysis on Gold (GC) vs. ES. Excel attached.

Cheers,

drolles

Attached Files
Elite Membership required to download: Correl.zip
Elite Membership required to download: ES and GC Analysis v1.zip
Started this thread Reply With Quote
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662

Just a note that I posted some R code for calculating and displaying correlation matrices here:



If you want to use via R from a bridge.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on November 26, 2013


© 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
no new posts