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

Re: [amibroker] Bow Tie



PureBytes Links

Trading Reference Links


Hello David,
 
I looked at your formula at here is my 
comment:

 

cond1=cross (ma(close, 10 ),ema (close, 
30));cond2=ref(cross (ma(close, 10 ),ema (close, 
30)),-1)>0;cond3=ref(cross (ma(close, 10 ),ema (close, 
30)),-2)>0;cond4=ref(cross (ma(close, 10 ),ema (close, 
30)),-3)>0;cond5=ref(cross (ma(close, 10 ),ema (close, 
30)),-4)>0;cond6=ref(cross (ma(close, 10 ),ema (close, 
30)),-5)>0;cond7=ref(cross (ma(close, 10 ),ema (close, 
30)),-6)>0;cond8=ref(cross (ma(close, 10 ),ema (close, 
30)),-7)>0;cond9=ref(cross (ma(close, 10 ),ema (close, 
30)),-8)>0;cond10=ref(cross (ma(close, 10 ),ema (close, 
30)),-9)>0;
 
condtrue=cond1 or cond2 or cond3 or cond4 orcond5 or 
cond6 and cond7 and cond8 and cond9;
All above statements could be replaced by a 
single:
condtrue = hold( cross( ma( close, 10 ),ema( 
close, 30 ) ), 10 );
 
There is no need for a magic with "reseting" 
back to false.
 
Best regards,
Tomasz Janeczko
 
 
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
David 
Holzgrefe 
To: <A title=amibroker@xxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: 14 May, 2001 11:58
Subject: Re: [amibroker] Bow Tie

so what i realy need is a way cancel thetrue if 
the condition becomes false
 
iff var0<1 then var1 = 0 ; ???
or something similar 
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Tomasz Janeczko 

To: <A title=amibroker@xxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Monday, May 14, 2001 7:21 
PM
Subject: Re: [amibroker] Bow Tie

Hi,
 
In fact Steve's solution:
 
var0 = cross (ma(close, 10 ),ema (close, 30) ) ;var1 = 
IIF(HHV(var0,-10) = 1,1,0) ;
is equivalent to
 
var1 = Hold( var0, 10 );
 
so var1 remains true if at least 
one "true" signal occured within previous 10 
bars. 
 
Best regards,
Tomasz Janeczko
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
<A title=gmulhall@xxxx 
href="">Geoff Mulhall 
To: <A 
title=amibroker@xxxxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 

Sent: 14 May, 2001 10:06
Subject: [amibroker] Bow Tie

David,
 
I think Steve's second email is a 
good solution using Cross in conjunction with HHV - it allows 
you to look backward in time. 
 
I'll continue to play around as thisscan it 
something I will use.
 
Tomasz,
 
Can you please confirm that the Hold 
condition sets the array to 1 forward in time the specified 
number of slots in the hold result array from the first position 
where it was set to 1 (ie true) ?
 
Thanks,
 
Geoff 
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
David 
Holzgrefe 
To: <A 
title=amibroker@xxxxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 

Sent: Monday, May 14, 2001 10:07 
AM
Subject: Re: [amibroker] ref
ok I'm concerned that if the condition changes ami 
will still hold it trueeven though it is now false using the 
hold()."This true result is held true over the number of periods 
specified even ifa "false" result is generated. "I don't 
wish to extend the condition forcing a false signal.What I wanted 
was if condition x is meet then as long as its true look forthenext 
condition .I guess you can see the intent in the bow tie 
formula.has the ma10,ma20 ,ma30 crossed in the last xn 
daysif yeshas the pull back occurredif yeshas the higher 
high occurredif all 3 conditions are true then signal a 
buyGeoff's multi  condition does it but was looking for a 
cleaned way toexpress it .Maybe i just have to nest a bunchof 
conditions and if there true nestanother.DOES THIS MAKE 
sense to anyone or is my logic out of sync/* Bow Tie conditions 
- Short term moving average has crossed the long termmoving average 
sometime in the last xn days - Add more conditions for moredays 
*/cond1=cross (ma(close, 10 ),ema (close, 
30));cond2=ref(cross (ma(close, 10 ),ema (close, 
30)),-1)>0;cond3=ref(cross (ma(close, 10 ),ema (close, 
30)),-2)>0;cond4=ref(cross (ma(close, 10 ),ema (close, 
30)),-3)>0;cond5=ref(cross (ma(close, 10 ),ema (close, 
30)),-4)>0;cond6=ref(cross (ma(close, 10 ),ema (close, 
30)),-5)>0;cond7=ref(cross (ma(close, 10 ),ema (close, 
30)),-6)>0;cond8=ref(cross (ma(close, 10 ),ema (close, 
30)),-7)>0;cond9=ref(cross (ma(close, 10 ),ema (close, 
30)),-8)>0;cond10=ref(cross (ma(close, 10 ),ema (close, 
30)),-9)>0;SYNTAX  hold( EXPRESSION, periods 
)RETURNS  ARRAYFUNCTION  Extends a "true" result of 
EXPRESSION for the specified number ofperiods. This true resultis 
held true over the number of periods specifiedeven if a "false" 
result is generated.EXAMPLE hold( cross(rsi(14),70),5 )----- 
Original Message -----From: "Steve Wiser" 
<slwiserr@xxxx>To: 
<amibroker@xxxxxxxxxxxxxxx>Sent: Sunday, May 13, 2001 8:31 
PMSubject: Re: [amibroker] ref> 
David:>> Check out the function "Hold".  I thinkthis 
will do what you are asking.>> 
Steve>>> HOLD:>> SYNTAX hold( 
EXPRESSION, periods ) RETURNS ARRAY FUNCTION>> Extends a 
"true" result of EXPRESSION for the specified number of 
periods.>> This true result is held true over the number 
of periods specified even if> a "false" result is 
generated.>> EXAMPLE hold( cross(rsi(14),70),5 
)>>> At 08:29 PM 5/13/01 +1000, you wrote:> 
>TJ is there a way for ami to look for a condition true over xn 
periods> >> >eg> >> >ref(cross 
(ma(close, 10 ),ema (close, 30)),-10)>0;> >> >so 
that ami look for the true condition over the last 10 periods> 
>no just 10 periods ago ?> >> >may have asked 
this before> >> >> >Thanks David> 
>> >Your use of Yahoo! Groups is subject to the> 
><<A 
href="">http://docs.yahoo.com/info/terms/>Yahoo! 
Terms of Service.>>>>>> Your 
use of Yahoo! Groups is subject to <A 
href="">http://docs.yahoo.com/info/terms/>>>Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of 
Service. Your use of Yahoo! Groups 
is subject to the Yahoo! Terms 
of Service. Your use of Yahoo! Groups 
is subject to the Yahoo! Terms 
of Service. Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.