FXCM

Execute FXCM trading operations

Overview

This node integrates with the FXCM trading platform to execute various trading operations and retrieve market data. Specifically, for the "Place Limit Order" operation under the "Default" resource, it allows users to place a limit order on a specified trading instrument. A limit order is an order to buy or sell a security at a specified price or better, which helps traders control entry prices and manage risk.

Common scenarios where this node is beneficial include:

  • Automated trading strategies that require placing limit orders based on predefined criteria.
  • Risk management by setting stop loss and take profit levels alongside the limit order.
  • Algorithmic trading systems that interact programmatically with FXCM to manage positions.

Practical example:

  • A trader wants to buy 1000 units of EUR/USD only if the price drops to 1.1000, with a stop loss at 1.0950 and take profit at 1.1100. This node can place such a limit order automatically.

Properties

Name Meaning
Instrument The trading instrument or symbol to place the limit order on (e.g., "EUR/USD").
Order Type Whether to buy or sell. Options: "Buy", "Sell".
Amount The trading amount in the base currency (e.g., 1000 units).
Price The limit price level at which to execute the order.
Stop Loss Optional stop loss price level to limit potential losses.
Take Profit Optional take profit price level to secure gains when the price reaches a target level.

Output

The node outputs a JSON object representing the response from the FXCM API after placing the limit order. This typically includes details about the placed order such as order ID, status, instrument, amount, price, and any other metadata returned by FXCM.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "orderId": "123456",
  "instrument": "EUR/USD",
  "isBuy": true,
  "amount": 1000,
  "price": 1.1000,
  "stopLoss": 1.0950,
  "takeProfit": 1.1100,
  "status": "placed"
}

Dependencies

  • Requires an active FXCM API key credential configured in n8n to authenticate requests.
  • Depends on the internal FxcmClient class to communicate with the FXCM API.
  • Network connectivity to FXCM's trading servers is necessary.

Troubleshooting

  • Common issues:

    • Invalid or expired API credentials will cause authentication failures.
    • Incorrect instrument symbols may result in errors or rejected orders.
    • Insufficient account balance or margin can prevent order placement.
    • Providing invalid price levels (e.g., stop loss above take profit) might cause API errors.
  • Error messages:

    • Authentication errors: Verify that the API key credential is correctly set up and has required permissions.
    • Validation errors from FXCM API: Check that all input parameters like instrument, amount, price, stop loss, and take profit are valid and logically consistent.
    • Network errors: Ensure stable internet connection and that FXCM endpoints are reachable.
  • The node supports continuing on failure; enabling this option allows workflows to proceed even if the order placement fails, returning error details in the output JSON.

Links and References

Discussion