PureBytes Links
Trading Reference Links
|
Well, second thought is always better...
The peculiar question of single stock appearence is solved in the
following manner:
Suppose you search the truth of a condition from May till now.
s1=DateNum()>1020501;//select bars after May 01
Cond=s1*(C>MA(C,10));//your condition
CondD=Cum(1)==LastValue(Cum(1));//the last bar condition
Cond=ExRem(Cond,CondD);//remove all excessive Cond
Filter=Cond;
AddColumn(Cond,"");
Now explore your database for All quotations.
You will have only the first Cond per stock, so you will read each
stock only once.
Anything else ??
Dimitris Tsokakis
PS I would like to know how will you use it...
--- In amibroker@xxxx, "dtsokakis" <TSOKAKIS@xxxx> wrote:
> John,
> I misunderstood your "previous 10 day range " as "the last 10 day
> range".
> I do not know how to scan for a past period and have a single stock
> appearence in the result list...
> Dimitris Tsokakis
> --- In amibroker@xxxx, John Nelson <trader@xxxx> wrote:
> >
> > ... and your solution to the last N bars is perfectly correct
> except that
> > there is an embedded assumption that you will always search from
> the
> > current Close back. See my other replies on this topic.
> >
> > Sorry if I've whipped up a firestorm here. I think it is a
> legitimate
> > question though.
> >
> > -- John
> >
> >
> > On Tue, 16 Jul 2002, dtsokakis wrote:
> >
> > > Date: Tue, 16 Jul 2002 11:12:29 -0000
> > > From: dtsokakis <TSOKAKIS@xxxx>
> > > Reply-To: amibroker@xxxx
> > > To: amibroker@xxxx
> > > Subject: [amibroker] Re: Scanning for stocks not conditions...
> > >
> > > Anthony,
> > > John question is not quite clear for me.
> > > John wrote:
> > > "I'm trying to Scan/Explore for stocks whose previous 10 day
> range is
> > > greater than some particular value. This is easy to do in
> Explore
> > > mode but the output consists of multiple occurences of the same
> > > stock.
> > > Really, I don't want a list of all the occurences of when the
> > > stock's range is greater than the value... I REALLY just want
the
> > > ticker symbol inserted into the list and then the scan should
> move on
> > > to the next symbol."
> > >
> > > If you explore for n=1 last quotation, you will find stocks
with
> > > CONDITION=TRUE
> > > only for the last bar. If for some stock condition was true 5
> bars
> > > ago, you will miss it.
> > > This is why I proposed
> > >
> > > COND=...;//your condition here
> > > x=10;//the days you will search
> > > Filter=Sum(COND,x)>=1;
> > > AddColumn(C,"");//add any informative columns
> > > Set n last quotations n=1 and explore.
> > >
> > > to explore the last x bars and meet the second requirement of
one
> > > ticker appearence in the result list.
> > > DT
|