Greeny

COT (Legacy): Largest 8 Net

501 2 39
Percents of Open Interest held by the largest eight reportable traders from legacy commitment of traders (COT) report. Computed on a net long and net short basis. For the main symbol but also allows to override it. Also allows to include options in consideration.
Remove from Favorite Scripts Add to Favorite Scripts
study("Largest 8 Net", shorttitle="Lrg8N", precision=1)
force_root = input("", title="Override Product")
is_includeoptions = input(false, type=bool, title="Include Options")

fxroot =
	  ticker == "USDCAD" ? "CD" : 
	  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" : "_F") + "_L_ALL_CR"

long = security("QUANDL:CFTC/"+code+"|6", "D", close)
short = security("QUANDL:CFTC/"+code+"|7", "D", close) 

plot(long, color = green, title="Long")
plot(short, color = red, title="Short")
plot(long-short, color=yellow, title="Net", style=histogram)
hline(0, color=yellow, linestyle=dashed)
motcha1
2 years ago
Very good work. You never thought of coding a COT index? (weekly net value commercials-lowest net value in 6 months)/(highest net value in 6 months-lowest value in 6 months)*100.
Reply
Greeny PRO motcha1
2 years ago
Done ;)
Commercial Index
COT (Legacy): Commercial Index

Noncommercial Index
COT (Legacy): Noncommercial Index
+1 Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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 Billing Sign Out