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.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
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)