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

Re: [amibroker] Channel Breakout - Exrem problem.



PureBytes Links

Trading Reference Links

Hi Geoff,

Thank you for posting the formula.

As for ExRem() - it needs a valid sell rule to work.
You can not use it is when sell condition is always FALSE
(sell = 0 ) as in your example.

ExRem( triggerarray, resetarray ) works as follows:

1. returns true on first bar that is true on trigger array
2. returns false until there is a non-zero value in the second array
3. repeat step 1

triggerarray = 
0,1,1,1,1,0,1,1,0,0,0,0,1,1,0,1,0
resetarray = 
0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0
ExRem() = 
0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0 


Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: <gmulhall@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, April 22, 2001 11:23 AM
Subject: [amibroker] Channel Breakout - Exrem problem.


> Folks,
> 
> Attached is a variation on Tomasz's breakout code. This avoids the 
> problem of having to specify a percentage threshold as it uses the 
> average true range to dynamicaly determine if there has been a 
> breakout.
> 
> There is also code to ensure you are only looking at a stock which is 
> outperforming it's index and that index is out performing the whole 
> of market index (XAO - All ordinaries in Aust). 
> 
> It's simple but pretty effective. The idea comes from Chris 
> Tate's 'The Art of Trading' Wrightbooks.
> 
> I still find exrem removes buy signals which I'm not expecting it to. 
> Any ideas anyone. 
> 
> Tomasz ??
> 
> Geoff
> 
> 
> /* Breakout - Afl implementation by Geoff Mulhall 18/4/2001 */
> 
> dollars = 5000;
> 
> range = 20;
> 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);
> 
> /* Breakout Criteria */
> 
> channeltop = ref(hhv(high,range), -1);
> channelbottom = ref(llv(low,range),-1);
> oneAtr = ref(atr(range),-1);
> 
> cond2 = close > channeltop + oneAtr; 
> 
> /* one white soldiers detected */
> 
> cond3 = close > open; 
> 
> /* gradient of the relative strength is increasing compared to its 
> index */
> 
> cond4 = ma(relstrength(""), maRelStr) >= ref(ma(relstrength(""), 
> maRelStr), -1 * maRelStr);
> 
> /* relative strength of the stocks index is increasing compared to 
> XAO*/
> 
> indexStr = relstrength("XAO")/relstrength("");
> 
> cond5 = ma(indexStr,maRelStr) >= ref(ma(indexStr, maRelStr), -1 * 
> maRelStr);
> 
> buy = cond1 AND cond2 AND cond3 AND cond4 AND cond5;
> 
> sell = 0; 
> 
> /* buy = exrem(buy,sell); */ 
> /* sell = exrem(sell,buy); */
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
>