CooperHoang

Willams %R extreme and MACD Divergence

139
This is two different indicators combine into one.

First is the two different period of Williams% 5 mins and 15 mins.
Second is the MACD line of 5 mins chart.
Both will be primarily use on the 5 mins chart, you can use on another time frame if you wish

Williams %:

green = uptrending
red = downtrending

Bright green: overbought condition, look to Short at the end of the signal
Bright Red: oversold condition, look to Long at the end of the signal

MACD:
I also added the MACD line which you can use for divergence
when price move higher and MACD is moving down, expecting price to drop sometime soon or vice versa. See chart for example.

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
study(title="Willams %R", shorttitle="%R & MACD")
length = input(14, minval=1)
upper = highest(length)
lower = lowest(length)
out = 100 * (close - upper) / (upper - lower)

length1 = input(42, minval=1)
upper1 = highest(length1)
lower1 = lowest(length1)
out1 = 100 * (close - upper1) / (upper1 - lower1)
bgUp  = (out > -20 and out1 > -20) ? green : na
bgDown =(out < -80 and out1 < -80) ? red : na
bgUp1  = (out > -50 and out1 > -50) ? green : na
bgDown1 =(out < -50 and out1 < -50) ? red : na

bgcolor (bgUp, transp=00)
bgcolor (bgDown, transp=00)
bgcolor (bgUp1, transp=50)
bgcolor (bgDown1, transp=50)

fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)

MACD = ema(close, fastLength) - ema(close, slowlength)
aMACD = ema(MACD, MACDLength)
delta = MACD - aMACD

plot(MACD, color=blue, title="MACD")