Good idea Mike. Should work. I need something that includes every bar in the 8 not just picks the highest or lowest.
many Thanks --- In amibroker@yahoogroups.com, "Mike" <sfclimb...@...> wrote: > > What about something like this (untested): > > upper = Ref(High, -10); > lower = Ref(Low, -10); > > cond1 = Ref(Sum(IIf(High > upper, Low <= upper, High >= lower), 8), -2) > == 8; > > I'm assuming that you mean the 8 immediate bars following the one 10 > bars ago (i.e. excluding the current bar and immediately previous bar). > > Mike > > --- In amibroker@yahoogroups.com, "sidhartha70" <sidhartha70@> wrote: > > > > Sorry Dan, I should have made it clearer... > > > > I want to make sure that all the 8 following intervals have at least > > one tick within the price range of the interval 10 back. > > > > i.e. it's not that the whole range of the 8 intervals has to be within > > the range of the one 10 back... simply each of the 8 intervals has to > > share some price with the interval 10 back. > > > > If that makes sense...!!! > > > > --- In amibroker@yahoogroups.com, "monitorit" monitorit@ wrote: > > > > > > Hi > > > I think you want to use > > > inHirange= Ref(H,-9)>= HHV(H,9) ; > > > inLowrange= Ref(L,-9)<= LLV(L,9) ; > > > > > > above compares the most recent 9 bars to the one preceeding > > > > > > if you wanted to compare that one to the 8 following bars (and not > > > include the most recent bar, it would be > > > > > > inHirange= Ref(H,-9)>= ref(HHV(H,8),-1) ; > > > inLowrange= Ref(L,-9)<= ref(LLV(L,8),-1) ; > > > > > > Think one of those should work > > > Dan > > > > > > > > > > > > --- In amibroker@yahoogroups.com, "sidhartha70" <sidhartha70@> > > > wrote: > > > > > > > > Hi All, > > > > > > > > This is probably easy... but I'm having a mental block. > > > > > > > > I have an interval on a chart, lets say it's 10 intervals back. I > > > want > > > > to check that each of the 8 intervals that followed it traded > within > > > > the range of that interval 10 back. > > > > > > > > I don't want to use a loop.... > > > > > > > > Any ideas...? > > > > > > > > TIA > > > > > > > > > >