NexusFi: Find Your Edge


Home Menu

 





I don't know how to get this correlation function to work...


Discussion in Platforms and Indicators

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




 
Search this Thread

I don't know how to get this correlation function to work...

  #1 (permalink)
lighteningmcqueen
Bath + Somerset
 
Posts: 2 since Jun 2017
Thanks Given: 0
Thanks Received: 0

Hi,

I really want to know how to implement this. I want to measure correlation between instruments but the correlation range needs to dynamically be determined. I tried to find ways to implement the array as a number by using LastValue ( range ) but this seems to default to 0 and doesn't work. It looks like I need to implement some kind of a loop but don't know how to do it.

Say we have this below

bi = BarIndex();
S = Cross(MA(C, 4), MA(C,8));
c1 = ValueWhen( S, MA(C, 4), 1) > ValueWhen( S, MA(C, 4), 2);
Range = ValueWhen( S, bi, 1) - ValueWhen( S, bi, 2);
c2 = Correlation(C, Foreign("APPL", "C"), Range) > 0.7;

// You can see the correlation between the stocks are determined by the two cross over points which always changes.

Buy = c1 and c2;

Please help me implement this !

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Quantum physics & Trading dynamics
The Elite Circle
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
32 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Trading with Intuition
17 thanks
Self sabotage reframed
14 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #2 (permalink)
 iildm 
Italy
 
Experience: Beginner
Platform: AmiBrojer,NinjaTrader,ProRealTime
Trading: STOXX
Posts: 8 since Feb 2011
Thanks Given: 170
Thanks Received: 6

Hi,
please search for "Correlation for Period as Array" in old Amibroker forum (around May 22, 2016)
Good luck and Regards
Luca

Reply With Quote




Last Updated on July 6, 2017


© 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