Actions16
- Account Actions
- Trading Actions
- Market Data Actions
Overview
This node integrates with the FXCM trading platform to perform various trading operations. Specifically, the "Modify Position" operation allows users to update an existing open position by adjusting its stop loss and take profit levels. This is useful for traders who want to manage risk or lock in profits dynamically after opening a trade.
Common scenarios include:
- Adjusting stop loss and take profit levels on an active position based on market movements.
- Managing risk exposure without closing and reopening positions.
- Automating position management as part of a larger trading workflow.
Example: A user has an open EUR/USD position and wants to tighten the stop loss to reduce potential losses as the market moves favorably.
Properties
| Name | Meaning |
|---|---|
| Instrument | Trading instrument to get data for (e.g., "EUR/USD"). Required for identifying the asset. |
| positionId | The unique identifier of the position to modify. |
| stopLoss | New stop loss price level to set for the position. |
| takeProfit | New take profit price level to set for the position. |
Note: For the "Modify Position" operation, the key input properties are positionId, stopLoss, and takeProfit. The provided "Instrument" property is generally used for other operations but not directly in this one.
Output
The node outputs a JSON object representing the modified position details returned from the FXCM API. This typically includes updated position information such as new stop loss and take profit values, position size, instrument, and status.
If the operation fails and "Continue On Fail" is enabled, the output will contain an error message in the JSON under the error field.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the FXCM trading platform.
- The node depends on the internal
FxcmClientclass to communicate with FXCM's API. - Proper network connectivity to FXCM's services is necessary.
- No additional environment variables are explicitly required beyond the API credential.
Troubleshooting
Common issues:
- Invalid or expired API credentials will cause authentication failures.
- Providing an incorrect or non-existent
positionIdwill result in errors when attempting to modify a position. - Setting invalid stop loss or take profit values (e.g., outside allowed price ranges) may cause the API to reject the request.
- Network connectivity problems can prevent successful API calls.
Error messages:
- Errors thrown by the FXCM API are propagated and can appear in the node output if "Continue On Fail" is enabled.
- Typical error messages might include "Position not found", "Invalid stop loss value", or "Authentication failed".
Resolution tips:
- Verify that the API key credential is valid and has sufficient permissions.
- Double-check the
positionIdcorresponds to an open position. - Ensure stop loss and take profit prices are logical relative to the current market price.
- Test network connectivity and retry if transient errors occur.
Links and References
- FXCM API Documentation
- FXCM Trading Platform
- n8n documentation on creating custom nodes