Actions15
- Calculation Actions
- MarketData Actions
- News Actions
- Symbol Actions
- Trade Actions
- Trading Actions
Overview
This node integrates with the XTB Trading API to perform various trading-related operations. Specifically, for the Trade resource and the Get Trade Status operation, it retrieves the status of a particular trade order by its order number. This is useful in scenarios where users want to monitor or verify the current state of a trade they have placed, such as checking if an order is still open, closed, or has encountered an error.
Practical examples include:
- Monitoring active trades to trigger alerts or further automation.
- Verifying the completion or cancellation of specific orders before executing subsequent steps.
- Auditing trade statuses for reporting or compliance purposes.
Properties
| Name | Meaning |
|---|---|
| Order | The numeric identifier of the trade order to get the status for. This specifies which trade's status will be retrieved. |
Output
The node outputs a JSON array where each element corresponds to the result of the requested operation on an input item. For the "Get Trade Status" operation, each output JSON object contains details about the specified trade order's current status as returned by the XTB Trading API. This typically includes information such as order state, execution details, timestamps, and any relevant trade metadata.
The node does not output binary data.
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-jslibrary for interacting with the XTB API. - The node manages connection lifecycle: it connects before processing and disconnects afterward.
Troubleshooting
- Connection Issues: Failure to connect to the XTB API WebSocket may occur due to network problems or invalid credentials. Ensure that the API credentials are correctly set up and that there is internet connectivity.
- Invalid Order Number: Providing an order number that does not exist or is out of range may cause errors or empty responses. Verify the order number before running the node.
- Unknown Resource or Operation: If the resource or operation parameters are incorrect or unsupported, the node throws an error indicating an unknown resource or operation.
- API Rate Limits or Downtime: The XTB API might enforce rate limits or experience downtime, leading to request failures. Implement retry logic or check API status if issues persist.
- Error Handling: If "Continue On Fail" is enabled, the node will output error messages in the JSON response instead of stopping execution, allowing workflows to handle errors gracefully.
Links and References
- XTB Trading API Documentation
- n8n Documentation - Creating Custom Nodes
- @sharplygroup/xtb-api-js GitHub Repository (for reference on the underlying API client)