Actions15
- Calculation Actions
- MarketData Actions
- News Actions
- Symbol Actions
- Trade Actions
- Trading Actions
Overview
This node integrates with the XTB Trading API to retrieve market data, specifically tick prices for given symbols at a specified timestamp and level. It is useful in scenarios where real-time or historical tick-level price data is needed for trading analysis, algorithmic trading strategies, or market research.
For example, a trader might use this node to fetch tick prices of multiple currency pairs or stocks at a particular moment to analyze price movements or volatility at a granular level.
Properties
| Name | Meaning |
|---|---|
| Level | The tick price level to retrieve. This typically refers to the depth or detail of ticks. |
| Symbols | The financial instrument symbols (e.g., currency pairs, stock tickers) to get tick prices for. Multiple symbols can be specified. |
| Timestamp | The specific point in time (as a Unix timestamp) for which to retrieve tick prices. |
Output
The node outputs an array of JSON objects, each representing the tick price data retrieved for the requested symbols at the specified timestamp and level. Each object contains detailed pricing information as provided by the XTB API's market data endpoint.
If the node supports binary data output (not explicitly shown in the code), it would typically represent raw market data streams or snapshots, but based on the static code, only JSON structured tick price data is returned.
Dependencies
- Requires an active connection to the XTB Trading API via a WebSocket manager.
- Needs valid API credentials (an API key or authentication token) configured in n8n to authenticate requests.
- Uses the
@sharplygroup/xtb-api-jslibrary for interacting with the XTB API. - Relies on internal resource classes that wrap API operations for different resources including MarketData.
Troubleshooting
- Connection Issues: Failure to connect to the XTB API WebSocket may occur if credentials are invalid or network issues exist. Verify API credentials and network connectivity.
- Unknown Resource Error: If an unsupported resource name is provided, the node throws an error indicating "Unknown resource". Ensure the resource parameter is set correctly to "marketData" for this operation.
- Operation Errors: If the operation name is incorrect or not supported under the selected resource, the node will throw an error. Confirm the operation is set to "getTickPrices".
- Empty or Invalid Input: Providing empty or malformed symbols or timestamps may result in no data or errors. Validate input parameters before execution.
- API Limits or Downtime: The XTB API may impose rate limits or experience downtime, causing request failures. Monitor API status and usage quotas.
Links and References
- XTB Trading API Documentation
- n8n Documentation
- @sharplygroup/xtb-api-js GitHub Repository (for the underlying API client library)