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

[amibroker] Rotational Trading



PureBytes Links

Trading Reference Links


I am trying to develop a rotational trading system in the backtester 
for ETF's. What I want to do is evaluate the funds on Friday (EOD) 
for buy and sells on the following Monday.  I am looking to divide 
the portfolio equally amongst the 4 funds that exhibit the "best 
scores" on a "long only basis"

The following code mostly picks buys on Mondays, (why ALL are not on 
a Monday still puzzles me) but in each case the backtester sell them 
on the day following the buy (instead of being sold on the following 
Monday) at the open if it no longer ranks in the top 4.  

If anyone can point out why this happens, I would be most 
appreciative.  Here is the code:

EnableRotationalTrading(); 
SetTradeDelays( 1, 1, 1, 1 ); 
SetOption("InitialEquity", 10000 ); 
SetOption("AllowPositionShrinking", True ); 
SetOption("MaxOpenPositions", 4 ); 
SetOption("WorstRankHeld",5); 
PositionSize = -100/4; 
PS = 0.5*MA(ROC(C,1),3) + 0.25*MA(ROC(C,2),3) + 0.125*MA(ROC(C,4),3) 
+ 0.08 *MA(ROC(C,12),3) + 0.045*MA(ROC(C,52),3)AND DayOfWeek() == 5;
PositionScore = Max(PS,0); // pick longs only

Thanks in advance
Rick







------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/