PureBytes Links
Trading Reference Links
|
You're looking for the MetaStock Ref() function.
Try this:
stop:=Fml("Stop Loss Long");
L>stop AND Ref(L,-1)>Ref(stop,-1) AND Ref(L,-2)>Ref(stop,-2)
...AND Ref(L,-12)>Ref(stop,-12)
Better still:
stop:=Fml("Stop Loss Long");
Sum(L>stop,12)=12
jose '-)
http://www.metastocktools.com
--- In Metastockusers@xxxxxxxxxxxxxxx, "mandod2000" <mandod@xxxx>
wrote:
>
> Can anyone explain how to reference past bars in Metastock language?
> I want to run an Exploration showing all stocks whose low has been
> higher than a stop loss formula for the last 12 or more bars. Using
> Omega Easy Language logic (which I am familiar with) it would have
> been something like
>
> L>Fml( "Stop Loss Long") AND L(1)> Fml( "Stop Loss Long")(1)
> AND L(2)> Fml( "Stop Loss Long")(2) AND ...... L(12)> Fml( "Stop
> Loss Long")(12)
>
> The numbers in brackets are supposed to mean the low and the formula
> reading for the specified number of days ago.
>
> This isn't working in Metastock language for reasons that are
> probably obvious but which I don't seem to be able to figure out or
> find in the manual.
>
> I want to use this Exploration (suitably modified for number of bars
> referenced) with both weekly and daily charts.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/zMEolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Metastockusers/
<*> To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|