PureBytes Links
Trading Reference Links
|
ok I'm concerned that if the condition changes ami will still hold it true
even though it is now false using the hold()
."This true result is held true over the number of periods specified even if
a "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 for
the next condition .
I guess you can see the intent in the bow tie formula.
has the ma10,ma20 ,ma30 crossed in the last xn days
if yes
has the pull back occurred
if yes
has the higher high occurred
if all 3 conditions are true then signal a buy
Geoff's multi condition does it but was looking for a cleaned way to
express it .
Maybe i just have to nest a bunch of conditions and if there true nest
another.
DOES THIS MAKE sense to anyone or is my logic out of sync
/* Bow Tie conditions - Short term moving average has crossed the long term
moving average sometime in the last xn days - Add more conditions for more
days */
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 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 )
----- Original Message -----
From: "Steve Wiser" <slwiserr@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, May 13, 2001 8:31 PM
Subject: Re: [amibroker] ref
> David:
>
> Check out the function "Hold". I think this 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
> ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
|