PureBytes Links
Trading Reference Links
|
Dave
with respect to the MA being null for the first 50 bars what about
something like:
Pd = Cum(IsNull(MA(V,51)))-1;
dollar_volume = MA(C * V, pd);
This results in a 50 period MA when data is available but up to that
point the longest MA possible. The 51 period MA is necessary
because my observations show AB requires 1 extra period of data to
calculate a MA (ie. will only calculate a 3 period MA on the fourth
period of data. Look at the following Explore)
Pd = Cum(IsNull(MA(V,51)))-1;
DolVol = MA(C * V, pd);
Filter = pd <60;
AddColumn(pd,"pd");
AddColumn(dolVol,"dol vol");
AddColumn(MA(C*V,1),"ma 1 pd");
AddColumn(MA(C*V,2),"MA 2 pd");
AddColumn(MA(C*V,50),"MA 50 pd");
AddColumn(C*V,"V");
Hope this helps
Andrew
--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
wrote:
> hmmm, good idea fred, simpler.
>
> so, including dealing with the MA being null for the first 50 bars
after
> data starts, and spread out for readability, we get something like
this:
>
> ----------
> dollar_volume = MA(c * v, 50);
> dollar_volume_ok = IsNull(dollar_volume) or dollar_volume >=
> MinDollarVolume;
> price_ok = c >= MinPrice;
> ok_to_buy = Status("BarInRange") == 0 or (dollar_volume_ok and
price_ok);
> ----------
>
> make sense? (haven't tried it; AB's busy...)
>
> dave
>
> -----Original Message-----
> From: Fred [mailto:fctonetti@x...]
> Sent: Wednesday, November 12, 2003 1:56 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: finding a stock's lowest price within
AA date
> range
>
>
> "barinrange" - returns 1 when current bar is within current auto-
> analysis From-To range
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
> wrote:
> > say I'd like to find stocks whose price has stayed above $1
within
> the AA
> > date range. any ideas how to do that?
> >
> > I thought I'd first find the lowest price within that date
range,
> but I'm
> > not sure how. the method needs to handle stocks whose quotes
start
> after the
> > beginning of the range, or end before the end of it, finding
them
> if the
> > quotes that do exist meet the criteria.
> >
> > I think the following gets you the lowest price since the
start of
> the test
> > range, but keeps looking past the end of the test range to the
end
> of all
> > quotes:
> > LastValue(LowestSince(Status("FirstBarInTest"), c))
> >
> > it seems like there should be a clean and simple way to do
this,
> but I'm not
> > seeing it.
> >
> > thanks in advance for any ideas.
> >
> > dave
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|