@

fxcmpy Python Package

FXCM offers a modern REST API with algorithmic trading as its major use case. fxcmpy is a Python package that exposes all capabilities of the REST API via different Python classes. The classes allow for a convenient, Pythonic way of interacting with the REST API on a high level without needing to take care of the lower-level technical aspects. Traders, data scientists, quants and coders looking for forex and CFD python wrappers can now use fxcmpy in their algo trading strategies.

Resources:

Python FXCM Connect

Python FXCM Quant

Getting Started

Create your API Token by logging into our HTML5 Trading Station Web platform.

Need credentials? Sign up for a FREE practice account now.

Create your token by going to the upper right hand area of the platform and select 'Token Management'.

Token Management
Token Management 2
FXCM - Python REST API login

IMPORTANT – Real Accounts Only – Generating a token does not grant your live trading account with API access. In order to successfully connect to the REST API you must e-mail api@fxcm.com requesting that access be granted.

Installation of the fxcm Python package is easy and straight forward with pip:

pip install fxcmpy

Connect to the server using your API token and get started:

import fxcmpy TOKEN = YOUR_FXCM_TOKEN
con = fxcmpy.fxcmpy(access_token = TOKEN, log_level = 'error')
instruments = con.get_instruments()
print(instruments[:5]) ['EUR/USD', 'USD/JPY', 'GBP/USD', 'USD/CHF', 'EUR/CHF']

Need credentials? Sign up for a FREE practice account now.

If you have questions, check out our Github or get in touch via api@fxcm.com.