CoT Commitment of Traders Data

Questions about MultiCharts and user contributed studies.
Parker
Posts: 22
Joined: 18 May 2018

CoT Commitment of Traders Data

Postby Parker » 11 Jun 2018

Is it possible to get the TS Commitment of Traders data into MultiCharts?

In TS there appears to be an indicator that displays the Net Position or Total Position for futures markets. This must be based on some raw data feed so I wondered if it's possible to import this into Quote Manager like the other TS markets. In the TS documentation there is reference to "Fundamental Data". Not sure if this comes from somewhere different to the normal market data.

User avatar
JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Contact:

Re: CoT Commitment of Traders Data

Postby JoshM » 11 Jun 2018

Is it possible to get the TS Commitment of Traders data into MultiCharts?

In TS there appears to be an indicator that displays the Net Position or Total Position for futures markets. This must be based on some raw data feed so I wondered if it's possible to import this into Quote Manager like the other TS markets. In the TS documentation there is reference to "Fundamental Data". Not sure if this comes from somewhere different to the normal market data.
This should be possible, just like you mention: by importing this data in the QuoteManager. You can download COT data here from Quandl, but I suppose there are also other online sources that offer this data for free. From the quick look I had at Crude Oil data there, it does seem that there are several datasets not updated anymore.

I think that you might have a bigger challenge in finding a good, reliable, and up-to-date data source than the actual process of getting the data in MultiCharts.

Parker
Posts: 22
Joined: 18 May 2018

Re: CoT Commitment of Traders Data

Postby Parker » 11 Jun 2018

Hi Josh,

TS offer the COT data in real time, well I guess it's updated weekly but there is a COT indicator in the platform that you can load to a chart and it gives you the graphs for comm/non-comm etc. I use TS as a data feed so I wondered if there is a way to get the data to feed into Multicharts as a real time feed so I can use it in an automated strategy.

I've looked at the EL code for the COT indicator and it uses a function called "FundValue" which in the help file says this pulls in "Fundamental Data". So not sure if this is handled differently to normal market data. I've tried to search in Quote Manager for the market symbols referenced in the code but it doesn't find them.

Here is the EL indicator code for reference:

Code: Select all

using elsystem;

input:
int FuturesOnly_Or_FuturesAndOptions_1_or_2( 1 )
[DisplayName = "FuturesOnly_Or_FuturesAndOptions_1_or_2", ToolTip =
"Enter 1 to use the 'futures only' report; enter 2 to use the 'futures and options' report."];

variables:
bool Initialized( false ),
string FieldNamePrefix( "" ),
string CommLongFieldNme( "" ),
string CommShortFieldNme( "" ),
string NonCommLongFieldNme( "" ),
string NonCommShortFieldNme( "" ),
string SpecLongFieldNme( "" ),
string SpecShortFieldNme( "" ),
double CommLong( 0 ),
double oCommLongErr( 0 ),
double CommShort( 0 ),
double oCommShortErr( 0 ),
double NonCommLong( 0 ),
double oNonCommLongErr( 0 ),
double NonCommShort( 0 ),
double oNonCommShortErr( 0 ),
double SpecLong( 0 ),
double oSpecLongErr( 0 ),
double SpecShort( 0 ),
double oSpecShortErr( 0 ),
double CommNet( 0 ),
double NonCommNet( 0 ),
double SpecNet( 0 );

if Initialized = false then
begin
if Category > 0 then
throw Exception.Create( !( "Commitments of Traders studies can be applied only to futures symbols." ) );

Initialized = true;

if FuturesOnly_Or_FuturesAndOptions_1_or_2 = 1 then
FieldNamePrefix = "COTF-"
else
FieldNamePrefix = "COTC-";

CommLongFieldNme = FieldNamePrefix + "12";
CommShortFieldNme = FieldNamePrefix + "13";
NonCommLongFieldNme = FieldNamePrefix + "9";
NonCommShortFieldNme = FieldNamePrefix + "10";
SpecLongFieldNme = FieldNamePrefix + "16";
SpecShortFieldNme = FieldNamePrefix + "17";
end;

CommLong = FundValue( CommLongFieldNme, 0, oCommLongErr );
CommShort = FundValue( CommShortFieldNme, 0, oCommShortErr);
NonCommLong = FundValue( NonCommLongFieldNme, 0, oNonCommLongErr );
NonCommShort = FundValue( NonCommShortFieldNme, 0, oNonCommShortErr );
SpecLong = FundValue( SpecLongFieldNme, 0, oSpecLongErr );
SpecShort = FundValue( SpecShortFieldNme, 0, oSpecShortErr );

if oCommLongErr = fdrOk and oCommShortErr = fdrOk then
begin
CommNet = CommLong - CommShort;
Plot1( CommNet, !( "Comm" ) );
end;

if oNonCommLongErr = fdrOk and oNonCommShortErr = fdrOk then
begin
NonCommNet = NonCommLong - NonCommShort;
Plot2( NonCommNet, !( "NonComm" ) );
end;

if oSpecLongErr = fdrOk and oSpecShortErr = fdrOk then
begin
SpecNet = SpecLong - SpecShort;
Plot3( SpecNet, !( "Spec" ) );
end;

Plot4( 0, !( "ZeroLine" ) );
I've tried searching for "COTF" and "COTC" but doesn't find it.

I could import manually from csv as a backup plan. But it would be great if could have it update from the TS feed in real time.

User avatar
ABC
Posts: 626
Joined: 16 Dec 2006
Contact:

Re: CoT Commitment of Traders Data

Postby ABC » 12 Jun 2018

Hi Parker,

I am afraid directly accessing the fundamental data TS provides is not possible via code in Multicharts.
Besides importing the data into MC manually it might also be possible to exchange the data between TS and MC with custom code (for example via text files, Custom DLLs or Excel).

Regards,

ABC

Parker
Posts: 22
Joined: 18 May 2018

Re: CoT Commitment of Traders Data

Postby Parker » 12 Jun 2018

Hi ABC,

Good idea!.. I think the text file could work. I could print the data from TS to a file, and then map the file to a symbol in Quote Manager. I wonder if the data would auto update in MC when the file changes if I used the ASCII mapping option.

Thanks!


Return to “MultiCharts”