Order Detail Messages

This section describes the set of subscriptions, messages and fields that allow you to succesfully request the details of an order, either into a ticket in order to clone an order, or into a confirmation ticket.

Architecture

For trade types with more just one leg, loading the confirmation ticket from the blotter utilises the blotter record for field values. This is not possible for multi-leg orders as each order is a separate row within the blotter, meaning that you might have a row out of view that is required to load a strategy. For this reason orders and strategy information are loaded from a subscription.

For the back-end adapters, the FXIntegrationAPI consumes the client subscription. The subscription request is handled by an Adapter that instantiates the FXOrdersAdapter object and registers an StrategyDetailsRequestListener (see the FX Integration API documentation for more information on Adapters). The FX Integration API provides a StrategyDetailsCallback which can be used to send the details of the strategy back to the client.

Liberator Subscription

The subscription from the front end should be:

/PRIVATE/ORDERDETAILS/<orderid>(/<suffix>)

The suffix after the order ID is optional.

Liberator mapping will be used to insert the username after the /PRIVATE token, as done for all of our private subjects (blotters, trade channels etc). This ensures that existing view permissions for patterns like "/PRIVATE/%u.*" will apply to the new subject. The username is essential because the adapter must check that the user is entitled to view the details for the requested order ID, otherwise any user with a connection to Liberator would be able to view details for any order in the system.

When the request arrives at the adapter it will look like:

/PRIVATE/<username>/ORDERDETAILS/<orderid>(/<suffix>)

The "small U mapping" (i.e %u rather than %U) is used so that Liberator only maps the username and not the username plus session ID. The config line to add to your rttpd.conf should look like this:

object-map      "/PRIVATE/ORDERDETAILS/%1"            "/PRIVATE/%u/ORDERDETAILS/%1"

The subscription will return information used for loading the strategy based on the order id. It’s likely that the back end will need to rebuild the structure by getting any child orders or parent order etc.

Subscription Update [s]

In this message, [s] denotes that the message is sent by the server. The FXOrderAdpater must update the message for the subscription described above, this update should contain the following fields.

Fields that are not prefixed with L1_, belong to the strategy.

For each leg on the strategy you will need to provide an additional set of LX_ prefixed fields - where 'X' is number of the leg, L1_ is used in the example below.

Trade fields
Field Name Value Example

CurrencyPair

The currency pair for all orders in this strategy

GBPUSD

StrategyType

The type of strategy that the user is editing

SINGLE, OCO, IF-DONE, IF-DONE-OCO

OrderCount

The number of orders in the strategy

3

Account

The account the strategy was submitted on, in the form "<description>|<ID>"

My Account|Acc1

ActivationDate

What date the strategy should be activated

GFA or a date in the form 20130606

(GFA=Good From Activation)

ActivationTime

What time the strategy should be activated if the ActivationDate was in the format of yyyymmdd

12:12:12

ActivationLocation

When location should be used to evaluate the time to activate if the ActivationDate was in

the format of yyyymmdd

Usually an entry in the tz database e.g "Europe/London" - see the "TZ" column on this page https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

ExpirationDate

What date the strategy should expire

GTC, GFD, 20130606

GTC=Good Till Cancelled

GFD=Good For Day (valid for the current trading day only).

ExpirationTime

What time the strategy should be activated if the ExpirationDate was in the format of yyyymmdd

12:12:12

ExpirationLocation

When location should be used to evaluate the time to expire if the ExpirationDate was in

the format of yyyymmdd

Usually an entry in the tz database e.g "Europe/London" - see the "TZ" column on this page https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

AlertType

The types of alerts that should be sent for this strategy

SMS, EMAIL (comma separated list, zero or more values)

SubmittedBy

Who the strategy was submitted by

sales1@mybank.com

SubmittedFor

Who the strategy was submitted for.

user1@mybnakcom

Trade leg fields
Field Name Value Example

L1_OrderID

The id of the order

L1_ParentID

The id of the parent order, if there is one

empty unless this is one of the OCO legs of an If-Done OCO, or the Done leg of an If-Done

L1_RelatedID

The id of the related order on the same level as this order

e.g. the other half of an OCO. Empty for single orders and the parent order in an If-Done OCO

L1_RelationshipType

The relationship type of L1_RelatedID

OCO, or empty if this is a single order

L1_Amount

The amount to trade

100000

L1_Filled

The amount filled so far

75000

L1_Remaining

The amount remaining

25000

L1_BenchmarkType

The type of benchmark to fix to, if this is a benchmark order

ECB, WMR

L1_BuySell

BUY or SELL

BUY, SELL

L1_DealtCurrency

The currency that the amount is specified in

GBP

L1_ExecutionType

How this order should be executed

CALL-ORDER, TAKE-PROFIT, STOP-LOSS, MARKET, BENCHMARK

L1_FillRate

The rate at which this order should be filled

1.1232, or empty if this is a market order

L1_Status

The current status of the order

deactivated

L1_Remarks

Comment/remarks by the client

Call Mike when filled

L1_AllowedActions

A containing comma separated list of zero, one or multiple values from this list Orders Solution Brief

A comma seperated list of actions, see Allowed Actions below

Allowed Actions

Each order item should send field AllowedActions containing comma separated list of zero, one or multiple values from this list:

Action Explanation

InactiveEdit

Edit action is NOT executable.

InactiveDeactivate

Deactivate button is visible but the action is NOT executable

InactiveCancel

Cancel button is visible but the action is NOT executable

InactiveActivate

Activate button is visible but the action is NOT executable

Edit

Edit action is executable

Deactivate

Deactivate button is visible and cancel action is executable

Cancel

Cancel button is visible and cancel action is executable

Activate

Activate button is visible and cancel action is executable

Example Update Message for Subscription of an If-Done Strategy

The table below gives an example of the fields that would be sent on the subscription of an If-Done Strategy

Trade Fields Leg 1 Fields (Parent Order) Leg 2 Fields (Child Order)

CurrencyPair=GBPUSD

StrategyType=IF-DONE

Account=GBP Acct 1|LDN_GBP_ACCT_1

ActivationDate=20130623

ActivationTime=17:00:00

ActivationLocation=Europe/London

ExpirationDate=20130624

ExpirationTime=17:00:00

ExpirationLocation=Europe/London

SubmittedBy=Trader1

SubmittedFor=Client1

AlertType=SMS,EMAIL

OrderCount=2

L1_OrderID=54678

L1_ParentID= #EMPTY

L1_RelatedID= #EMPTY

L1_Amount=10000

L1_Filled=0

L1_Remaining=10000

L1_BenchmarkType= #EMPTY

L1_BuySell=BUY

L1_DealtCurrency=GBP

L1_ExecutionType=TAKE-PROFIT

L1_FillRate=1.6500

L1_Status=Working

L1_Editable=true

L1_Remarks=Please call Mark when this fills

L1_AllowedActions=Activate,Edit

L2_OrderID=54679

L2_ParentID=54678

L2_RelatedID=

L2_Amount=10000

L2_Filled=0

L2_Remaining=10000

L2_BenchmarkType=

L2_BuySell=SELL

L2_DealtCurrency=GBP

L2_ExecutionType=TAKE-PROFIT

L2_FillRate=1.6300

L2_Status=Accepted

L2_Editable=true

L2_Remarks=Please call Mark when this fills

L2_AllowedActions=Cancel


See also: