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

Re: Calculating bars between two arguments



PureBytes Links

Trading Reference Links

Hi Markus,
There is something to be explained here:
z and y are conditions, their value is 0 or 1.
zz and yy are continuous functions with various values.
Perhaps you need the time interval from z to y [or from y to z]. It 
has some meaning, because z and y are events.
The time interval between zz and yy is meaningless.
Try the 
z=IIf(Low<Ref(LLV(Low,5), -1),1,0);
zz=ValueWhen(z==1,Low,1);
y=IIf (High>Ref(HHV(High,5), -1),1,0);
yy=ValueWhen(y==1,High,1);
Plot(z,"",1,2);Plot(y,"",4,2);
Plot(zz,"",5,1);Plot(yy,"",7,1);
to see what I mean.
Can you be more specific ?
DT
--- In amibroker@xxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> Folks,
> 
> would someone help me with this:
> 
> I need to calculate how many time periods have been passed since 
> 
> zz and yy 
> 
> whereby 
> 
> z=iif(low<Ref(llv(low,5), -1),1,0)
> zz=valuewhen(z==1,low,1)
> 
> and 
> 
> y=iif (high>Ref(hhv(high,5), -1),1,0)
> yy=valuewhen(y==1,high,1)
> 
> ???????????????
> 
> I thought of 
> 
> barssince (y==1) - barssince (zz==1) but that dosnīt return the 
desired result.
> 
> Thanks a lot!!
> 
> Markus