About COT Data in TradeStation
Commitments of Traders (COT) data provides a detailed breakdown of the number of Futures contracts held long, short, or spread by commercial, non-commercial entities, and speculative traders that can be used for fundamental analysis of the Futures markets.
In TradeStation, fundamental COT data may be referenced by studies and used within strategies. There are a number of built-in indicators along with EasyLanguage reserved words and functions that provide tools for accessing COT data. COT data is accessed using the same functions and reserved words that access historical fundamental data.
Overview
Commitments of Traders (COT) is a historical record of Futures positions open interest for US Futures markets broken down by type of trader; Commercials, which are producers and consumers of commodities; Non-Commercials are large speculators like hedge funds; and Speculators (non-reportable), which are smaller traders. Starting in 1962, the Commodity Futures Trading Commission (CFTC) started requiring all significant traders meeting certain criteria to report the futures positions they were holding. The CFTC reports this data on their website each week.
Due to its infrequency and delay in reporting to the public (only once a week and at least three days into the next week) it is not a real-time data stream, but it can be used to show which groups of traders have a position bias in a market direction, which groups may be driving the market trend, and which groups are increasing or decreasing position size.
Built-in COT Studies
TradeStation includes several studies that make use of COT data and are listed in the COT Data Study Library topic.
-
To add built-in COT indicators to a RadarScreen or Chart Analysis window, use the Studies > Add Study menu sequence, then select a name from the list of indicators.
-
With RadarScreen, you can use Studies > Add Study Group menu sequence to add several COT indicators at once to RadarScreen.
Custom Plots and COT Data
In addition to using built-in indicators that reference the basic COT data, you can plot any of the dozens of additional COT data fields in a RadarScreen or Chart Analysis window using one of the built-in 'Custom' indicators from the library along with the appropriate reserved word and field input values. This is an easy and flexible way to plot virtually any fundamental COT values (up to 4 at a time).
-
To add a custom indicator to a RadarScreen or Chart Analysis window, use the Studies > Add Study menu sequence, then select either the Custom 1, 2, 3 or 4 Line indicator from the list. While formatting the indicator, select the Inputs tab and change the Formula value to include the one of the COT data reserved words (see below) along with the appropriate data name in single quotes (refer to the COT Data - Futures Only / Combined Futures & Futures Options topic for data names and descriptions). For example, use a Formula value of GetFundData("COTF-12", 0) to display the COMMERCIAL POSITIONS-LONG (ALL) for Futures Only using a Custom 1 Line indicator.
Writing Your Own COT Studies and Strategies
The TradeStation platform allows you to use EasyLanguage to include any combination of fundamental COT data values in studies or strategies.
Functions
A set of supplied functions are also available for use in your own EasyLanguage statements that can be used to return the COT data value and error status in one call. These functions require that you declare a variable in your EasyLanguage code and understand the use of output parameters. You may choose to look at the EasyLanguage code for each function to develop a better understanding of how to use the underlying reserved words. Note that these functions allow you to access fundamental fields from other data streams, such as 'of Data2'.
-
There is a specific function call for each type of fundamental COT data field including fundvalue, fundstring, and FundBoolean. The data type may be found under the Type column in each COT Data Field category help topic.
-
You can also get the post and period end dates associated with a data field by using either funddate or FundPeriodEndDate.
Reserved Words
There are a set of reserved words that may be used to retrieve values for fundamental COT data fields and error status for Data1. These words can be used as inputs with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids in addition to using the words in your own EasyLanguage statements.
-
There is a specific reserved word for getting each type of fundamental COT data field including getfunddata, getfundasstring, and GetFundBoolean. The data type may be found under the Type column in each Fundamental Data Field category help topic.
-
You can also get the post and period end dates associated with a data field by using either getfundpostdate or GetFundPeriodEndDate.
-
The error status from the last 'GetFund' call is returned using the GetLastFundDataError word. An status of 0 indicates that the last data value was retrieved successfully. For all non-zero status values, compare the returned value with the error code list in the help topic to identify the error type.
COT Data - EasyLanguage Field Names
In EasyLanguage, fundamental COT data fields are provided that correspond to the two CFTC (Commodity Futures Trading Commission) reports for the Futures Only positions and for Combined Futures & Options. Historical values for Futures Only data goes back to 1986 and historical values for Combined Futures & Options data goes back to about 1995.
Lists of the COT data fields are organized as they would commonly appear on their respective CFTC reports.