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

RE: [AmiBroker] Quotes Plus Industry groups - RE: GROUP ROTATIONS



PureBytes Links

Trading Reference Links

Joe,

I have created a watch list of the !ID001 thru !ID0150. I then use a Ranking AFL against the watch list each weekend after the new indexes have been downloaded.  This ranks the indexes, I then take a closer look at the stocks within the top 5 Industries. I have included the AFL below for you to look at.

 

--------------------------------Begin Code----------------------------------

/*

Simple Sector Rotation Model

bmitchell@xxxxxxxxx

 

This is a simple method for determining the strongest sectors at any given time. Use daily

mode for intermediate term, and weekly for longer term. The basis of it is Daryl Guppy's

Multiple Moving Averages (MMA) plot. Here, I separate the moving averages into short term

and long term averages, and give a point for each moving average above all the long term averages.

 

I do this for every symbol in the watch list except the index being scanned, then I generally

sort the results based on the RS reading. To use this, you need to create a watch list of

symbols, and set WatchlistNum appropriately. Also, you want to define a filter so that you only

scan this watchlist.

 

This is intended only for sector rotation, and probably would not be terribly useful as a trading

system in and of itself. I use TC2000's MG* sector indexes personally.

*/

WL=Param("Watch List #",2,0,100,1); //Here is where I set the watch list I am ranking. This must also be choosen in AA filter.

 

EnableRotationalTrading();

SetOption("WorstRankHeld", 5);

PositionSize = -100;

PositionScore = 0;

WatchlistNum = WL;// Choose the Watch List to Rank

Filter=1;

NumColumns=0;

 

function CalculatePosition(st, Lt1, Lt2, Lt3, Lt4, Lt5, Lt6)

{

            score=0;

 

            if(st > Lt1) score++;

            if(st > Lt2) score++;

            if(st > Lt3) score++;

            if(st > Lt4) score++;

            if(st > Lt5) score++;

            if(st > Lt6) score++;

            return score;

}

 

 

// walk through the watchlist grabbing all the symbols to calculate RS vs ourself.

List = CategoryGetSymbols(categoryWatchlist, WatchlistNum);

for(i=0; (sym = StrExtract(List, i)) != "";i++)

{

            if(sym != Name())

            {

                        f = RelStrength(sym);

 

                        st3 = EMA(f, 3);

                        st5 = EMA(f, 5);

                        st8 = EMA(f, 8);

                        st12 = EMA(f, 12);

                        st15 = EMA(f, 15);

 

                        Lt30 = EMA(f, 30);

                        Lt35 = EMA(f, 35);

                        Lt40 = EMA(f, 40);

                        Lt45 = EMA(f, 45);

                        Lt50 = EMA(f, 50);

                        Lt60 = EMA(f, 60);

 

                        z=BarCount - 1;

                        // uncomment the following if you want to do some backtesting or if you like waiting around

                        // a long time for the exploration to complete

                        //for(z=0;z < BarCount;z++)

                        {

 

                        PositionScore[z] = PositionScore[z] + CalculatePosition(st3[z], Lt30[z], Lt35[z], Lt40[z], Lt45[z], Lt50[z], Lt60[z]);

 

                        PositionScore[z] = PositionScore[z] + CalculatePosition(st5[z], Lt30[z], Lt35[z], Lt40[z], Lt45[z], Lt50[z], Lt60[z]);

 

                        PositionScore[z] = PositionScore[z] + CalculatePosition(st8[z], Lt30[z], Lt35[z], Lt40[z], Lt45[z], Lt50[z], Lt60[z]);

 

                        PositionScore[z] = PositionScore[z] + CalculatePosition(st12[z], Lt30[z], Lt35[z], Lt40[z], Lt45[z], Lt50[z], Lt60[z]);

 

                        PositionScore[z] = PositionScore[z] + CalculatePosition(st15[z], Lt30[z], Lt35[z], Lt40[z], Lt45[z], Lt50[z], Lt60[z]);

 

            }

}

}

IY=Foreign("!TYX", "Close");

EPS=GetFnData("EPS");

VVValue=(100*(EPS/IY));

AddTextColumn(FullName(), "Name",1.0,colorBlack,colorWhite,200);

AddColumn(Close,"Close",1.2);

AddColumn(VVValue,"Intrinsic Value", 1.2, colorBlack,colorLightYellow, 100);

AddColumn(PositionScore[BarCount - 1], "Rank Score");

AddTextColumn( IndustryID( 1 ), "                                                                      Industry name" );

AddTextColumn( SectorID( 1 ), "                               Sector name" );

SetSortColumns(-6,-5);

----------------------------------End Code --------------------------------------

 

Donald F Lindberg


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Joe Landry
Sent: Sunday, August 05, 2007 3:38 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [AmiBroker] Quotes Plus Industry groups - RE: GROUP ROTATIONS

 

Don, I don't understand exactly what you mean.  I know QP updates the !ID001 thru !ID0150

on a weekly basis.  How do you use this to determine group rotation?  Relative strength of each

index   !ID001 or is there another function that I'm overlooking.

Regards

Joe

----- Original Message -----

From: Don Lindberg

Sent: Saturday, August 04, 2007 8:43 PM

Subject: RE: [AmiBroker] Quotes Plus Industry groups

 

Allan,

QP will automatically assign sectors and industries as well as showing all the members of all of the groups.  In addition each Saturday QP downloads the group rotations, which I find very useful.  As far as setting up ATC, since I don’t know what you were doing I can’t help you on changing it. Little more info, and we’ll see what we can do.

Don Lindberg


From: amibroker@xxxxxxxxxps.com [mailto:amibroker@xxxxxxxxxps.com] On Behalf Of matrix10014
Sent: Saturday, August 04, 2007 6:31 PM
To: amibroker@xxxxxxxxxps.com
Subject: [amibroker] Quotes Plus Industry groups

Hi all,
I am giving Amibroker another shot after having difficulties setting
up my database in a sector/group/stock format...This time around,I
plan on keeping it much simpler..

If i am not mistaken Quotes Plus has decreased the number of industry
groups fromm 200 to 150 since the last time I ran ATC and Ami.In my
group 253,I have apx 200 groups.What should I do to set up the group
structure in Ami to mirror the 150 group structure in Quotes Plus??

Any and all help appreciated

Allan

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___