Re: [amibroker] Correlation for Period as Array

 

Your AFL skills are far better than mine, but I can say you probably mean to have nom as num, since you're referring to the numerator.
Small English issue, but you may as well have it right.
Good luck getting your answer from someone who knows AFL a lot better than I do.

On Sun, May 22, 2016 at 10:35 PM, meanomalist@yahoo.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

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.




--
Karl Bergerson (カール バーガーソン)

〒002-0857
 札幌市北区屯田7条11丁目10-10
電話 050-5809-7325 (Skype)

__._,_.___

Posted by: Karl Bergerson <karl.bergerson@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

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