You can modify a pending order or open trade using
// Change the stop-loss on order O12345 to 30 pips from the current market price
// (leaving all other settings unchanged)
Framework.SendOrder({
orderId: "O12345",
tradingAction: FXB.OrderTypes.CHANGE,
sl: {pips: 30}
}, function (MsgResult) {
…
});
The stop-loss (
When modifying an order or trade, you can use all the same options as when making a new request. For example, you can change an open trade as follows:
Framework.SendOrder({
orderId: "T12345",
tradingAction: FXB.OrderTypes.CHANGE,
timeframe: 3600, // Timeframe for candle-based stop-loss
sl: {bar: {index: 1, price: "l"}}, // Set the stop-loss to the low of the previous H1 bar
tp: {pips: 30} // Set the take-profit to 30 pips from the current market price
}, function (MsgResult) {
…
});