Actions16
- Account Actions
- Trading Actions
- Market Data Actions
Overview
This node integrates with the FXCM trading platform to perform various market data and trading operations. Specifically, for the Market Data - Modify Position operation, it allows users to modify an existing trading position by updating its stop loss and take profit levels. This is useful for traders who want to adjust risk management parameters on open positions without closing and reopening them.
Common scenarios include:
- Adjusting stop loss or take profit levels dynamically based on market conditions.
- Managing open positions to lock in profits or limit losses.
- Automating position management as part of a larger trading workflow.
Example: A user has an open EUR/USD position and wants to increase the stop loss to reduce risk exposure after a favorable price movement. The node modifies the position accordingly.
Properties
| Name | Meaning |
|---|---|
| Instrument | Trading instrument to get data for (e.g., "EUR/USD") |
Note: Although the provided property list only includes "Instrument," the code also uses these input properties for the Modify Position operation (not listed in your JSON but inferred from code):
positionId(string/ID): Identifier of the position to modify.stopLoss(number): New stop loss value.takeProfit(number): New take profit value.
These are required to specify which position to modify and the new risk parameters.
Output
The output is a JSON object representing the response from the FXCM API after modifying the position. It typically contains details about the updated position, including confirmation of the new stop loss and take profit values.
Example output structure:
{
"positionId": "12345",
"instrument": "EUR/USD",
"stopLoss": 1.1000,
"takeProfit": 1.1500,
"otherPositionDetails": "..."
}
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 internal
FxcmClientclass 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.
- Providing an incorrect or non-existent
positionIdwill result in errors indicating the position cannot be found. - Missing required parameters like
stopLossortakeProfitmay cause the API call to fail.
Error messages:
"Invalid credentials": Check that the API key/token is correct and has not expired."Position not found": Verify thepositionIdcorresponds to an open position."Parameter missing or invalid": Ensure all required inputs are provided and correctly formatted.
To handle errors gracefully, the node supports continuing on failure, returning error messages in the output JSON.