TomPip

Williams %R III Pivots

739 0 92
This script uses three lengths of Williams %R , calculates a bunch of averages and distances, highs and lows to determine pivots points. Lengths are currently optimised for 30m GER30             .
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Williams %R III Pivots", shorttitle="%RIIIP")
// Williams %R slow
length1 = input(48, minval=1)
upper1 = highest(length1)
lower1 = lowest(length1)
out1 = 100 * (close - upper1) / (upper1 - lower1) + 100
// Williams %R medium
length2 = input(240, minval=1)
upper2 = highest(length2)
lower2 = lowest(length2)
out2 = 100 * (close - upper2) / (upper2 - lower2) + 100
// Williams %R slow
length3 = input(960, minval=1)
upper3 = highest(length3)
lower3 = lowest(length3)
out3 = 100 * (close - upper3) / (upper3 - lower3) + 100

avg_out = (out1+out2+out3)/3
avg_dist=(abs(out1-out2)+abs(out1-out3)+abs(out2-out3))/3
sma_dist=sma(avg_dist,14)
sma_out=sma(avg_out,14)
act=abs(sma_out-sma_dist) 
pivot_length=30
upBound = highest(act, pivot_length)
downBound = lowest(act, pivot_length)


plot(sma_dist, color=#00FF00, linewidth=2)
plot(sma_out, color=#FF0000, linewidth=2)
plot(act, color=black, linewidth=2)
plot((upBound == act[1] and upBound != act and abs(act-sma_out)<20 and act > 60) ? act : na, style = cross, linewidth = 2, color=#FF0000)
plot((downBound == act[1] and downBound != act and act < sma_dist and act < 15) ? act : na, style = cross, linewidth = 2, color=#00FF00)
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out