PureBytes Links
Trading Reference Links
|
Folks,
Attached is an updated version of an earlier post on this subject.
The problem of not being able to compare the stock's index to the
market index is resolved.
As per my earlier post (3 times - unfortunately - apologies) the
exrem problem remains.
This code is more aggressive than the earlier post on the Stan
Weinstein criteria. It now only looks for one white candle to
trigger. It's now almost a dead cat bounce buy criteria - hence as
stated is really for creating a watch list rather than a buy list -
unless you're very bold and could monitor intra day.
Geoff
/* Stan Weinstein Buy Criteria - Afl implementation by Geoff Mulhall
18/4/2001 */
dollars = 5000;
maLong = 150;
maShort = 13;
maRelStr = 2;
/* sufficient liquidity ie share purchased less than 2% of weekly
volume*/
cond1 = dollars/close < 0.02 * sum(volume,maLong)/(maLong/5);
/* Stage 2 stock - Uncomment for buy criteria */
/* cond2 = close > ma(close,maLong); */
/*close above MA and a Stage 4 stock - Un comment for watch criteria
*/
cond2 = close > ma(close,maShort) AND close < ma(close,maLong);
/* one white soldier detected */
cond3 = close > ref(close,-1) AND ref(close,-1) > ref(close,-2) AND
close > open;
/* Moving Average is rising or flat */
/* cond3 = ma(close,maShort) >= ref(ma(close,maShort),-1); */
/* beginning to trend over the last 2 days */
cond4 = low > ref(low,-1) AND ref(low,-1) >= ref(low,-2) AND high >
ref(high,-1) AND ref(high,-1) > ref(high,-2);
/* gradient of the relative strength is increasing compared to its
index */
cond5 = ma(relstrength(""), maRelStr) >= ref(ma(relstrength(""),
maRelStr), -1 * maRelStr);
/* relative strength of the stocks index is increasing compared to
XAO*/
indexStr = relstrength("XAO")/relstrength("");
cond6 = ma(indexStr,maRelStr) >= ref(ma(indexStr, maRelStr), -1 *
maRelStr);
buy = cond1 AND cond2 AND cond3 AND cond4 AND cond5 AND cond6;
sell = 0;
/* buy = exrem(buy,sell); */
/* sell = exrem(sell,buy); */
|