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

[amibroker] Rotational Strategy



PureBytes Links

Trading Reference Links

I was watching CNBC yesterday and John Stoval was talking about the
following strategy so I tried my hand at coding it up in Amibroker.
However, I am stumped about in trying to do the annual rotation each
February. 

Any guidance and code pointers would be certainly appreciated.

Here is what I have so far:

/*John Stovall strategy from CNBC interview which accoring to him 
outperforms the S&P 500 over 75% of the time. Picks the best 10
performing industry groups from the end of January and establishes
equal weighted positions for the rest of the year rotating next
February.*/

numgroups = 10;
EnableRotationalTrading();
SetOption("MaxOpenPositions", numgroups );
SetOption("WorstRankHeld", numgroups );
 
PositionSize = -100/ numgroups;

Rank  = Month()==1 AND (ROC( C, 20 )+1000);
SignalMonth = (Month() == 2  AND Day() < 3); // buy in February  
Rank  = Month()==1 AND (ROC( C, 20 )+1000);
 
score = Rank AND SignalMonth; // 
 
BeginningOfTheYear = Year() != Ref( Year(), -1 );
 
PositionScore = IIf( BeginningOfTheYear, score , scoreNoRotate );

Thanks

Dave





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

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