Greeny

William's Commercial Index

1359 7 151
William's Commercial Index
Remove from Favorite Scripts Add to Favorite Scripts
study("William's Commercial Index", shorttitle="WILLCO", precision=2)
force_root = input("", title="Override Product")
is_includeoptions = input(false, type=bool, title="Include Options")

fxroot =
	  ticker == "USDCAD" ? "CD" : 
	  ticker == "USDCHF" ? "SF" : 
	  ticker == "USDCZK" ? "CZ" : 
	  ticker == "USDHUF" ? "FR" : 
	  ticker == "USDILS" ? "IS" : 
	  ticker == "USDJPY" ? "JY" : 
	  ticker == "USDMXN" ? "MP" : 
	  ticker == "USDNOK" ? "UN" : 
	  ticker == "USDPLN" ? "PZ" : 
	  ticker == "USDRUB" ? "RU" : 
	  ticker == "USDSEK" ? "SE" : 
	  ticker == "USDZAR" ? "RA" : 
	  ticker == "EURUSD" ? "EC" : 
	  ticker == "AUDUSD" ? "AD" : 
	  ticker == "GBPUSD" ? "BP" : 
	  ticker == "NZDUSD" ? "NE" : 
	  ticker == "BRLUSD" ? "BR" : 
	  ""
root = force_root == "" ? fxroot == "" ? syminfo.root : fxroot : force_root
code = root + (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")

is_inversed = 
	  ticker == "USDCAD" ? true : 
	  ticker == "USDCHF" ? true : 
	  ticker == "USDCZK" ? true : 
	  ticker == "USDHUF" ? true : 
	  ticker == "USDILS" ? true : 
	  ticker == "USDJPY" ? true : 
	  ticker == "USDMXN" ? true : 
	  ticker == "USDNOK" ? true : 
	  ticker == "USDPLN" ? true : 
	  ticker == "USDRUB" ? true : 
	  ticker == "USDSEK" ? true : 
	  ticker == "USDZAR" ? true : 
	  false

long_total = security("QUANDL:CFTC/"+code+"|4", "D", close)
short_total = close
oi = security("QUANDL:CFTC/"+code+"|0", "D", close)

long = is_inversed ? short_total : long_total
short = is_inversed ? long_total : short_total
net = long-short
willco = net / oi

length = input(24, title="Period (weeks)")

max = highest(willco, length)
min = lowest(willco, length)
index = 100 * (willco - min) / (max - min)

index_adopted = security("QUANDL:CFTC/"+code+"|5", "D", index)

plot(index_adopted, color = black, title="Index", style=line)
hline(80, color=blue, linestyle=dashed)
hline(20, color=blue, linestyle=dashed)
Hi, Greeny, do you have any plan to update the list of current 17 pairs?
Reply
I forgot to ask... Is it possible to program a panel which has the COT markets and an overview of the values of the COT indicators?
Reply
Nice work Greeny!!!!

I dont find the right abbreviations for the following markets for the COT data:
-Euro
-Mexican Peso
-Corn
-Rough Rice
-Lean Hogs
Reply
Hello, Greeny! Can u help me with add you script on my chart?
snapshot

Thanks
Reply
I am not getting anything on the indicator , What could be wrong?
Applying to EURUSD Charts.
Reply
Greeny, great! how are the upper and lower bands calculated?
Reply
You are the man!!!
+2 Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out