Lowphat

COT Net Position's (Com,Non-Com and Spec) by Lowphat

Commitments of Traders with Com's Non-Com's and Spec's in one indicator.
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
//Created by Lowphat on 5-22-2016 using Greeny's example as a base
//I wanted to see Net positions of coms, non-coms and specs on one chart.

study("COT Net Position's (by Lowphat)", shorttitle="COT Net Positions(Com,Non-Com,Spec) by Lowphat", 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")


	  
long_noncom   = security("QUANDL:CFTC/"+code+"|1", "D", close) 
short_noncom  = security("QUANDL:CFTC/"+code+"|2", "D", close) 
long_total    = security("QUANDL:CFTC/"+code+"|4", "D", close)
short_total   = security("QUANDL:CFTC/"+code+"|5", "D", close)
long_total_S  = security("QUANDL:CFTC/"+code+"|9", "D", close) 
short_total_S = security("QUANDL:CFTC/"+code+"|8", "D", close) 

//net_MA=ema(net, 10)//for future use
//plot(net_MA, color = purple, title="ave", style=line)//for future use

plot(long_noncom-short_noncom, color = lime, title="Com", style=line, linewidth=2)
plot(long_total-short_total, color = red, title="Large", style=line, linewidth=2)
plot(short_total_S-long_total_S, color = blue, title="Spec", style=line,linewidth=2)
hline(0, color=gray, linestyle=dashed)