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.
Remove from Favorite Scripts Add to Favorite Scripts
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")
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
Reply
Hi Greeny! Please tell me how to run your indicator for EURUSD - BOptions?
+1 Reply
HI Greeny! can you explain how to add the OI to the gold chart for example?
+8 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.
+8 Reply
LEONES Greeny
@Greeny, Hi Greeny, do you know why this is not working anymore? OI doesn't show up anymore
+3 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Help Center Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out