imresident2001
Use the ref(x,-1) for yesterday's price or ROC or whatever.
See if this helps.
//define values
r = ROC(C,1);// today's percent price change
yest_r=Ref(ROC(C,1),-1);// yesterday's percent price change
//set filter criteria
Today7pc = r > 7;
Yest7pc = yest_r > 7;
//Include both of these in the filter
Filter = Today7pc AND Yest7pc;
//group and color code the columns
AddColumn(Ref(C,-1),"yest_close",1.3);
AddColumn(Close,"today_close",1.3,colorBlack,colorYellow);
AddColumn(Ref(C,-1)-Ref(C,-2),"pr_ch_yest",1.3,colorBlack);
AddColumn(C-Ref(C,-1),"pr_ch_today",1.3,colorBlack,colorYellow);
AddColumn(yest_r,"Yest_ROC",colorBlack);
AddColumn(r,"today_ROC", 1.3, colorBlack,colorYellow);
AddColumn(Volume,"volume",1);
AddColumn(Ref(Volume,-1),"Yest_vol",1,colorBlack,colorYellow);
Does this help?
ChrisB
imresident2001 <imresident2001@xxxxxxxxx> wrote:
Thanks for the quick reply the code worked like a charm. can someone
modify this to find stocks that have gained 7% two days in a row.
and also how to add a column that shows precent gain for the day.
thanks again
--- In
amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>
> How is this for starters
>
> Gain7pc = c/ref(c,-1) >= 1.07;
>
> filter=gain7pc;
> addcolumn(c,"close",1.2);
>
> the rest is copying and getting the details right
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code
to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
>
> On 11/18/05, imresident2001 <imresident2001@xxxx> wrote:
> > Hi Im a total noob and was wondering if some one could be kind
enough
> > to help me with the following exploration from my eod database.
> >
> > all the stocks that have gained 7% and a separate one for all
that
> > have lost 7% on the previous trading day. and to include the
following
> > columns: symbol, closingprice, volume, price change, and percent
> > change.
> > Thanks really appreciate it
> >
> >
> >
> >
> >
> >
> > 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 other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>