Greeny

COT (Legacy): Open Interest

Open Interest from legacy commitment of traders ( COT ) report. For the main symbol but also allows to override it. Also allows to include options in consideration.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
study("Open Interest", shorttitle="OI", precision=0)
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"

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

plot(oi, color = gray, title="OI")

Comments

HI Greeny! can you explain how to add the OI to the gold chart for example?
+13 Reply
Greeny LEONES
Thanks for asking! Here you are:
1. Apply this script to the chart
2. Switch the GC1!
3. Go to the indicator settings and change Net style from histogram to line.
+15 Reply
LEONES Greeny
@Greeny, Hi Greeny, do you know why this is not working anymore? OI doesn't show up anymore
+8 Reply
Hi Greeny! Please tell me how to run your indicator for EURUSD - BOptions?
+11 Reply
Hi Greeny,

Love your work. I'm just enquiring about how the OI figures are calculated as per this example:

Copper futures HG1!

OI as per CME group 24th June is recorded as 255,073 while the indicator will show 280 640.

Regards

Evahn
+9 Reply
Hello, can you explain how to add this indicator to the grains, such as wheat, corn, soybeans. Thank you
+2 Reply
Hi Greeny,

it does not work for all commodities, e.g. Grains (ZS, ZL, ZC etc) and Meats (HE, LE, GF).

Any reason behind it?

Thank you.

Best regards
Thorsten
Reply
Hi Greeny,
is it actually posible to get the open interest of stocks?
Regards, Gino
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter