GunArm

Willy Bands

Reverse engineered Willy21Ema13 to show (on chart) the levels price would have to reach to be overbought/oversold given recent price history.
By default it only shows the Williams%R with length 21.
If you change the settings it will do the same for the Ema13 of the Willy21, however because the ema is "harder" to breach, the lines are much farther away and looks really obnoxious on chart.
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
study(title="Willy Bands", overlay=true)
// Created by GunArm July 6 2014
// Not exactly Groundbreaking, but hey ;p
// Thanks MagnusTradingGroup, LazyBear, and lucky_Hard for suggestions

willyLength = input(21, title="Williams Length", minval=1) 
ob_level = input(-20, title="Overbought level", minval=-100, maxval=0)
os_level = input(-80, title="Oversold level",  minval=-100, maxval=0)
noEma = input(title="Williams%R only (no EMA)", type=bool, defval=true)
emaLength = input(13, title="Ema Length", minval=1) 

upper = highest(willyLength)
lower = lowest(willyLength)
alpha = 2/(emaLength + 1)

currentWillyEma = ema(100 * (close - upper) / (upper - lower), emaLength)

InverseWilly(result) => upper + (result * (upper - lower)/100)
InverseEma(currentEma, targetEma) => ((targetEma - currentEma)/alpha) + currentEma

ob_Willy = InverseWilly(ob_level)
ob_WillyEma = InverseWilly(InverseEma(currentWillyEma, ob_level))

os_Willy = InverseWilly(os_level)
os_WillyEma = InverseWilly(InverseEma(currentWillyEma, os_level))

plot(noEma ? ob_Willy : ob_WillyEma, color = red)
plot(noEma ? os_Willy : os_WillyEma, color = green)