[amibroker] Correlation for Period as Array

 

Dear AFL Experts,

The Calculation of Correlation() has below logic:

function Correlation( x, y, period )
{
nom= MA( x * y, period ) - MA( x, period ) * MA( y, period );
denom = sqrt( MA( x ^ 2, period ) - MA( x, period ) ^ 2 ) *
sqrt( MA( y ^ 2, period ) - MA( y, period ) ^ 2 );
return nom/denom;
}

Note: X and Y are array1 and array2. period is not an array but a static number.

The issue I am facing is, I need to pass the parameter "Period" Dynamically and not  Static Period. I have an array called "period".

But above function only accepts a period as a static value and not array.

Any one can help me with hacking this? It's lot more challanging for my AFL skills yet.

__._,_.___

Posted by: meanomalist@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon