Lowphat

Commitments of Traders(COT) Major's noncom net (beta) By Lowphat

a charted commitments of traders report
of most majors on one chart.
EUR=red
GBP=blue
CHF=white
CAD=dark green
USD bright green
JPY=yellow
AUD=brown
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//@version=2
//Created by Lowphat on 8-14-2016 using Greeny's example as a base
//I wanted to see Major's in the same window

study("COT Majors (by Lowphat) noncom net beta", shorttitle="COT Majors by Lowphat (beta)", precision=0)

is_includeoptions = input(false, type=bool, title="Include Options")
smoothing = input(1, type=integer, title="Smoothing")
nc= security("QUANDL:CFTC/"+"BP"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"BP"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
cd= security("QUANDL:CFTC/"+"CD"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"CD"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
//ne= (security("QUANDL:CFTC/"+"NE"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"NE"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close ))*4
jy= security("QUANDL:CFTC/"+"JY"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"JY"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
ec= security("QUANDL:CFTC/"+"EC"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"EC"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
sf= security("QUANDL:CFTC/"+"SF"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"SF"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
ad= security("QUANDL:CFTC/"+"AD"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"AD"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )
dx= security("QUANDL:CFTC/"+"DX"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|5", "D", close )-security("QUANDL:CFTC/"+"DX"+ (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")+"|4", "D", close )

hline(0, color=white, linestyle=dashed)
hline(100000, color=green, linestyle=dashed)
hline(-100000, color=red, linestyle=dashed)

pmap=ema(nc, smoothing)
plot(pmap, color = blue, title="ave", style=line, linewidth=3)

pmap2=ema(cd, smoothing)
plot(pmap2, color = green, title="ave", style=line, linewidth=3)

//pmap3=ema(ne, 5)
//plot(pmap3, color = #FF1CAE, title="ave", style=line, linewidth=3)

pmap4=ema(jy, smoothing)
plot(pmap4, color = yellow, title="ave", style=line, linewidth=3)

pmap5=ema(ec, smoothing)
plot(pmap5, color = red, title="ave", style=line, linewidth=3)

pmap6=ema(sf, smoothing)
plot(pmap6, color = white, title="ave", style=line, linewidth=3)

pmap7=ema(ad, smoothing)
plot(pmap7, color = #a77f00, title="ave", style=line, linewidth=3)

pmap8=ema(dx, smoothing)
plot(pmap8, color = #00FF00, title="ave", style=line, linewidth=3)