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

[amibroker] Re: Code help - checking intervals within a range



PureBytes Links

Trading Reference Links

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@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx> 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@xxxxxxxxxxxxxxx, "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@xxxxxxxxxxxxxxx, "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
> > >
> >
>
__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___