William Indicator 42 and 21 bond stock picking formula, combined with MACD

Williams %R is a technical analysis indicator developed by Larry Williams in 1973. It measures the position of the current stock price relative to the highest and lowest prices within a certain period of time and aims to measure whether the market is overbought. Or oversold status, which is an oscillator.

William indicator calculation formula:

WR = (Hn - C) / (Hn - Ln) × 100

Among them, Hn is the highest price within N days, Ln is the lowest price within N days, and C is the current closing price.

The original William indicator (hereinafter referred to as the WR indicator) is multiplied by -100, so the value range of the WR indicator in some software is -100 to 0. Don't be surprised to see negative numbers. The WR indicator in this article is consistent with domestic mainstream software, with a value ranging from 0 to 100. Above 80 is considered an oversold area, and below 20 is considered an overbought area. When WR enters the oversold area, it indicates that the market may be about to rebound; when WR enters the overbought area, it indicates that the market may be about to adjust.

1,prestige indicatorsecondary (42 days 和21日)

The default parameters of the William indicator (WR) that comes with Tongdaxin are 10 and 6. The parameters can be modified according to your own needs. This formula uses 42 and 21.

N:=42;

N1:=21;

WR1:100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N)),COLORWHITE;

WR2:100*(HHV(HIGH,N1)-CLOSE)/(HHV(HIGH,N1)-LLV(LOW,N1)),COLORYELLOW;

NOTEXT1:IF(WR1<>WR2,WR1,DRAWNULL),COLORWHITE;

NOTEXT2:IF(WR1<>WR2,WR2,DRAWNULL),COLORYELLOW;

NOTEXT3:IF(WR1=WR2 AND WR2>=80,WR2,DRAWNULL),COLORMAGENTA,LINETHICK2;{William indicator 42-day line and 21-day line are bonded and the 21-day line is greater than or equal to 80, magenta}

NOTEXT5:80,DOTLINE,COLORRED;

NOTEXT6:20,DOTLINE,COLORGREEN;

2.William indicator 42 and 21 bondingMain chart indicatorFormula

The 42-day line and the 21-day line of the William indicator are bonded, which is actually equal. A signal is sent when the two lines are bonded and the William indicator line on the 21st crosses below 80. In addition, MACD, recent decline and other conditions are added for filtering.

N:=42;

N1:=21;

WR1:=100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N));

WR2:=100*(HHV(HIGH,N1)-CLOSE)/(HHV(HIGH,N1)-LLV(LOW,N1));

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIF,9);

MACD:=(DIF-DEA)*2;

A1:=CROSS(80,WR2);{WR2 passes through 80}

A2:=WR1=WR2;{WR1, WR2 bonding}

A3:=EXIST(WR2>90,5);{WR2 is greater than 90 in the last 5 days}

A4:=EVERY(MACD>REF(MACD,1),2);{MACD of the last two days is greater than the previous one}

A5:=C>O;{Yang line}

A6:=COUNT(C/REF(C,1)<0.92,10)=0;{No decline greater than 8% in the last 10 days}

XG:=A1 AND A2 AND A3 AND A4 AND A5 AND A6;

STICKLINE(XG,H,L,0,1),COLORYELLOW;

STICKLINE(XG,C,O,3,0),COLOR117777;

STICKLINE(XG,C,O,2.5,0),COLOR119999;

STICKLINE(XG,C,O,2,0),COLOR11BBBB;

STICKLINE(XG,C,O,1.5,0),COLOR11DDDD;

STICKLINE(XG,C,O,1,0),COLOR44FFFF;

DRAWICON(XG,L,11);

DRAWICON(CROSS(WR2,20),H,37),DRAWABOVE;

3.William indicator 42 and 21 combined stock selection formula

N:=42;

N1:=21;

WR1:=100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N));

WR2:=100*(HHV(HIGH,N1)-CLOSE)/(HHV(HIGH,N1)-LLV(LOW,N1));

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIF,9);

MACD:=(DIF-DEA)*2;

A1:=CROSS(80,WR2);

A2:=WR1=WR2;

A3:=EXIST(WR2>90,5);

A4:=EVERY(MACD>REF(MACD,1),2);

A5:=C>O;

A6:=COUNT(C/REF(C,1)<0.92,10)=0;

XG:A1 AND A2 AND A3 AND A4 AND A5 AND A6;

Finally, for oscillators, the smaller the period, the more sensitive the indicator, resulting in more signals. For example, the default period parameters of the William indicator are 10 and 6, and there are many signals that cross 80. After amplifying the period parameters, this can be reduced. influence, but it cannot completely change the situation. In addition, the oscillator has the problem of passivation. When the market continues to fall, a reversal may not necessarily occur if it falls below 80. Therefore, pay attention to identifying the state of the market and make comprehensive judgments based on other methods such as support levels.

Pay attention to Technical Pie and learn more about Tongdaxin indicator formula writing. All rights reserved, please indicate the source.

Friendly reminder: This article is only for learning and communicating technical indicator formulas and does not constitute any investment advice. Investment is risky, so be cautious when entering the market.

Guess you like

Origin blog.csdn.net/m0_74754828/article/details/134014277