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

Re: MetaStock Explorer Queries



PureBytes Links

Trading Reference Links

Just noticed that I dropped an = sign on the "//Current week high "
code.  (It's correct in the "//Previous "n" weeks high" code). Probably
wouldn't hurt to put it in.

So you should place an = sign after the < sign, so instead of  this:
HighestSince(1,DayOfWeek()>=1 AND
DayOfWeek()<Ref(DayOfWeek(),-1) ,H)

  .....it should read:
HighestSince(1,DayOfWeek()>=1 AND
DayOfWeek()<=Ref(DayOfWeek(),-1) ,H)


>  ============================
>     --//Previous "n" weeks high--
>
> n:=Input("Lookback period",1,500,4);
> If(DayOfWeek()>=1 AND DayOfWeek()<=
>    Ref(DayOfWeek(),-1),Ref(HighestSince(n,
>      DayOfWeek()<=Ref(DayOfWeek(),-1),H),-1),{PREV}
>       ValueWhen(1,DayOfWeek()>=1 AND
>     DayOfWeek()<=Ref(DayOfWeek(),-1),
>    Ref(HighestSince(n,DayOfWeek()<
>   Ref(DayOfWeek(),-1),H),-1)))
>
> ============================
>
>       --//Current week high--
>
> HighestSince(1,DayOfWeek()>=1 AND
> DayOfWeek()<Ref(DayOfWeek(),-1) ,H)
>
> =================================
>
>     --//Previous QTR high--
>
>       {first trading day of apr}
> apr1:=Month()=4 AND Ref(Month()=3,-1);
>       {first trading day of jly}
> jly1:=Month()=7 AND Ref(Month()=6,-1);
>       {first trading day of oct}
> oct1:=Month()=10 AND Ref(Month()=9,-1);
>     {first trading day of jan}
> jan1:=Month()=1 AND Ref(Month()=12,-1);
>
> If(jan1,HighestSince(1,oct1,H),
>    If(apr1,HighestSince(1,jan1,H),
>       If(jly1,HighestSince(1,apr1,H),
>       If(oct1,HighestSince(1,jly1,H),PREV))));
>
> ==================================
>
>     --//Current QTR high-to-date--
>
>        {first trading day of apr}
> apr1:=Month()=4 AND Ref(Month()=3,-1);
>        {first trading day of jly}
> jly1:=Month()=7 AND Ref(Month()=6,-1);
>     {first trading day of oct}
> oct1:=Month()=10 AND Ref(Month()=9,-1);
>     {first trading day of jan}
> jan1:=Month()=1 AND Ref(Month()=12,-1);
>
> If(BarsSince(jan1)<BarsSince(apr1),
>     HighestSince(1,jan1,H),
>      If(BarsSince(apr1)<BarsSince(jly1),
>       HighestSince(1,apr1,H),
>        If(BarsSince(jly1)<BarsSince(oct1),
>         HighestSince(1,jly1,H),
>          If(BarsSince(oct1)<BarsSince(jan1),
>           HighestSince(1,oct1,H),0))))
>
> ===========================
>
>     --//Previous year high--
>
> jan1:=Month()=1 AND Ref(Month()=12,-1);
> ValueWhen(1,jan1,HighestSince(1,Ref(jan1,-1),H))
>
> ===============================
>
>     --//Current year high-to-date--
>
>  jan1:=Month()=1 AND Ref(Month()=12,-1);
> HighestSince(1,jan1,H)
>
> ===============================
>
> Rajat Bose wrote:
>
>       [snip]
>
> > To get a list of 52-week highs or lows I have developed the following
> > formulas. They are approximations because MeatStcok does not allow
> > specific date based queries. 52-week highs or Highest High of last
> > 250-trading days.
> >
> > The MetaStock Filter to be used for this query:((H = HHV(H, 250))
> > for Lowest Lows: ((L = LLV(L, 250))
> >
> > The basic idea is not just to search for 52-week Highs or Lows but for
> > any number of weeks or months. Yearly highs or lows are published in
> > financial newspapers but not monthly or quarterly ones. For such
> > requirements, just change the number of days in either HHV or
> > LLVfunctions.
> >
> > Doing it this way has obviously its own limitations: for not-so-actively
> > traded stocks this does not give a true picture for the period in mind.
> >
> > However, in absence of the specific date based function, this was what I
> > could conceive of. If any of you have any better idea, please let me
> > know.
> >
> > Thanks for your time,
> >
> > Rajat K Bose
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com

--
mailto:divenfish@xxxxxxxxxxxxx