Greeny

COT (Legacy): Commercial Interest

Open Interest for commercial traders from legacy commitment of traders ( COT ) report. For the main symbol but also allows to override it. Also allows to include options in consideration.
Remover dos scripts favoritos Adicionar aos scripts favoritos
study("Commercial Interest", shorttitle="Com Int", 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_L_ALL" : "_F_L_ALL")

is_inversed = 
	  ticker == "USDCAD" ? true : 
	  ticker == "USDCAD" ? true : 
	  ticker == "USDCHF" ? true : 
	  ticker == "USDCZK" ? true : 
	  ticker == "USDHUF" ? true : 
	  ticker == "USDILS" ? true : 
	  ticker == "USDJPY" ? true : 
	  ticker == "USDMXN" ? true : 
	  ticker == "USDNOK" ? true : 
	  ticker == "USDPLN" ? true : 
	  ticker == "USDRUB" ? true : 
	  ticker == "USDSEK" ? true : 
	  ticker == "USDZAR" ? true : 
	  false

long_total = security("QUANDL:CFTC/"+code+"|4", "D", close)
short_total = security("QUANDL:CFTC/"+code+"|5", "D", close)

long = is_inversed ? short_total : long_total
short = is_inversed ? long_total : short_total

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)

Comentários

Hi Greeny! Same comment as on the Open interest, how do I create the Commercial interest for gold ? W hat is important here is to show the net commercial position as a line. Is it possbile?
+2 Resposta
Greeny LEONES
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.
+2 Resposta
LEONES Greeny
what do you mean apply the scipt to the chart? copy the script and paste it in the pine scipt editor?
Resposta
LEONES LEONES
Greeny, can I ask you to TEST something please:

CONTRACT CLU2014 (SEPTEMBER CRUDE_OIL FUTURE)

WHAT IS THE NET COMMERCIAL POSITION (long-short) YOU GET ON THE CHART?

Thank you
Resposta
LEONES LEONES
Greeny

seems ok on the 1st check:

CRUDE OIL

NET COMMERCIAL = -404265 contracts

The only thing is that this data refers to the 22nd of July. The new CFTC report of the 29th of July has already been issued. So we have two weeks old data. I'm chacking with Qundnl where are they normally uploading the data. We need to have the results as sson as possible, there could be big chnages in two weeks...


Crude
+2 Resposta
Greeny LEONES
I have the same number.
Agree, quandl needs to adjust their update policy for this datasets. I'll try to contact them also.
+1 Resposta
LEONES Greeny
great, the results are issued by CFTC on friday. In reality they refer to the data collected on the previous tuesday, but nothing we can do here this is how CFTC works. If we can have the data the same day (friday) or saturday it's ok. I have tried to use the code for the GRAINS (wheat, soybeans, corn etc) but it doesn't work. Is it the same for you? Try for example ZSU2104 (September Soybean)
+1 Resposta
LEONES Greeny
HI Greeny,

how can I get the chart from CME contracts such as grains (soybean, wheat, corn etc) or live stock (such as live cattle, hogs etc). If I use this code the vhart doen't appear. I have talked to the quandl (thay could have choosen and easier name..:) and they said all the data is there ready
+3 Resposta
LEONES LEONES
sorry for the typos .. I'm on the train..
Resposta
http://ppt.cc/v3Gb
maybe you want this
my english is very poor,sorry
+1 Resposta
Início Rastreador de Fundamentos Rastreador Forex Rastreador de criptomoedas Calendário econômico Como Funciona Recursos gráficos Preços Indique um amigo Regras da Casa Central de Ajuda Soluções para sites e corretoras Widgets Soluções em Gráficos Biblioteca de Gráficos Lightweight Blog & Notícias Twitter
Perfil Configurações de perfil Conta e cobrança Indique um amigo Meus Tíquetes de Suporte Central de Ajuda Ideias Publicadas Seguidores Seguindo Mensagens Privadas Conversa Deslogar