FXCM WebSocket API
Stream FXCM forex prices, build trading dashboards and call OpenTrade / CloseTrade over the FXCM Socket.IO REST API.
Stream FXCM forex prices, build trading dashboards and call OpenTrade / CloseTrade over the FXCM Socket.IO REST API.
FXCM client over the public Socket.IO endpoint — live forex price subscriptions plus REST trading actions tied to your access token.
TsgcWSAPI_FXCM
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
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");
Live forex prices over Socket.IO plus REST trading actions wrapped in typed methods.
SubscribePriceSymbol / UnSubscribePriceSymbol opens the FXCM Socket.IO endpoint for the requested instrument and surfaces each tick as OnFXCMPrices.
Set FXCM.Token with the access token issued by FXCM — the component embeds it in the Socket.IO handshake and subsequent REST calls.
OpenTrade, CloseTrade, ChangeOrder and DeleteOrder call the matching REST endpoints with the signed token.
Account, OpenPosition, ClosedPosition and Order lists are retrievable on demand — the component delivers each list as its own typed event.
Point the underlying TsgcWebSocketClient at api-demo.fxcm.com or api.fxcm.com — everything else is identical.
On WatchDog reconnect the component replays the subscribe-price-symbol calls so the price stream resumes without manual intervention.
Authoritative sources for the APIs this component implements.
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. | Open | |
| Demo Project — Demos\05.Crypto\07.FXCM Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |