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.
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//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)

التعليقات

how do i add GBPJPY pair for the COT report ?
+5 رد
Lowphat IFXPROS
@IFXPROS, i made all majors on one chart @
you may be able to check GBP(in blue) in relation to JPY (in yellow) to get an idea of what side noncoms are on. im not sure if there is a (quandl) COT code for gbpjpy cross currency
رد
the inverse code needs to be added. not sure how i go about updating this indy to add/replace
nclong = is_inversed ? short_noncom : long_noncom
ncshort = is_inversed ? long_noncom : short_noncom
clong = is_inversed ? short_total : long_total
cshort = is_inversed ? long_total : short_total
splong = is_inversed ? short_total_S : long_total_S
spshort = is_inversed ? long_total_S : short_total_S


plot(nclong-ncshort, color = lime, title="Com", style=line, linewidth=2)
plot(clong-cshort, color = red, title="Large", style=line, linewidth=2)
plot(spshort-splong, color = blue, title="Spec", style=line,linewidth=2)
hline(0, color=gray, linestyle=dashed)
+4 رد
Zach_John Lowphat
@Lowphat,
Any mt4 version
+1 رد
Lowphat Zach_John
@Zach_John, no, mt4 lacks direct access to COT data so its a lot more work to code and you would probably have to keep the code updated constantly. a web search came up with darkmindfx which appears to be a fairly recent free implementation of cot data to mt4 but i don't know if its any good or what it actually displays or how long it would be functional.
رد
codes updated @
+1 رد
I've also tried adding it and it doesn't seem to be working. Any tips or help is appreciated
رد
One can right click the scale and select "invert scale".
رد
Hey guys - I'm a little confused with your comment about inversing the chart. Have you added the inverse code to it as it seems like it has been inversed? If so, is there any way to take this code off so it is not inverted?
رد
what are the rules for trading in forex using your cot script ?
رد