PureBytes Links
Trading Reference Links
|
Its amazing what results you can get by playing around with Buy/Sell
rules. I was reading Thom DeMark's bk last night and came upon the
Range Expansion Index indicator. This morning - I saw that REI was
already coded into AFL library by Thomasz Janeckzo. I simply took
the REI code and 'played' around with Buy/Sell rules during lunch
hour. Here's the results:
My settings were 'Long' only, $16 comm, 50% MARGIN, $10k equity and 1
day delay in Buy and Sell.
I only tested the most volatile sector: Wireless (pulled from YAHOO
Finance).
Bear Mkt test : 6/14/2000 - 6/13/2002 - only 7 trades for a 9%
profit. This is when the wireless sector was down by about 80% - 90%
or so - I think.
Bull Mkt test: 6/14/2002 - 6/13/2004 - 170 trades with a 216% profit.
Range Bound Mkt - 6/14/2004 - 6/13/2005 - 90 trades with a 18% profit.
Here's the AFL code
********************************************8
/*
** Tom DeMark's Range Expansion Index
** AFL Implementation by Tomasz Janeczko
*/
HighMom = H - Ref( H, -2 );
LowMom = L - Ref( L, -2 );
Cond1 = ( H >= Ref( L,-5) OR H >= Ref( L, -6 ) );
Cond2 = ( Ref( H, -2 ) >= Ref( C, -7 ) OR Ref( H, -2 ) >= Ref( C, -
8 ) );
Cond3 = ( L <= Ref( H, -5 ) OR L <= Ref( H, -6) );
Cond4 = ( Ref( L, -2 ) <= Ref( C, -7 ) OR Ref( L, -2 ) <= Ref( C, -
8 ) );
Cond = ( Cond1 OR Cond2 ) AND ( Cond3 OR Cond4 );
Num = IIf( Cond, HighMom + LowMom, 0 );
Den = abs( HighMom ) + abs( LowMom );
TDREI = 100 * Sum( Num, 5 )/Sum( Den, 5 ) ;
/*
** Tom DeMark's Range Expansion Index
** AFL Plot and Buy/Sell Rules by Dickie Paria
*/
Plot( TDREI, "TDREI", colorRed, styleThick );
Plot (0,"",colorSeaGreen,styleNoLabel);
Plot (-45,"",colorBlue,styleNoLabel); // shows a blue line through -45
Plot (45,"",colorBlue,styleNoLabel); // shows a blue line through 45
Graph0 = TDREI;
RAD_TO_DEG = 180/3.1415926; // radians to degrees
LinRegAngleTDREI = RAD_TO_DEG * atan( LinRegSlope( TDREI, 3 ) );
Buy = EMA(Avg, 50) > EMA(Avg, 100) AND LinRegAngleTDREI > 30 AND
TDREI >= -45 AND TDREI < 0 ;
Sell = LinRegAngleTDREI < -20 OR (TDREI <= 45 AND TDREI > 0) ;
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/
|