Sales Order Submission Messages

This documentation is for FX Sales 1.16 and below. From version 1.17 (27 Jan 2017), FX Sales requires backend adapters to implement the FX Integration API 3. For documentation on trade models and messages in FX Integration API 3, see FX Integration API.

This page describes the trade model and messages used in the submission of an order using FX Sales.

Trade model

The order submission trade model is shown below.

Order Submission 1 7 0

Blue arrows denote a message sent by the client, or a system timeout. Green arrows denote messages sent by the server.

Error and Reject messages are not shown in the diagram. The server may send these messages in place of SubmitAck, Accepting and Accept messages.

Message specifications

This section describes the following messages:

Submit message [client > server]

An order submission message includes strategy fields and one or more leg fields. Each leg field is prefixed with the leg number, in the format 'Lx_', where 'x' is the leg number.

The order’s strategy determines which fields are included in the message:

SINGLE

Fields: strategy, and leg 1 (L1_*).

OCO

Fields: strategy, leg 1 (L1_*), and leg 2 (L2_*). One leg must be a take-profit order and the other leg must be a stop-loss order.

IF-DONE

Fields: strategy, leg 1 (L1_*), and leg 2 (L2_*). Leg 1 is the parent order and leg 2 is the child order. Leg 1 can be a take-profit order or a stop-loss order. Leg 2 can be a take-profit order or a stop-loss order.

IF-DONE-OCO

Fields: strategy, leg 1 (L1_*), leg 2 (L2_*), and leg 3 (L3_*). The OCO component (leg 1 and leg 2) must comprise a take-profit order and a stop-loss order. Leg 1 and leg 2 cannot be of the same type.

Fields

Strategy fields
Field Name Value Example

Account

The account the strategy will be submitted under, in the form "<description>|<ID>"

My Account|Acc1

ActivationDate

When the order will activate. Valid values: 'GFA' or a date in the format 'yyyymmdd'.

'GFA' indicates the order should activate immediately if accepted.

20130606

ActivationLocation

The timezone of the ActivationDate and ActivationTime, if the ActivationDate has a value in the form 'yyyymmdd'. Valid values: "LOCAL" or a TZ string from the tz timezone database. See the TZ column of the table on this page: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Europe/London

ActivationTime

The time the order should activate, if ActivationDate is in the format of 'yyyymmdd'. Format 'hh:mm:ss'.

12:12:12

ActivationUTCOffset

If ActivationLocation is set to "LOCAL", this field should be set to the UTC offset for local time as defined by the user’s web browser.

If ActivationLocation is set to a specific timezone, this field should be set to '00:00'.

+05:00

AlertType

A comma-separated list of zero or more alert types. Valid values: SMS, EMAIL.

SMS

ControlAddLeg

This is a control field that the front-end trading library adds automatically.

1

CurrencyPair

The currency pair for all legs

GBPUSD

ExpirationDate

The date the order should expire. Valid values: GTC, GFD, date in the format 'yyyymmdd'.

GTC

Good 'till cancelled. The order should remain active until it is cancelled.

GFD

Good for day. The order should remain active for the current trading day only.

GTC

ExpirationTime

The time the strategy should be expire, if the ExpirationDate is in the format 'yyyymmdd'.

12:12:12

ExpirationLocation

The timezone of the ExpirationDate and ExpirationTime, if the ExpirationDate has a value in the form 'yyyymmdd'. Valid values: "LOCAL" or a TZ string from the tz timezone database. See the TZ column of the table on this page: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Europe/London

ExpirationUTCOffset

If ExpirationLocation is set to "LOCAL", this field should be set to the UTC offset for local time as defined by the user’s web browser.

If ExpirationLocation is set to a specific timezone, this field should be set to '00:00'.

+05:00

MsgType

The transition in the state model.

Submit

Remarks

Comment field.

Call John when filled

RequestID

Unique ID for this request. Generated by the client.

112314243333

StrategyType

The strategy of the order. Valid values: SINGLE, OCO, IF-DONE, IF-DONE-OCO

SINGLE

TOBOUser

The user on whose behalf the trade is submitted.

john.smith

TradingProtocol

The protocol of this message.

OrderSubmission

TradingSubProtocol

The sub-protocol of this message.

SALES_ORDER

Trade leg fields (substitute 'x' with the leg number)
Field Name Values Example

Lx_Amount

The amount of currency to trade.

100000.00

Lx_BuySell

The trade direction of the base currency from the perspective of the user on whose behalf the order submission is made. Valid values: BUY, SELL.

BUY

Lx_DealtCurrency

The currency that the amount is specified in

GBP

Lx_ExecutionType

How this order should be executed. Valid values: CALL-ORDER, TAKE-PROFIT, STOP-LOSS or MARKET

CALL-ORDER is only valid for single-legged strategies.

TAKE-PROFIT

Lx_FillRate

The rate at which this order should be filled.

1.50000

Lx_Margin

The sales margin (markup) to be applied to the Lx_FillRate value.

0.00001

Lx_Remarks

Comment field, specific to the trade leg.

Call John when filled

SubmitAck message [server > client]

This is the message the server sends in order to acknowledge that the Submit Message has been received by the back-end adapters.

Field Name Value Example

RequestID

Unique ID for this request. Generated by the client.

112314243333

MsgType

The transition that the server wants to make in the state model

SubmitAck

Accepting message [server > client]

This is the message the server sends to tell the client that the order has been received by the back-end trading system and is being processed.

Field Name Value Example

RequestID

Unique ID for this request. Generated by the client.

112314243333

MsgType

The transition that the server wants to make in the state model

Accepting

Accept message [server > client]

This is the message the server sends to tell the client that the order is now accepted by the back-end trading system.

Field Name Value Example

RequestID

Unique ID for this request. Generated by the client.

112314243333

MsgType

The transition that the server wants to make in the state model

Accepted

OrderID

A comma-separated list of the IDs assigned to the order’s legs by the order management system. Leg IDs are specified in leg order, beginning with leg 1.

5.1.30086

Reject message [server > client]

Error message [server > client]