Execute a BUY order using AngularJS trade service.
⚠️ WARNING: This executes real trades. Always test on demo accounts first.
Directly calls the same trading service that xStation5 UI uses, bypassing UI automation for faster and more reliable execution.
Volume to buy (number of units)
Optionaloptions: TradeOptionsOptional trade parameters (stop loss, take profit)
Trade execution result with order ID if successful
Disconnect from Chrome.
Cleanly closes the CDP connection and clears references.
Get the account number from the current xStation5 session.
Extracts the account number from the page content where it appears as #12345678.
Account number or 0 if not found
Get account balance and equity using AngularJS services.
Retrieves real-time balance data including equity, free margin, and currency. Uses the same service that xStation5 UI uses internally.
Account balance information
Get all open positions using AngularJS services.
Retrieves all currently open trading positions with details like volume, open price, profit/loss, stop loss, take profit, etc.
Array of open positions, empty array if no positions
Get current quote (bid/ask prices) for a symbol using AngularJS services.
Retrieves real-time price data including bid, ask, spread, high, low, and timestamp. Automatically resolves symbol names to internal symbol keys.
Quote data or null if symbol not found or timeout
Check if connected and xStation5 AngularJS is ready.
True if page is connected and AngularJS scope is available
Search for financial instruments by name across 11,888+ available instruments.
Searches through the symbols cache that xStation5 loads into AngularJS scope. Matches against both symbol names and descriptions.
Search query (e.g., 'Apple', 'CIG', 'EUR/USD')
Array of matching instruments (limited to 20 results)
Execute a SELL order using AngularJS trade service.
⚠️ WARNING: This executes real trades. Always test on demo accounts first.
Directly calls the same trading service that xStation5 UI uses, bypassing UI automation for faster and more reliable execution.
Volume to sell (number of units)
Optionaloptions: TradeOptionsOptional trade parameters (stop loss, take profit)
Trade execution result with order ID if successful
Browser automation client for xStation5.
Connects to an existing Chrome instance via CDP and executes trades by manipulating AngularJS services directly in the browser context. This approach bypasses UI automation and directly calls the same APIs that xStation5 uses internally.
Requirements:
--remote-debugging-port=9222https://xstation5.xtb.com⚠️ Warning: This executes real trades. Always test on demo accounts first.
Example
Example