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 #

Optimized Weighted Moving Average

The first step for calculating a weighted moving average (WMA) is to decide the lookback
period (n) and the alpha (a). For our example in sidebar Figure 1, we are using n = 8 and a = 0.6 to calculate the optimized weighted moving average (OWMA) described in "Weighted moving averages." The OWMA is calculated in column E and is smoothing the put/call ratio calculated in column D. Each cell in column D is simply the ratio of the put volume in column C divided by the call volume in column B ? that is, cell D2 = C2/B2.

Enter the alpha in cell F2; our example has 0.6 entered. The weight counter i is listed in column G. We are using n = 8, so enter in the values 1 through 8 in cell G2 to G9. When calculating the weights, the denominator never changes, therefore, the denominator can be calculated once. This is performed in cell H2. The formula for cell H2 is:

...

OWMA d

{OWMA denominator N=12 Alph=2}
Pwr(1,2) + Pwr(2,2) + Pwr(3,2) + Pwr(4 ,2) + Pwr(5 ,2) + Pwr(6 ,2) +
Pwr(7,2) + Pwr(8,2) + Pwr(9,2) + Pwr(10,2) + Pwr(11,2) + Pwr(12,2)

OWMA P

{OWMA Part 1 N=12 Alph=2}
((Pwr(12,2) / Fml("OWMA d")) * C) +
((Pwr(11,2) / Fml("OWMA d")) * Ref(C,-1)) +
((Pwr(10,2) / Fml("OWMA d")) * Ref(C,-2)) +
((Pwr(9 ,2) / Fml("OWMA d")) * Ref(C,-3)) +
((Pwr(8 ,2) / Fml("OWMA d")) * Ref(C,-4)) +
((Pwr(7, 2) / Fml("OWMA d")) * Ref(C,-5)) +
((Pwr(6, 2) / Fml("OWMA d")) * Ref(C,-6)) +
((Pwr(5, 2) / Fml("OWMA d")) * Ref(C,-7))

Poniższa formuła wymaga wcześniejszego wprowadzenia formuł znajdujących się powyżej pod niezmodyfikowaną nazwą.

OWMA Final N=12 Alph=2

Fml("OWMA P") +
((Pwr(4,2) / Fml("OWMA d")) * Ref(C,-8 )) +
((Pwr(3,2) / Fml("OWMA d")) * Ref(C,-9 )) +
((Pwr(2,2) / Fml("OWMA d")) * Ref(C,-10)) +
((Pwr(1,2) / Fml("OWMA d")) * Ref(C,-11))

Source / From: TOP
???

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.