PureBytes Links
Trading Reference Links
|
Another possibility, one that's less flexible than percentile, in that
the number of days it not a variable, but might be faster:
(C>ref(C,-1))+(C>ref(C,-2))+(C>ref(C,-3))+(C>ref(C,-4))+(C>ref(C,-5))
>= 4;
GP
--- In amibroker@xxxxxxxxxxxxxxx, "ozzyapeman" <zoopfree@xxx> wrote:
>
> Thanks guys.
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Paul Ho" <paul.tsho@> wrote:
> >
> > You are right
> > but this one probably will
> > c >= ref(percentile(c, 5, 80), -1);
> >
> >
> > _____
> >
> > From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
> On Behalf
> > Of Mike
> > Sent: Friday, 12 September 2008 12:02 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Close > At least 4 of the previous 5 Closes
> >
> >
> >
> > I haven't tested, but I don't think that that will work. Given a
> > history of:
> >
> > 7,7,8,7,10 and current value of 9
> >
> > Ref(HHV(C, 5), -1) will give 10, correct?
> >
> > The current value of 9 is not greater than 10 so we get false (or 0).
> > But, 9 *is* greater than each of 7,7,8,7 so we actually wanted a true
> > (or 1) here since the current value of 9 is greater than at least
4 of
> > the preceding 5 values.
> >
> > Mike
> >
> > --- In amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
ps.com,
> > "Paul Ho" <paul.tsho@> wrote:
> > >
> > > c > ref(hhv(c,5), -1)
> > >
> > >
> > > _____
> > >
> > > From: amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
ps.com
> > [mailto:amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
> ps.com]
> > On Behalf
> > > Of Mike
> > > Sent: Friday, 12 September 2008 11:26 AM
> > > To: amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com> ps.com
> > > Subject: [amibroker] Re: Close > At least 4 of the previous 5 Closes
> > >
> > >
> > >
> > > That would give the number of times within the period that a close
> > was
> > > higher than its *immediately* preceding close. But, it would not
> > give
> > > the number of times that the current close was higher than *all*
> > > preceding closes for that period as is being requested.
> > >
> > > There may be a more direct way, but the following would probably do
> > it
> > > for you:
> > >
> > > Count = 0;
> > >
> > > for (i = 1; i <= 5; i++) {
> > > Count += IIF(Close > Ref(Close, i * -1), 1, 0);
> > > }
> > >
> > > Condition = Count >= 4;
> > >
> > > --- In amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
> > ps.com,
> > > "Gordon Sutherland" <gosuth@>
> > > wrote:
> > > >
> > > > Try the following:
> > > >
> > > > HigherClose = C > Ref(C,-1);
> > > > HigherThanLast4 = Sum(HigherClose,5) > 4;
> > > > Plot(HigherThanLast4,"",colorBlue,2);
> > > >
> > > > Cheers,
> > > >
> > > > Gordon Sutherland
> > > >
> > > > -----Original Message-----
> > > > From: amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
> > ps.com
> > > [mailto:amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
> > ps.com]
> > > On Behalf
> > > > Of ozzyapeman
> > > > Sent: Friday, 12 September 2008 12:36 p.m.
> > > > To: amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com>
> > ps.com
> > > > Subject: [amibroker] Close > At least 4 of the previous 5 Closes
> > > >
> > > >
> > > > Quick question - is there a compact way to write the following:
> > > >
> > > > Close > At least 4 of the previous 5 Closes
> > > >
> > > > I know I can write out each case like:
> > > >
> > > > Case_1 =
> > > > C > ref(C,-1) and C > ref(C,-2)and C > ref(C,-3)and C > ref(C,-
> > 4)and
> > > C >
> > > > ref(C,-5)
> > > >
> > > > Case_2 =
> > > > C < ref(C,-1) and C > ref(C,-2)and C > ref(C,-3)and C > ref(C,-
> > 4)and
> > > C >
> > > > ref(C,-5)
> > > >
> > > > etc....
> > > >
> > > > and then write if Case _1 or Case _2 or Case_3 or ...
> > > >
> > > > But I'm guessing there must be a simpler way to do this?
> > > >
> > > > Any feedback appreciated.
> > > >
> > >
> >
>
------------------------------------
Please note that this group is for discussion between users only.
To get 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
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|