FXCM

Execute FXCM trading operations

Overview

This node integrates with the FXCM trading platform to execute various trading and market data operations. Specifically, for the Market Data resource with the Place Market Order operation (under the "trading" resource in code), it allows users to place immediate market orders to buy or sell a specified amount of a financial instrument.

Common scenarios where this node is beneficial include:

  • Automated trading strategies that require placing market orders based on signals or triggers.
  • Portfolio rebalancing by buying or selling instruments at current market prices.
  • Quick execution of trades without manual intervention.

For example, a user can configure the node to buy 1000 units of EUR/USD at the current market price, optionally setting stop loss and take profit levels to manage risk and potential gains.

Properties

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

Output

The node outputs an array with one item containing a json object representing the response from the FXCM API after placing the market order. This JSON typically includes details about the executed order such as order ID, status, filled amount, price, and any related metadata returned by FXCM.

No binary data output is produced by this operation.

Dependencies

  • Requires an active FXCM API credential configured in n8n to authenticate requests.
  • Depends on the bundled 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 missing API credentials will cause authentication failures.
    • Incorrect instrument symbols may result in errors or rejected orders.
    • Insufficient funds or margin can cause order placement to fail.
    • Network connectivity problems can interrupt API calls.
  • Error messages:

    • Errors thrown by the FXCM API are caught; if "Continue On Fail" is enabled, the error message is returned in the output JSON under error.
    • Typical error messages might include "Invalid instrument", "Insufficient funds", or "Order rejected".
  • Resolutions:

    • Verify API credentials and permissions.
    • Confirm instrument symbols are valid and supported by FXCM.
    • Ensure account has sufficient balance and margin.
    • Check network connectivity and retry if transient errors occur.

Links and References

Discussion