Click here to Login




Trading Forex with the commitments of traders report

Updated on 2012-04-04





Commitments of traders report contains information about the long and short positions taken by commercials, speculators and small traders. The information contained within this report is very important particularly to Futures and Forex traders.

The COT or commitments of traders report is published by the Commodity Futures Trading Commission (CFTC) every Friday. It is an excellent tool to measure the market sentiment of commodities, stock indices and currencies because it tells us how heavily big traders (speculator and commercial) are investing in these markets.

Although, this report is about long and short positions on futures contracts, Forex traders should take a close look at it. Indeed, it is a great way to see the bullish and bearish sentiment for different currencies.


Downloading COT Data

The commitments of traders report includes many measures for each group. These measures include the number of long contracts, the number of short contracts, open interest, number of trades, reportable positions and non-reportable positions.

Historical data is available freely on the CFTC website but it may look intimidating at first and it is not always easy to find the data your are looking for.

Fortunately, QuantShare has some downloaders that retrieve COT data and store it in a custom database. The Commitments of Traders item, for example, downloads the legacy report starting from 1986 then adds the different measures in a custom database whose name is "commitments_traders1".

Make sure you read the download item description for instructions on how to download data for the different currency futures contracts.

In our case, we are interested only in currency futures contracts and therefore we can specify the following fields under the downloader "Symbols" tab.

AUSTRALIAN DOLLAR=AUDUSD
BRITISH POUND STERLING=GBPUSD
CANADIAN DOLLAR=USDCAD
EURO FX=EURUSD
JAPANESE YEN=USDJPY
NEW ZEALAND DOLLAR=NZDUSD
SWISS FRANC=USDCHF



You may also look at the following item (Commitments of Traders - Historical Data) which downloads the new report data from the U.S. Commodity Futures Trading Commission website.


Display the Commitments of traders' data

There are two ways to display this data:

1- Database Editor

- Select "Data" then "Edit Databases"
- Select "Custom" database then "commitments_traders1"
- Type a Forex symbol (under "Symbols" panel). Example: EURUSD


2- Database Data

- Select "Tools" then "Database Data"
- Next to database combo box, select "commitments_traders1"




Commitments of traders' charts

Let us display the net position of commercials, speculators and small traders on a chart.

- Open a chart by selecting "View" then "New Chart"
- Select the "EURUSD" symbol for example (Forex symbols & data must be added to your database - Download -> Download Data Wizard -> Forex -> Download)
- Click a new pane by right clicking on the chart then selecting "Create new pane"
- In the new pane, click on the first icon (at the top) to add an indicator or a time-series
- When the "Add a function" control appears, select "Databases/Fields" tab
- Select "commitments_traders1" database (This database was created by the commitments of traders' downloader)
- Under "Select a field", select "noncom_long" field (Speculators long positions) then click on "OK"

To display the net positions, we must update the pane's formula.

- Right click on the new pane then select "Edit formula"
- Here is the formula to display the net positions of commercials, speculators and small traders for the Euro futures

spec_long = GetData('commitments_traders1', 'noncom_long', LastData);
spec_short = GetData('commitments_traders1', 'noncom_short', LastData);
spec = spec_long - spec_short;
Plot(spec, "Speculators", colorRed, chartLine, StyleSymbolNone);

comm_long = GetData('commitments_traders1', 'com_long', LastData);
comm_short = GetData('commitments_traders1', 'com_short', LastData);
comm = comm_long - comm_short;
Plot(comm, "Commercials", colorBlue, chartLine, StyleSymbolNone);

trad_long = GetData('commitments_traders1', 'nonrep_long', LastData);
trad_short = GetData('commitments_traders1', 'nonrep_short', LastData);
trad = trad_long - trad_short;
Plot(trad, "Traders", colorGreen, chartLine, StyleSymbolNone);


The formula may look complicated but it is very easy to understand.
The first and second lines get the non-commercials (speculators) long and short positions from the "commitments_traders1" database
The third line calculates the net position by subtracting the long positions to the short positions
The forth line plots the net position on the chart

Non-Commercial or large speculators are mainly banks and hedge funds who trade currency futures for speculation.
Commercials are mainly importers and exporters who use futures contracts for hedging purposes.
Non-Reportable traders are small traders who are not required to report their positions to the CFTC.




Trading system based on the commitments of traders data

Here, I will show you how to create a basic trading system using the Euro/Dollar currency and COT or commitments of trader's data.

- Open the simulator manager by selecting "Analysis" then "Simulator"
- Click on "New" to create a new trading system
- Select the "Create a trading system using the formula editor" tab

Our strategy will have two buy rules and one single sell rule.

Buy Rules:

- The price is above the 30-Bar simple moving average
- The net speculators position is higher than 0


Sell Rule:

- The net speculators position is lower or equal to 0

In the formula editor, type the following code:

rule1 = close > sma(close, 30);

spec_long = GetData('commitments_traders1', 'noncom_long', LastData);
spec_short = GetData('commitments_traders1', 'noncom_short', LastData);
spec = spec_long - spec_short;

rule2 = spec > 0;

buy = rule1 and rule2;
sell = !rule2; // Opposite of rule2



Before saving the strategy, set the number of positions to "1"; click on "Symbols & Dates", add a new "custom symbols" condition then add the following Forex symbol: EURUSD

Click on "Create Trading System" to save the COT based trading system.


Backtesting the trading system

In the simulator manager, select the trading system we have just created then click on "Simulate / Backtest".




The COT report comes with few days delay. In order to get accurate backtesting results, it is advisable to apply the "ref" function when getting COT data using "GetData". The "ref" references past bars.
Example:
spec_long = ref(GetData('commitments_traders1', 'noncom_long', LastData), 7);


Note: Unlike the Spot FX market, in currency futures foreign currencies are quoted directly against the US dollar. As an example, the Japanese Yen is quoted against the US dollar, while the notation in the spot Forex market is USD/JPY.











one comment (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1451 days ago

Profile Graphs
Posted 1556 days ago

QuantShare
Previous Posts

More Posts

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.