lcenovsky

COT Data by cendalc

COT
773 1 150
cot
Legacy and disaggregated COT data for several commodities I trade:
ZC             , ZW, ZS, ZL, ZM, HG, GC             , SI, CC             , KC, CT             , OJ, SB             , CL             , HO, NG            

Available indexes:
  • Open Interest
  • Commercials Net
  • Large Traders Net
  • Producers Net
  • Managed Money Net
  • Commercials Long
  • Large Traders Long
  • Producers Long
  • Managed Money Long
  • Commercials Short
  • Large Traders Short
  • Producers Short
  • Managed Money Short

Data is taken from Quandl: https://www.quandl.com/data/CFTC

Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("COT Data by cendalc", shorttitle="COT Data", precision=0)

qticker =
     syminfo.root == "ZC" ? "C"  :
     syminfo.root == "ZW" ? "W"  :
     syminfo.root == "ZS" ? "S"  :
     syminfo.root == "ZL" ? "BO" :
     syminfo.root == "ZM" ? "SM" :
     syminfo.root == "HG" ? "HG" :
     syminfo.root == "GC" ? "GC" :
     syminfo.root == "SI" ? "SI" :
     syminfo.root == "CC" ? "CC" :
     syminfo.root == "KC" ? "KC" :
     syminfo.root == "CT" ? "CT" :
     syminfo.root == "OJ" ? "OJ" :
     syminfo.root == "SB" ? "SB" :
     syminfo.root == "CL" ? "CL" :
     syminfo.root == "HO" ? "HO" :
     syminfo.root == "NG" ? "NG" :
     ""

legacy_cot = "QUANDL:CFTC/" + qticker + "_FO_L_ALL|"

oi = security(legacy_cot + "0", "W", close)

comm_lg = security(legacy_cot + "4", "W", close)
comm_sh = security(legacy_cot + "5", "W", close)
comm_net = comm_lg - comm_sh

large_lg = security(legacy_cot + "1", "W", close)
large_sh = security(legacy_cot + "2", "W", close)
large_net = large_lg - large_sh

other_lg = security(legacy_cot + "8", "W", close)
other_sh = security(legacy_cot + "9", "W", close)
other_net = other_lg - other_sh

cot = "QUANDL:CFTC/" + qticker + "_FO_ALL|"

prod_lg = security(cot + "1", "W", close)
prod_sh = security(cot + "2", "W", close)
prod_net = prod_lg - prod_sh

manag_lg = security(cot + "6", "W", close)
manag_sh = security(cot + "7", "W", close)
manag_net = manag_lg - manag_sh

plot(oi, color=black, title="Open Interest", style=line, linewidth=1)

plot(comm_net, color=blue, title="Commercials Net", style=line, linewidth=1)
plot(large_net, color=green, title="Large Traders Net", style=line, linewidth=2)
plot(prod_net, color=aqua, title="Producers Net", style=line, linewidth=1)
plot(manag_net, color=lime, title="Managed Money Net", style=line, linewidth=2)

plot(comm_lg, color=navy, title="Commercials Long", style=line, linewidth=1)
plot(large_lg, color=red, title="Large Traders Long", style=line, linewidth=1)
plot(prod_lg, color=gray, title="Producers Long", style=line, linewidth=1)
plot(manag_lg, color=purple, title="Managed Money Long", style=line, linewidth=1)

plot(comm_sh, color=teal, title="Commercials Short", style=line, linewidth=1)
plot(large_sh, color=orange, title="Large Traders Short", style=line, linewidth=1)
plot(prod_sh, color=silver, title="Producers Short", style=line, linewidth=1)
plot(manag_sh, color=fuchsia, title="Managed Money Short", style=line, linewidth=1)
Quandl have changed the names for the symbols they provide. For example, now they use QUANDL:CFTC/080732_FO_ALL instead of QUANDL:CFTC/SB_FO_ALL: https://www.quandl.com/data/CFTC/080732_FO_ALL-Commitment-of-Traders-SUGAR-NO-11-ICUS-Futures-and-Options-080732


Kindly help to update the indicator as Quandl has changed their code.
Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
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 Contact Support Ideas Published Followers Following Private Messages Chat Sign Out