FXCM Trigger

Handle FXCM events

Overview

This node acts as a trigger for FXCM trading events, allowing workflows to respond automatically when specific changes occur in the FXCM trading environment. It is particularly useful for traders and automated trading systems that need to react to real-time updates such as price movements, order status changes, or position adjustments.

Common scenarios include:

  • Monitoring price changes of a particular trading instrument to execute trades or alerts when significant price movements happen.
  • Tracking order updates to manage trade lifecycle events like fills, cancellations, or rejections.
  • Observing position changes to update portfolio status or risk management systems.

For example, a user can configure this node to trigger whenever the EUR/USD price changes by at least 0.0001, enabling downstream nodes to analyze or act on these price updates immediately.

Properties

Name Meaning
Event The type of FXCM event to listen for. Options: "Price Update", "Order Update", "Position Update".
Instrument The trading instrument symbol to monitor (e.g., "EUR/USD"). Only applicable if Event is "Price Update".
Minimum Price Change The minimum price change threshold to trigger an update. Only applicable if Event is "Price Update".

Output

The node outputs JSON data representing the event details received from FXCM:

  • For Price Update events, the output JSON contains information about the instrument's price change, including the magnitude of the change.
  • For other event types ("Order Update" and "Position Update"), although not explicitly implemented in the provided code snippet, the node is designed to handle these events similarly by emitting relevant JSON data when those events occur.

No binary data output is produced by this node.

Dependencies

  • Requires an active FXCM API connection configured via credentials containing an API token, account type (demo or live), and trading station ID.
  • Uses an internal FXCM client library (FxcmClient) to subscribe to price updates and manage connections.
  • The node must be configured with valid FXCM API credentials in n8n to function properly.

Troubleshooting

  • Common issues:

    • Failure to connect to FXCM API due to invalid or missing credentials.
    • No triggers firing if the specified instrument does not exist or no price changes meet the minimum threshold.
    • Network connectivity problems preventing subscription to FXCM price updates.
  • Error messages:

    • Errors during triggering are wrapped with the prefix FXCM Trigger error: followed by the original error message.
    • If an unknown error occurs, a generic FXCM Trigger error: Unknown error is thrown.
  • Resolutions:

    • Verify that the API token and account details are correct and have sufficient permissions.
    • Ensure the instrument symbol matches FXCM's accepted format.
    • Confirm network access to FXCM endpoints is available from the n8n instance.

Links and References

Discussion