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

[amibroker] Complete AFL code for the Triple Momentum Trading System



PureBytes Links

Trading Reference Links

I came across the 'Triple Momentum' trading system while browsing 
through Gerald Appell's latest book, "Power Tools........".  Its a 
simple market timing system for Nasdaq100.  Basically - he takes the 
percentage rate of change for the Nasdaq Composite for the 5 day, 15 
day and 25 day period.  He then sums them up.  His buy condition and 
sell conditions are simple.  If the sum of the rate of change (for 
the 3 periods) is greater than 4% (i.e., the plotted line crosses 4% 
from below) - he buys.  If it drops below 4% from above - he sells.
If I remember correctly - he tests it year by year for the last 15-20 
yrs or so.  His average annual gains is 18%+ while the buy and hold 
results are 8%/yr or so.
Attached is the code.  Perhaps someone can test it against Nasdaq100 
(yr by yr) and post it on this discussion.  Also - I only glanced 
through the book for a few minutes.  My explanation above is from 
memory and I would appreciate it if someone would check my code 
against the books explanation and make any corrections/suggestions.  
I added a 'Short' and 'Cover' rule which is not in the book.  I 
believe his system only bought 'Long'.  AFL code below
*******************************************
/* Triple Momentum Trading System 
** from Gerald Appells book "Power Tools......."
** Coded by Dickie Paria for AB Group Discussion, 
*/


Cond1 = 100 * ((Close - Ref (Close, -5))/Ref (Close, -5));
Cond2 = 100 * ((Close - Ref (Close, -15))/Ref (Close, -15));
Cond3 = 100 * ((Close - Ref (Close, -25))/Ref (Close, -25));

TripleMLine = Cond1 + Cond2 + Cond3;

Plot( TripleMLine, "TripleMLine", colorRed, styleThick );
Plot (4,"",colorBlue,styleNoLabel);

Buy = Cover = Cross (TripleMLine, 4);
Sell = Short = Cross (4, TripleMLine); 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/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/