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

Re: Remebering a value



PureBytes Links

Trading Reference Links

hi iva,
i am not to sure what you ask, but will this help.

 
x=2;//number of bars from L1 True

L1=BarsSince( Low < Ref(LLV(Low,5),-1)==0)==1;
L3= BarsSince(High > Ref(HHV(High,5),-1)==0)==1; 
L4=IIf(BarsSince(L1==1)==x AND L3,1,0);

Plot(L1,"",6,1);//blue 
Plot(L3,"",5,1);//green
Plot(L4,"",4,4);//red
 
from what you wrote my interpretation is this.
when L3 is true( the first day of the true condition), you only want 
the condition to be true if L1 was true ( the first day of the true 
condition), e.g. 2 days ago. 
the red plot line shows this and you can change the number of days 
in the x variable. 
   
cheers: john.



--- In amibroker@xxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> Thanks!
> 
> Please allow two questions:
> 
> 1./ Does barssince look back into the past or forward into the 
future from
> the point where the condition L1 is/was true?
> 
> 2./ Condition L3 might be true for severeal instances. Do you have 
a clue on
> how to detect the FIRST time it is true? I havenīt yet found an AFL 
command
> that checks the truth for the occurence of my desire (frist, second 
etc.).
> 
> Thanks again!!
> 
> Markus
> ----- Original Message -----
> From: "nenapacwanfr" <nenapacwanfr@xxxx>
> To: <amibroker@xxxx>
> Sent: Monday, July 22, 2002 4:23 AM
> Subject: [amibroker] Re: Remebering a value
> 
> 
> Perhaps it can help you
> 
> L1= Low < Ref(LLV(Low,5),-1);
> L2= BarsSince(L1);
> L3= High > Ref(HHV(High,5),-1) AND L2>0;
> Plot(L2,"",7,1);
> Plot(L3,"",8,1);
> 
> 
> > I try to come up with a code that tells AB to look for high>Ref
(hhv
> (high,-5,-1) to be true when low<Ref(llv(low,5),-1) is true, i.e. a
> specific bar from which the hhv and/or llv functions should start.
> >
> > Has ansone an idea how to do this???????????
> >
> > Any comment/suggestion is welcome. Iīm going crazy on this.
> >
> > Markus
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/