log in     sign up for free
 
People avoid looking for good exits because exits do not give them control over the market. However, exits do control something. They control whether you make a profit or a loss, and they control just how big that profit or loss will be. Since they do so much, perhaps they are worthy of a lot more study on the part of most people.
Van K. Tharp
 
 
Home
systems (284)
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Referencing X Bars Back

Formula for: MetaStock

exploration


 

 

Views:  1283

Added: December 19, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, exploration
 
Your Ad Here
* To:
* Subject: Re: Referencing X bars back
* From: "Roy Larsen"
* Date: Thu, 3 Jan 2002 13:43:09 +1300
* References:
* 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}

 

 



Code:

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: http://www.purebytes.com/archives/metastock

 

View similar (exploration for MetaStock):

Accumulation or Disribution?
RSI and Price Exploration
Volume Based Exploration
ADX Rising Expoloration
Pivot-Point Strategy
Zero Lag EMA Exploration
02_ROC/TSF/ADXR/LinRegSlope Short
Referencing X Bars Back
Volatility Breakout Exploration
Parabolic SAR Exploration
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012