Actions15
- Calculation Actions
- MarketData Actions
- News Actions
- Symbol Actions
- Trade Actions
- Trading Actions
Overview
This node integrates with the XTB Trading API to retrieve various types of trading-related data. Specifically, for the MarketData resource and the Get Chart Range Request operation, it fetches chart data over a specified range based on the provided information parameter. This is useful for traders or analysts who want to visualize historical price movements or other market indicators within a given timeframe.
Practical examples include:
- Retrieving historical price charts for a specific financial instrument.
- Analyzing market trends over a custom date range.
- Feeding chart data into further workflows for automated trading strategies or reporting.
Properties
Name | Meaning |
---|---|
Info | The specific information or symbol for which to get the chart data. This typically represents the financial instrument or market data identifier. |
Output
The node outputs an array of JSON objects representing the requested chart data for the specified range. Each object in the output array corresponds to a data point or set of data points retrieved from the XTB API, structured according to the API's response format for chart data.
If the node supports binary data output (not explicitly shown in the code), it would typically represent chart images or related binary content; however, this implementation focuses on JSON data output.
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.
- Depends on the external
@sharplygroup/xtb-api-js
library for interacting with the XTB API. - Uses internal resource classes that wrap API operations for different resources including MarketData.
Troubleshooting
- Connection Issues: If the node fails to connect, verify that the API credentials are correct and that the XTB API service is reachable.
- Unknown Resource Error: Occurs if an unsupported resource name is provided. Ensure the resource parameter is set 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 "getChartRangeRequest".
- API Rate Limits or Quotas: The XTB API may limit request rates; hitting these limits can cause errors. Implement retry logic or reduce request frequency.
- Invalid Info Parameter: Providing an invalid or unsupported info value may result in empty or error responses. Validate the input against supported symbols or identifiers.
Links and References
- XTB Trading API Documentation
- n8n Documentation on Creating Custom Nodes
- @sharplygroup/xtb-api-js GitHub Repository (for reference on API client usage)