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 #

ZigZag - Custom
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.

> 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.

[2895]
Source / From: TOP
http://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.