FXCM

Execute FXCM trading operations

Overview

This node integrates with the FXCM trading platform to execute various trading operations. Specifically, for the Account resource and the Place Market Order operation, it allows users to place immediate market orders on specified trading instruments. This is useful for traders who want to quickly enter or exit positions at the current market price without waiting for limit prices.

Common scenarios include:

  • Quickly buying or selling currency pairs or other instruments based on real-time market conditions.
  • Automating trade entries in response to signals from other parts of an n8n workflow.
  • Managing risk by optionally setting stop loss and take profit levels alongside the market order.

Example: A user wants to buy 1000 units of EUR/USD immediately at the current market price, with a stop loss at 1.10 and take profit at 1.15.

Properties

Name Meaning
Instrument Trading instrument/symbol to place the market order on (e.g., "EUR/USD").
Order Type Whether to buy or sell the instrument. Options: "Buy", "Sell".
Amount Trading amount in the base currency (number of units to buy or sell).
Stop Loss Optional stop loss price level to limit potential losses.
Take Profit Optional take profit price level to lock in gains automatically.

Output

The node outputs a JSON object representing the result of the placed market order. This typically includes details such as order ID, status, filled amount, price, and any other metadata returned by the FXCM API about the executed order.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "orderId": "123456",
  "status": "filled",
  "instrument": "EUR/USD",
  "amount": 1000,
  "price": 1.12345,
  "stopLoss": 1.10,
  "takeProfit": 1.15,
  "side": "buy"
}

Dependencies

  • Requires an active FXCM API key credential configured in n8n to authenticate requests.
  • Depends on the FxcmClient class which handles communication with the FXCM API.
  • The node disconnects from the FXCM client after each execution to clean up resources.

Troubleshooting

  • Common issues:

    • Invalid or expired API credentials will cause authentication failures.
    • Incorrect instrument symbols may lead to errors or rejected orders.
    • Insufficient account balance can prevent order placement.
    • Providing invalid stop loss or take profit values (e.g., zero or out of range) might be ignored or cause errors.
  • Error messages:

    • Authentication errors: Check that the API key credential is correctly set and has necessary permissions.
    • Validation errors: Verify that all required parameters are provided and valid.
    • Network or API downtime: Retry later or check FXCM service status.
  • The node supports continuing on failure if enabled, allowing workflows to handle errors gracefully.

Links and References

Discussion