fxcm

0.1.0 • Public • Published

fxcm

Minimalist Node.js client for programmatically trading with FXCM REST API

Installation

npm install --save fxcm

Import

ES6 Import:

import FXCM from 'fxcm'

CommonJS:

const FXCM = require('fxcm')

Usage

const config = {
  token: "PASTE_YOUR_FXCM_TOKEN_HERE",
  isDemo: true
}

const fxcm = new FXCM(config)

// Get 30min historical candle data for USD/CAD. Max 50 data points (live/current candle is removed by default)
fxcm.historical({ pair: 'USD/CAD', timeframe = 'm30', datapoints = 50 })
  .then((data) => {
    console.log(JSON.stringify(data))
  })

// Get current market data for your subscribed symbols (subscription list can be edited at tradingstation.fxcm.com)
fxcm.markets()
  .then((data) => {
    console.log(JSON.stringify(data))
    fxcm.logout()
  })

Package Sidebar

Install

npm i fxcm

Weekly Downloads

2

Version

0.1.0

License

ISC

Unpacked Size

11.9 kB

Total Files

9

Last publish

Collaborators

  • cs3011