To open a new pending order or trade (market order), you set the
var request = {
tradingAction: FXB.OrderTypes.SELL_LIMIT,
openPrice: {offset: 0.0020}, // Offset of 0.0020 from current price (bid, because sell)
instrumentId: "EUR/USD",
volume: {lots: 0.20}
};
However, for pending orders, you can use two additional values:
Compulsory and optional request properties when opening a new trade or order are as follows:
| Example | Description |
| instrumentId | |
| Volume to trade. Always compulsory. | |
| Open price for a pending order. Compulsory on pending orders; ignored on trades. For stop-limit orders, the | |
| Trigger (stop) price for stop-limit orders. Compulsory on stop-limit orders; ignored on all other types. | |
| Stop-loss to set on the order/trade. Always optional. | |
| Take-profit to set on the order/trade. Always optional. | |
| Trailing stop to apply to the order/trade. Always optional, and not necessarily available. Requires that the broker account supports trailing stops. | |
| Optional expiration on pending orders. Ignored on trades. | |
| comment | Textual comment to set on the order/trade, if supported by the back-end platform. |
| magicNumber | MT4/5-style "magic number" to set on the order/trade, if supported by the back-end platform. |