Skip to main content

FlexTrade Trade Connector

Features

fix-flextradeConnector Key
Instruments
FUTUREOPTIONSYNTHETICEQUITYFX
Request Types
SUBMITCANCELREPLACE
Order Types
MARKETLIMITSTOP_LIMITSTOP
Time In Force
DAYGTCIOCFOKGTD
Order ID Mapper
SEQUENCE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Fractional Sizes

FlexTrade truncates the fractional part of order size. Fractional quantities should not be used.

Normalize Price

For Australian Bonds, price normalization is applied using the formula below (tag 7070 is required for this instrument type):

protected double getContractPrice(double marketPrice) {
double yield = 100 - marketPrice;
double i = yield / 200;
double v = 1/(1 + i);
double n = 20;
double c = 3;
return (c*(1- Math.pow(v,n))/i + 100 * Math.pow(v,n));
}

Settlement Date

Order settlement date must be defined in the same time zone as the adapter schedule. Settlement Date can be specified via custom attributes or in strategy code. The connector config must include tag 64 in the customAttributesSet section:

customAttributesSet: "..64,..,6000-8999"

Forwards

  • Forex Forwards The connector supports FX Forwards. To mark an FX instrument as an FX Forward, set the order Settlement Date in the strategy: Example:
Order order = MakeNewOrder(message, message.symbol);
order.SettlementDate = new DateTime(2017,09,11);

TAS orders

To send a TAS order, specify tag 9001=TAS and tag 7005 with the TAS price.

  • LME Forwards The connector supports LME Forwards. To mark an instrument as an LME Forward, set the exchange to XLME and include a Settlement Date in the order (see Forex Forward example above).

Spread Algo

The connector supports Rolling Orders from strategies. To create a rolling order, submit the order with the current instrument and specify the next contract in custom attributes:

KeyValue
7000SPREAD
7010Next Contract Symbol
7020Next Order ID

Correct spread identification requires a Spread Specification file, which must be defined in the connector configuration. Code Example:

private const string SpreadAttrPropertyId = "7000";
private const string NextContractPropertyId = "7010";
private const string SpreadAttrValue = "SPREAD";

[Title("New Single Order Spread")]
public void NewSingleOrderSpread(SingleOrderMessage message)
{
Order order = MakeNewOrder(message, message.symbol);

order.SetCustomFieldValue(SpreadAttrPropertyId, SpreadAttrValue); // 7000=SPREAD
order.SetCustomFieldValue(NextContractPropertyId, message.nextcontract);

PortfolioExecutor.orderExecutor.SendOrder(order);
}

Party ID Blocks

FlexTrade supports Party ID Blocks. Values can be set from three sources, in increasing priority order:

  1. Connector settings — default value applied to all instruments.
  2. Security Metadata Stream — overrides the connector setting for a specific instrument.
  3. Order custom attributes — highest priority, overrides both of the above.

Values for settings:

directedBroker, clientLei, clientShortName, edm, idm

Values for smd:

directedBrokerKey, clientLeiKey, clientShortNameKey, investmentDecisionMakerKey, executionDecisionMakerKey

Tags for CustomAttributes:

TagPartyId
448Directed Broker
1448ClientLEI
2448ClientShortName
3448ExecutionDecisionMaker
4448InvestmentDecisionMaker

UAT Tags

For automated fills on futures in UAT, include the following tags in client orders:

  • Tag 1 – can take any value, e.g. 1=ABC
  • Tag 6128=GS
  • Tag 6666=1
  • Tag6166 – a unique basket ID for the basket of orders, e.g 6166=basket1, 6166=basket2 and so forth for each basket
  • Tag6167 – integer between 1 and n, where n is the size of the basket, which will index each order in the basket
  • Tag6168 – size of the basket

e.g for a basket of 3 orders: order1 – 6166=basket1, 6167=1, 6168=3 order2 – 6166=basket1, 6167=2, 6168=3 order3 – 6166=basket1, 6167=3, 6168=3

Symbology

Bloomberg Tickers. For Options, also specify: Underlying Symbol (RootTicker), Expiration Date, Strike Price, and Option Type.

Example:

Instrument TypeSymbol
FUTUREESU7 Index
FXEUR/GBP
SPREADESU7ESZ7 Index
OPTIONSPX US 12/21/18 P2600 Index

Configuration

Connector settings

ParameterDefault ValueDescription
executionPriceDeltaMinimum delta under wich price will be considered as 0. If avgPx/customPrice less than price delta it will be considered as 0.
normalizePriceNormalization will be applied for Australian Bonds.
regExpRegular Expression to match Australian Bond instruments.
onBehalfOfCompIdonBehalfOfCompId
directedBrokerDirected Broker
clientLeiClient's LEI
clientShortNameClient's Shortname
edmShort name of Investment Decision Maker
idmShort Name of Execution decision Maker
spreadFileAbsolute path to spread file

Supported order attributes

KeyDescription
1,6001Account.
50SenderSubId.
54,5054Side.
58Text(58).
63SettType.
64Settlement Date. UNIX Epoch time in milliseconds.
66ListID.
67ListSeqNo.
68TotNoOrders.
77PossitionEffect.
78NoAllocs.
79AllocAccount.
80AllocShares.
100exchangeId.
106Issuer.
107SecDesc.
115OnBehalfOfCompID.
116OnBehalfOfSubID.
143TargetLocationId.
200MaturityMonthYear. UNIX Epoch time in milliseconds.
202StrikePrice.
206Option Attributes.
207Security Exchange.
461CFI Code.
526SecondaryClOrdID.
574MatchType.
775BookingType. Client to specify if they are acting as a Systematic Internaliser, trading with UBS. Accepted Values: 9 = Trade Reporting (Systematic Internaliser)
448Directed Broker. Required and must have a value of ‘B’ when order is for a broken date. Otherwise must be a valid tenor code. If not specified, will default to tenor code SP.
1448Client's LEI. The id of the previously quoted data. Required when 40=D.
2448Client's Shortname. Value date is required when order is for a broken date and tag 63 = ‘B’. It is best practice to set this tag as certain providers will require it on certain transactions, and it needs to match the value provided on the quote from the provider. Not required for Limit/Market orders. Format is YYYYMMDD.
3448Execute Decision Maker. Short Name of Execution decision Maker .
4448Investment Decision Maker. Short name of Investment Decision Maker.

Config sample

connectors {
FLEXTRADE : ${template.connector.fix.flextrade} {
settings {
host = "<HOST>"
port = <PORT>

senderCompId="<SENDER_COMP_ID>"
targetCompId="<TARGET_COMP_ID>"
}
}
}