[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: AFL, pairs trading



PureBytes Links

Trading Reference Links

Thanks,
I need to modify my question; creating several thousands of correlation arrays might not be the best solution. Instead I would want to calculate the correlations one at a time, the main point being that I need to go through all possible paircombinations while writing the result to some new array (that can be interpreted afterwards). My immediate thought is som form of nested loop.. How can one scroll through all combinations in a Group? 
Thanks 

--- In amibroker@xxxxxxxxxxxxxxx, Craig Broadbear <craig@xxx> wrote:
>
> I use the following exploration to create a correlation table:
> 
> 
> CorrPd = 30;
> list = GetCategorySymbols( categoryGroup , 0);
> 
> SetOption("NoDefaultColumns",True);
> Filter = Status("LastBarInTest");
> SetSortColumns( 1 );
> AddTextColumn(Name(),"Correlation",1.0);
> Ticker1= Name();
> 
> for( Col=0; (Ticker2=StrExtract( List, Col))!= ""; Col++)
> {
>         Var2 = Foreign(Ticker2,"C");
>         Corr = Correlation( C, Var2, CorrPd);
>         Color = IIf(Corr>0, colorBrightGreen, IIf(Corr<0,
> colorRed,colorWhite));
>         Color = IIf(Ticker1==Ticker2, 1, Color);
>         AddColumn( Corr, Ticker2, 1.3, 1, Color);
> }
> 
> 
> 
> Craig
> 
> 
> On Mon, Sep 7, 2009 at 6:11 AM, h3po <h3pooo@xxx> wrote:
> 
> >
> >
> > Say, I have a Group1 in Amibroker populated with 180 stocktickers. For
> > every combination of the stocks in this Group I want to create and calculate
> > a Correlation array. What will be the shortest AFLsyntax to accomplish this?
> > Any hints appreciated.
> > Thanks
> >
> >  
> >
> 
> 
> 
> -- 
> Broadgun Software
> www.pdfmachine.com
> www.museum-email-archive.com
>




------------------------------------

**** 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/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/