Commitment of Traders (COT) in tradingview

Some theory to add background

I continue studying about market breadth, and this time I’m creating a script for the analysis of the Commitment of Traders.

The Commitment of Traders (COT) reports show futures traders’ positions at the close of (usually) Tuesday’s trading session. The report is prepared by the Commodity Futures Trading Commission (CFTC). It is an excellent trading tool and can be used as an indicator for analyzing market sentiment.

Markets are only included if 20 or more traders hold positions equal to or above the reporting levels established by the CFTC and the respective exchanges.

Traders are grouped into categories:

  • Commercial Traders,
  • Non-Commercial Traders (large speculators)
  • Non-reportable (small speculators).

COTs on tradingview

Right now there is no direct data in tradingview related to COTs. But you can work with this data accesing through Quandl. Only Legacy format is available for tradingview.

MagicEins provides on this script a code and an explanation about how to use this data, It contains all symbols available, and he provides updates.

The main codes I’m interested are:

  • Russell 2000 E-Mini (RTY) == “239742”
  • S&P 500 (SP) == “138741”
  • Dow Jones Industrial Average Index (DJIA) == “12460P”

The colours used are:

  • Commercials ==  blue
  • Large Speculators ==  red
  • Speculators net   ==  green

I added 3 inputs to enable to draw just the COTs you want:

Code example

study("Market Breadth P2 CoTs-joapen", shorttitle="Market-Breadth-P2CoTs-joapen", precision=0)

shortnegative = input(title="Show Shorts as negative numbers?", type=bool, defval=false)
showCommercials = input(title = "show Commercials?", type=bool, defval=true)
showLargeSpeculators = input(title = "show Large Speculators?", type=bool, defval=false)
showSmallSpeculators = input(title = "show Small Speculators?", type=bool, defval=false)

snn = shortnegative ? -1 : 1

quandl_futures_code =
	  syminfo.root == "ZB" ? "020601" : 
	  syminfo.root == "ZN" ? "043602" : 
	  syminfo.root == "ZS" ? "005602" : 
	  syminfo.root == "ZM" ? "026603" : 
	  syminfo.root == "ZL" ? "007601" : 
	  syminfo.root == "ZC" ? "002602" : 
	  syminfo.root == "ZW" ? "001602" : 
	  syminfo.root == "KE" ? "001612" : 
	  syminfo.root == "HE" ? "054642" : 
	  syminfo.root == "LE" ? "057642" : 
	  syminfo.root == "GC" ? "088691" : 
	  syminfo.root == "SI" ? "084691" : 
	  syminfo.root == "HG" ? "085692" : 
	  syminfo.root == "CL" ? "067651" : 
	  syminfo.root == "HO" ? "022651" : 
	  syminfo.root == "RB" ? "111659" : 
	  syminfo.root == "NG" ? "023651" : 
	  syminfo.root == "6A" ? "232741" : 
	  syminfo.root == "6B" ? "096742" : 
	  syminfo.root == "6C" ? "090741" : 
	  syminfo.root == "6E" ? "099741" : 
	  syminfo.root == "6J" ? "097741" : 
	  syminfo.root == "6S" ? "092741" : 
	  syminfo.root == "SB" ? "080732" : 
	  syminfo.root == "KC" ? "083731" : 
	  syminfo.root == "CC" ? "073732" : 
	  syminfo.root == "CT" ? "033661" : 
	  syminfo.root == "ES" ? "13874A" : 
	  syminfo.root == "RTY" ? "239742" : 
	  syminfo.root == "YM" ? "12460P" : 
	  syminfo.root == "NQ" ? "209742" : 
	  syminfo.root == "PA" ? "075651" : 
	  syminfo.root == "PL" ? "076651" : 
	  syminfo.root == "AUP" ? "191693" : 
	  syminfo.root == "HRC" ? "192651" : 
	  syminfo.root == "EH" ? "025651" : 
	  syminfo.root == "BB" ? "06765T" : 
	  syminfo.root == "ZR" ? "039601" : 
	  syminfo.root == "ZO" ? "004603" : 
	  syminfo.root == "DC" ? "052641" : 
	  syminfo.root == "OJ" ? "040701" : 
	  syminfo.root == "LBS" ? "058643" : 
	  syminfo.root == "GF" ? "061641" : 
	  syminfo.root == "SP" ? "138741" : 
	  syminfo.root == "DJIA" ? "12460P" : 
	  syminfo.root == "6N" ? "112741" : 
	  syminfo.root == "6L" ? "102741" : 
	  syminfo.root == "VX" ? "1170E1" : 
	  syminfo.root == "6M" ? "095741" : 
	  syminfo.root == "6R" ? "089741" : 
	  syminfo.root == "6Z" ? "122741" : 
	  syminfo.root == "ZT" ? "042601" : 
	  syminfo.root == "ZF" ? "044601" : 
    ""
    
