• LIMITED TIME OFFER: use coupon code PRIMEDAY (case sensitive) at checkout to save $50 off VIP membership (down to $149 / year). Valid through Tuesday 6/22. Biggest discount this year!

Commitment of Traders (COT) Indicator for ThinkorSwim

Jerald643

New member
If anyone is familiar with the famous trader Larry Williams you will know he uses the COT (Commitment of Traders) data. It’s free public data. I was wondering if anyone has tried to write a script for that COT indicator?

Does anyone know of COT data is available on Ameritrade's platform? If not, with thinkscript, can I use external data or write a provider/connector for external data?
metacot-2-dcot-index-mt5-screen-7953__2.png
 
Solution
You can try this for ThinkorSwim:

Code:
input n = 38;

def o = open;
def h = high;
def l = low;
def c = close;

# TrueHigh = Highest of High or Close[1]
def TrueHigh = Max(high, close[1]);
# TrueLow = Lowest of Low or Close[1]
def TrueLow = Min(low, close[1]);
def OI = if isNaN(open_interest)
then OI[1]
else open_interest;
def poiv = sum (OI * (close-close[1] / (Truehigh - Truelow)) + onBalanceVolume());
plot values = (lowest(poiv, n)/highest(poiv,n));
AddLabel(yes, concat("POIV ", poiv), Color.white);
# End Code COT proxy

Check out TradingView for code that can possibly be translated to ThinkScript: https://www.tradingview.com/scripts/commitmentoftraders/

Of course, you can access all the COT info you like at...

gapcap1

New member
You can try this for ThinkorSwim:

Code:
input n = 38;

def o = open;
def h = high;
def l = low;
def c = close;

# TrueHigh = Highest of High or Close[1]
def TrueHigh = Max(high, close[1]);
# TrueLow = Lowest of Low or Close[1]
def TrueLow = Min(low, close[1]);
def OI = if isNaN(open_interest)
then OI[1]
else open_interest;
def poiv = sum (OI * (close-close[1] / (Truehigh - Truelow)) + onBalanceVolume());
plot values = (lowest(poiv, n)/highest(poiv,n));
AddLabel(yes, concat("POIV ", poiv), Color.white);
# End Code COT proxy

Check out TradingView for code that can possibly be translated to ThinkScript: https://www.tradingview.com/scripts/commitmentoftraders/

Of course, you can access all the COT info you like at Barchart: https://www.barchart.com/futures/commitment-of-traders, and finally look at COTbase, they have a COT indicator; however it's for Ninja Trader 8.
 
Solution

Similar threads

Top