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

[amibroker] Re: Sequence of two conditions



PureBytes Links

Trading Reference Links

Please try to understand, exrem will remove excessive signals.
As you read

SYNTAX exrem( ARRAY1, ARRAY2 ) 
RETURNS ARRAY 
FUNCTION removes excessive signals:
returns 1 on the first occurence of "true" signal in Array1
then returns 0 until Array2 is true even if there are "true" signals 
in Array1 
Your first sequence
a  a  a  b  b  b
will be TRANSFORMED to a new
a        b
[the excessive a a and b b will be removed]
and then the only thing you have to do is to find when the first a or 
the first b happened. The research will be guaranteed, simply because 
the excessive signals do not exist any more.
Example:
Suppose you search for StochD value when a Buy [or a Sell] occurs.
The first attempt is
Buy=DayOfWeek()<=3;
Sell=DayOfWeek()>3;
Plot(Buy*StochD(),"",5,2);
Plot(Sell*StochD(),"",4,2);
The next should be
Buy=DayOfWeek()<=3;
Sell=DayOfWeek()>3;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Plot(Buy*StochD(),"",5,2);
Plot(Sell*StochD(),"",4,2);
Please plot both to see.
[Instead of Buy/Sell you may have ANY binary condition]
Note also that you donīt need Valuewhen at all for this question.
DT


--- In amibroker@xxxxxxxxxxxxxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> Dimitris,
> 
> actually itīs not. Exrem and Valuewhen judge the occurence from the 
back
> ofthe chart while I try to find the first occurrence of a condition 
right
> after another condition has taken place.
> 
> Example: I want to detect the first instance of b right after a has
> happened:
> a  a  a  b  b  b
> 
> Using Valuewhen I would have to use Valuewhen(..,..,3). But I donīt 
know in
> advance how many occurrences of b take place. So I thought the only 
way to
> address this b is to find the first right AFTER the occurrence of a.
> 
> Do you know what I mean???
> 
> Thanks
> 
> Markus
> ----- Original Message -----
> From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, March 24, 2003 9:05 PM
> Subject: [amibroker] Re: Sequence of two conditions
> 
> 
> For
> cond1=a;
> cond2=b;
> you may have a sequence
> a, a, b, b, b, a
> with
> cond11=exrem(cond1,cond2);
> cond22=exrem(cond2,cond1);
> you will have
> a,    b,     , a
> ie only the forst occurrence of each a or b.
> Is this what you are looking for ?
> DT
> --- In amibroker@xxxxxxxxxxxxxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> > Folks,
> >
> > maybe you have a solution for the following:
> >
> > Iīd like to detect the first occurence of cond2 after cond1 has
> happened.
> >
> > I seemingly canīt use Valuewhen function since it calculates from
> the last bar, not from cond1 (i.e. I nedd a calculation forward
> rather than backward).
> >
> > So, in case that there are several instances of cond2 after cond1,
> I might get a wrong result.
> >
> > Could anyone help me, please?
> >
> > Thanks a lot
> >
> > Markus
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/yMx78A/fNtFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/