Commitment Of Traders Report
The Commitments of Traders (COT) is a market report by the Commodity Futures
Trading Commission (CFTC), listing the holdings of participants in futures of financial instruments, metals, and other commodities.
believed by some traders to give insight into the upcoming development of those
markets. The CFTC releases a new report every Friday at 3:30 p.m. Eastern Time,
and the report reflects the commitments of traders on the prior Tuesday.
The following functions return selected parts of the COT report, and work
likewise in backtest and live trading:
COT (int Handle, string Code, int Field): var
Downloads the COT report with the given Quandl Code and stores
it in the dataset with the given Handle. Returns the positions
determined by Field for the time of the current bar: 1 =
open interest, 2 = commercial long positions, 3
= commercial short positions, 4 = noncommercial long positions,
5 = noncommercial short positions.
Handle, string Code): int
As before, but returns the net commercials position, i.e. the difference
Commercial Longs - Commercial Shorts.
Handle, string Code, int TimePeriod): var
As before, but returns the net position
normalized over the given TimePeriod and scaled to 0..100.
COT_OpenInterest (int Handle, string Code): var
As before, but returns the open interest.
- A Quandl Key must be entered in Zorro.ini. Look up the Quandl codes for the COT reports
of the used assets under
- The report is only downloaded when needed. Subsequent
function calls access the dataset only. For preventing that the
dataset is overwritten by asset change, use a different handle
for any asset.
- Source code in contract.c, which must be
StartDate = 2015;
EndDate = 2018;
BarPeriod = 1440;
LookBack = 12*20;
int Handle = assetHistory("CHRIS/CME_GC1",FROM_QUANDL|VOLATILE); // load gold futures history
string COT_Code = "CFTC/088691_F_ALL";
var Ind = COT_CommercialIndex(1,COT_Code,6*20); // gold COT report
var Ind2 = COT_CommercialIndex(1,COT_Code,12*20);