MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Referencing X Bars Back
 

* To: <metastock@xxxxxxxxxxxxx>
* Subject: Re: Referencing X bars back
* From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
* Date: Thu, 3 Jan 2002 13:43:09 +1300
* References: <OE36O5iP07zViC68xSp0000c11e@xxxxxxxxxxx>
* Reply-To: metastock@xxxxxxxxxxxxx
* Sender: owner-metastock@xxxxxxxxxxxxx

Glynn

> BarsSince(Cross(Mov(CLOSE,50,S),Mov(CLOSE,200,S)))
> What I would now like to do is find out what the numerical difference between
> the 200 and 50 day moving ave for both days "before" the occurrence was.
> So theoretically if the alert showed that the crossover happened 12 days ago,
> Col B and Col C would show the Moving average difference for 13 and 14 days previously.

{Exploration}

 


Referencing X Bars Back

ColumnA: B/Since
BarsSince(Cross(Mov(CLOSE,50,S),Mov(CLOSE,200,S)));

ColumnB: -2 Bars
Bars:=LastValue(BarsSince(Cross(Mov(CLOSE,50,S),Mov(CLOSE,200,S))));
Abs(LastValue(Ref(Mov(C,50,S),-Bars-2)- Ref(Mov(C,200,S),-Bars-2)));

ColumnC: -1 Bar
Bars:=LastValue(BarsSince(Cross(Mov(CLOSE,50,S),Mov(CLOSE,200,S))));
Abs(LastValue(Ref(Mov(C,50,S),-Bars-1)- Ref(Mov(C,200,S),-Bars-1)));

{Recommend you use minimum 500 bars, preferably more}

 

 
 
 
Source / From: TOP
http://www.purebytes.com/archives/metastock

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!