Greeny

CFTC: COT (Legacy)

Commitment of Traders based on legacy format taken from quandl.com. In this version you need to select product when applying the indicator. In future version there might be some kind of auto mapping based on current symbol.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study("CFTC: COT (Legacy)", shorttitle="COT", precision=0)
root = input("EC", title="Product", confirm=true)
is_includeoptions = input(false, type=bool, title="Include Options")
code = root + (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")
oi = security("QUANDL:CFTC/"+code+"|0", "D", close)

//commercials
long_noncom = security("QUANDL:CFTC/"+code+"|1", "D", close) 
short_noncom = security("QUANDL:CFTC/"+code+"|2", "D", close) 
spread_noncom = security("QUANDL:CFTC/"+code+"|3", "D", close) 

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

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

long_totalnonrep = security("QUANDL:CFTC/"+code+"|8", "D", close) 
short_totalnonrep = security("QUANDL:CFTC/"+code+"|9", "D", close) 

plot(oi, color = gray, title="Open Interest")
plot(long_noncom, color = green, title="Long Positions")
plot(short_noncom, color = red, title="Short Positions")
plot(spread_noncom, color = olive, title="Spread Positions")
plot(long_noncom-short_noncom, color = yellow, title="Net Positions")
hline(0, color=yellow, linestyle=dashed)
// total = long_noncom+short_noncom
// diff = long_noncom-short_noncom
// pcnt = diff/total
// plot(pcnt, color = red)