quandl_code = "QUANDL:CFTC/" + quandl_futures_code + "_F_L_ALL"

comm_long = security (quandl_code + "|4", "D", close)
comm_short = security (quandl_code + "|5", "D", close)
lspecs_long = security (quandl_code + "|1", "D", close)
lspecs_short = security (quandl_code + "|2", "D", close)
sspecs_long = security (quandl_code + "|8", "D", close)
sspecs_short = security (quandl_code + "|9", "D", close)

// showCommercials  --- blue
plot (showCommercials?comm_long:na, color = blue, title = "Commercials long", style=line,linewidth=1,transp=0)
plot (showCommercials?comm_short*snn:na, color = purple, title = "Commercials short", style=line,linewidth=1,transp=0)
plot (showCommercials?comm_long - comm_short:na, color = blue, title = "Commercials net", style=line,linewidth=2,transp=50)
// showLargeSpeculators  ---   red
plot (showLargeSpeculators?lspecs_long:na, color = red, title = "Large Speculators long", style=line,linewidth=1,transp=0)
plot (showLargeSpeculators?lspecs_short*snn:na, color = orange, title = "Large Speculators short", style=line,linewidth=1,transp=0)
plot (showLargeSpeculators?lspecs_long - lspecs_short:na, color = red, title = "Large Speculators net", style=line,linewidth=2,transp=50)
// showSmallSpeculators  ---- green
plot (showSmallSpeculators?sspecs_long:na, color = green, title = "Small Speculators long", style=line,linewidth=1,transp=0)
plot (showSmallSpeculators?sspecs_short*snn:na, color = olive, title = "Small Speculators short", style=line,linewidth=1,transp=0)
plot (showSmallSpeculators?sspecs_long - sspecs_short:na, color = green, title = "Small Speculators net", style=line,linewidth=2,transp=50)
// horizontal line
hline(0, color=black, title = "Zero", linestyle=dotted,linewidth=1)

Tradingster, Commitments of Traders (COT) reports

Tradingster.com provides free COT charts and COT reports. The Commitments of Traders (COT) reports provide a breakdown of each Tuesday’s open interest for markets in which 20 or more traders hold positions equal to or above the reporting levels established by the CFTC.

The original COT report is text based and doesn’t include any charts or analytics tools. Tradingster provides you charts for COT report, which is great.

SPX Vs DIX 2020 follow-up

I have started to follow-up the Dark Index Vs SPX, as one of the indicators I follow during the decisions. Right now it’s in test mode, as I have to learn about what happens and see if I can build some type of correlation that contributes in a positive way to my trading actions.

So, let’s start.

First chart (January 1st – April 30st)

When DIX is up, it’s assumed the whales are buying in a silent way. Some trends:

  • February 27th
  • March 24th

Second chart (January 1st – June 8th)

  • Strong concentration of buyers starting on May 21st and continuing during 1 week (over 50%).
  • SPX was in a channel (2800 -2950), between April 14 and May 26th.

GEX review on June 8th

  • Gamma Exposure Index < 0 was a risk zone. Started on February 24th.
  • During the channel (2800-3000) no clear behavior.

GEX review on July 8th

So much ups and downs (accelerate and brake).

DIX review on July 8th

Nothing to add here related to DIX during June.

DIX review on August 8th

  • Channel 3.000-3.200 has been broken, now working between 3.200-3.400.
  • Dark Index moving around 45%.

GEX review on August 8th

  • 2 strong “push” to the accelerator put the S&P over 3.300.

GEX review on August 18th

  • GEX reachs 131.000.000.000.000 units, which means the highest value of this indicator since it was created. It’s the major “brake” to the use of dark pools ever.

DIX review on October 13th

DIX values are similar to the values taken in March (below 37%).

GEX review on October 13th

in the last week, the highest values in GEX means that the major buyers are using the “break” and the purchases are slowing down. On October 13th the highest seen: 153.455.662.942.850.

SPX Vs VIX

I have been trying to find correlations in terms of what have been happening during last 4 months in the US market and I found something that I need to see in deep.

I added Volatility Index (^VIX) to a chart, but the figure was so bad. I did “1 minus VIX” and added to the chart, so you can see what happened:

I have to find if this type of correlation is repeated from time to time or if it is something that just happened this time.

Let’s see other years

I checked the same period but in 2015. This was the result:

I checked the same period but in 2016. This was the result:

Conclusion?

No relevant conclusion