Algorithmic Trading with Forex Sentiment Data

Sentiment data has long been highly sought after by both professional and retail traders in the mission to get an edge in the market. This type of data is defined as the overall attitude of traders towards a specific instrument or financial market. Its value is not directly derived from price but from trader perception of price so it is considered an independent variable. Popular sentiment data in today’s market includes Commitment of Traders (COT), the Daily Sentiment Index (DSI), and the Put/Call ratio. Equity and futures traders can access this market data relatively easily due to the centralization of the market they are trading.

On the contrary, there is no single centralized exchange for the Foreign Exchange market therefore sentiment data is difficult to obtain and can be extremely pricey for Forex traders. Even if a trader had access to such data, the sample set may be limited and not closely reflect the actual market.

In order for Forex sentiment data to be valuable, the data must be derived from a large, far reaching sample of Forex traders. FXCM is an industry-leading Forex broker that boasts important Forex trading volumes and a significant trader sample. The large sample size is one of the most representative samples of the entire retail Forex market so the data can be used to help predict movement of the rate of an instrument in the overall market.

What is this Forex sentiment data?

This sentiment data shows the retail trader positioning and is derived from the buyer-to-seller ratio among retail FXCM traders. At a glance, you can see historical and current trader positioning in the market. A positive ratio indicates there are more traders that are long for every trader that is short. A negative ratio is indicative of a higher number of traders that are short for every long trader. For example, a ratio of 2.5 would mean that there are 2.5 traders that are long for every short trader and -2.5 would mean just the opposite.

Furthermore, this robust data set also has the total volume of traders that are long and short, as well the total net long or net short volume.  For example, the data includes LongAmountK which is the total volume of all FXCM retail clients that are currently long a specific symbol. LongAmountKNET will show the total volume of all FXCM retail accounts with a net long position.  The total number of positions that are long of all FXCM retail clients is shown as the LongAmountKOrders and vice versa for the ShortAmountKOrders.

How is this data valuable in algorithmic trading?

Sentiment can be used as a contrarian indicator to help predict potential moves and locate trading opportunities. When there is an extreme ratio or net volume reading, the majority of traders are either long or short a specific instrument. It is expected that the traders who are currently in these positions will eventually close out therefore bring the ratio back to neutral. Consequently, there tends to be a sharp price movement or a reversal.

When extremes like this are present in the market, a mean reversion automated strategy can be implemented to take advantage of the moves in the market that are expected to ensue. If sentiment is skewed very high or very low, price is moving away from the mean. However, over time it is expected to regress back to the mean resulting in a more neutral reading. Neutral would be considered a number close to 1.0 or -1.0.

First, the algorithm would be engineered to verify whether are not there are any extremes present in the market of the chosen universe of instruments. If present, the mean reversion algorithm would enter a short position on instruments that have a sentiment reading of 2.0 and higher and buy the instruments that are -2 or lower.  In this way, the trader would be going opposite of the retail crowd.

It is recommended that a confirmation indicator or two be coded into the mean reversion strategy as well. For example, jumps in volume can denote when the retail crowd begins to close out of positions and when the market begins to revert back to the mean.

Additionally, FXCM’s historical sentiment data can be used to backtest the mean reversion strategy. The data is available on these 32 instruments:


Getting started with the data is easy. You can enjoy a free one-month sample of our historical Sentiment Data by pasting this link in your browser{instrument}.csv.gz and changing the {instrument}: to the pair or CFD you would like to download data for. For example, for USD/JPY data download you would use this link:

When the file downloads, it will be a GNU zip compressed file so you will need to use a decompression utility to open it. To open the file with 7zip, open the downloads folder, click on your file, and click ‘copy path’. Then open 7Zip and paste your clipboard into the address bar and click enter. Then click the ‘extract’ button. This will open a window where you can designate a destination to copy your new csv file. Click OK, and navigate back to your file explorer to see your csv file.

You can find more details about the sentiment data by checking out FXCM’s Github page:

Risk Warning: The FXCM Group does not guarantee accuracy and will not accept liability for any loss or damage which arise directly or indirectly from use of or reliance on information contained within the webinars. The FXCM Group may provide general commentary which is not intended as investment advice and must not be construed as such. FX/CFD trading carries a risk of losses in excess of your deposited funds and may not be suitable for all investors. Please ensure that you fully understand the risks involved.