log in     sign up for free
 
My attitude is: Never risk your family's security.
Marty Schwartz
 
 
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

ZigZag - Custom

Formula for: MetaStock

indicator


 

 

Views:  1500

Added: May 26, 2008
 
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, indicator
 
Your Ad Here
Carlin Guidry wrote:

> I am forwarding this message with attachment in hopes that someone in the group is savvy enough to build an indicator from this information.

> The purpose of the indicator is to find the lowest low between two highest highs. Take the number of days between the two highest high multiply this by 1.28, then add the result to the lowest low.

> More information in the attachment.
> Any help will be greatly appreciated.

> Carlin

The following MS 6.5 formula may give you what you are looking for:


ZigZag - Custom

HighReversal:= Input("Reversal Amount-Highs", .01, 99, 1);
LowReversal:= Input("Reversal Amount-Lows", .01, 99, 1);
PeakDistance:= Round((PeakBars(2,H,HighReversal) - PeakBars(1,H, HighReversal)) * 1.28);
TroughDistance:= Round((TroughBars(2,L,LowReversal)-TroughBars(1,L,LowReversal)) * 1.28);

If(PeakBars(1,H,HighReversal) < TroughBars(1,L,LowReversal),
{Then} If(TroughBars(1,L,LowReversal) = PeakDistance,1,0),
{Else} If(PeakBars(1,H,HighReversal) = TroughDistance,-1,0))






It plots a +1 on a "future turn bar" after a low between 2 highs, a –1 after a high between 2 lows, and a zero otherwise.

The 2 inputs are the same as the reversal amount in the MS-ZigZag function with the Percent option selected. The values you input here can be critical to the results obtained. Depending on the chart, a change of a few tenths can change the results. I find that trying to plot a ZigZag that properly catches the significant highs and lows can be a very subjective experience. You might try plotting a ZigZag of the highs and a ZigZag of the lows on the chart. Be sure the Percent option is selected. Try playing around with the Reversal Amount values until the peaks and valleys look right to you. Then plot the above indicator using these numbers.

Another tactic I've used to take some of the guesswork out of the ZigZag inputs is to plot an indicator that expresses volatility as a percent. Then use the most recent value of that indicator in the ZigZag function. The following function seems pretty close most of the time:

------------------------------------------
Mov(((ATR(14) / C)* 100), 20, S)
------------------------------------------

BTW, what is the significance of the 1.28 multiplier?

David.

 

 



Code:

ZigZag - Custom

HighReversal:= Input("Reversal Amount-Highs", .01, 99, 1);
LowReversal:= Input("Reversal Amount-Lows", .01, 99, 1);
PeakDistance:= Round((PeakBars(2,H,HighReversal) - PeakBars(1,H, HighReversal)) * 1.28);
TroughDistance:= Round((TroughBars(2,L,LowReversal)-TroughBars(1,L,LowReversal)) * 1.28);

If(PeakBars(1,H,HighReversal) < TroughBars(1,L,LowReversal),
{Then} If(TroughBars(1,L,LowReversal) = PeakDistance,1,0),
{Else} If(PeakBars(1,H,HighReversal) = TroughDistance,-1,0))

 





Source: http://purebytes.com/archives/metastock/

 

View similar (indicator for MetaStock):

eVWMA
Damping Index
Stochastic Oscillator - Custom
IFT - Intelligent Futures Trading
Trading Channel Index
Volume % Change
Bias Exact
Volatility - Total
VolWR
Relative Performance Charting
...
 
 
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