FXCM WebSocket API

Stream FXCM forex prices, build trading dashboards and call OpenTrade / CloseTrade over the FXCM Socket.IO REST API.

TsgcWSAPI_FXCM

FXCM client over the public Socket.IO endpoint — live forex price subscriptions plus REST trading actions tied to your access token.

Component class

TsgcWSAPI_FXCM

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Pair with a TsgcWebSocketClient, set FXCM.Token, then subscribe to price symbols and call OpenTrade / CloseTrade as needed.

uses
  sgcWebSocket, sgcWebSocket_API_FXCM;

var
  WSClient: TsgcWebSocketClient;
  FXCM: TsgcWSAPI_FXCM;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  FXCM := TsgcWSAPI_FXCM.Create(nil);
  FXCM.Client := WSClient;
  FXCM.FXCM.Token := 'your-access-token';

  WSClient.Active := True;

  FXCM.SubscribePriceSymbol('EUR/USD');
  FXCM.SubscribePriceSymbol('USD/JPY');
end;
// uses: sgcWebSocket, sgcWebSocket_API_FXCM
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_FXCM *FXCM = new TsgcWSAPI_FXCM(this);
FXCM->Client = WSClient;
FXCM->FXCM->Token = "your-access-token";

WSClient->Active = true;
FXCM->SubscribePriceSymbol("EUR/USD");

What's inside

Live forex prices over Socket.IO plus REST trading actions wrapped in typed methods.

Live forex prices

SubscribePriceSymbol / UnSubscribePriceSymbol opens the FXCM Socket.IO endpoint for the requested instrument and surfaces each tick as OnFXCMPrices.

Token auth

Set FXCM.Token with the access token issued by FXCM — the component embeds it in the Socket.IO handshake and subsequent REST calls.

Trading actions

OpenTrade, CloseTrade, ChangeOrder and DeleteOrder call the matching REST endpoints with the signed token.

Account snapshots

Account, OpenPosition, ClosedPosition and Order lists are retrievable on demand — the component delivers each list as its own typed event.

Demo or live

Point the underlying TsgcWebSocketClient at api-demo.fxcm.com or api.fxcm.com — everything else is identical.

Reconnect safe

On WatchDog reconnect the component replays the subscribe-price-symbol calls so the price stream resumes without manual intervention.

Specifications & references

Authoritative sources for the APIs this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — API_FXCM Full property, method and event reference for this component.
Demo Project — Demos\05.Crypto\07.FXCM Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Trade Forex with FXCM?

Download the free trial and integrate FXCM price streams and trading into your Delphi applications.