From sgcWebSockets 2022.7.0 XTB WebSocket API is supported, XTB provides access to over 2100 financial markets including FX, indices, shares, commodities and more.
Properties
The WebSocket protocol allows 2 types of requests: Streaming commands (receive live updates) and Retrieve Trading Data (send a request to server retrieving some information).
You can configure the following properties in the XTB property.
- User: the username that identifies the connection.
- Password: it's the secret value of the user.
- Demo: if enabled, will connect to the XTB Demo account (disabled by default).
Connection
When the client successfully connects to XTB servers, the event OnXTBConnect is fired. If there is any error while trying to connect, the event OnXTBError will be fired with the error details.
After the event OnXTBConnect is fired, then you can start to send and receive messages from XTB servers.
Find below a compiled demo for Windows to test the XTB Client Features.