FlexTrade Trade Connector
Features
fix-flextradeConnector KeyNotes
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
XLMEand 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:
| Key | Value |
|---|---|
| 7000 | SPREAD |
| 7010 | Next Contract Symbol |
| 7020 | Next 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:
- Connector settings — default value applied to all instruments.
- Security Metadata Stream — overrides the connector setting for a specific instrument.
- 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:
| Tag | PartyId |
|---|---|
| 448 | Directed Broker |
| 1448 | ClientLEI |
| 2448 | ClientShortName |
| 3448 | ExecutionDecisionMaker |
| 4448 | InvestmentDecisionMaker |
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 Type | Symbol |
|---|---|
| FUTURE | ESU7 Index |
| FX | EUR/GBP |
| SPREAD | ESU7ESZ7 Index |
| OPTION | SPX US 12/21/18 P2600 Index |
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
executionPriceDelta | Minimum delta under wich price will be considered as 0. If avgPx/customPrice less than price delta it will be considered as 0. | |
normalizePrice | Normalization will be applied for Australian Bonds. | |
regExp | Regular Expression to match Australian Bond instruments. | |
onBehalfOfCompId | onBehalfOfCompId | |
directedBroker | Directed Broker | |
clientLei | Client's LEI | |
clientShortName | Client's Shortname | |
edm | Short name of Investment Decision Maker | |
idm | Short Name of Execution decision Maker | |
spreadFile | Absolute path to spread file |
Supported order attributes
| Key | Description |
|---|---|
| 1,6001 | Account. |
| 50 | SenderSubId. |
| 54,5054 | Side. |
| 58 | Text(58). |
| 63 | SettType. |
| 64 | Settlement Date. UNIX Epoch time in milliseconds. |
| 66 | ListID. |
| 67 | ListSeqNo. |
| 68 | TotNoOrders. |
| 77 | PossitionEffect. |
| 78 | NoAllocs. |
| 79 | AllocAccount. |
| 80 | AllocShares. |
| 100 | exchangeId. |
| 106 | Issuer. |
| 107 | SecDesc. |
| 115 | OnBehalfOfCompID. |
| 116 | OnBehalfOfSubID. |
| 143 | TargetLocationId. |
| 200 | MaturityMonthYear. UNIX Epoch time in milliseconds. |
| 202 | StrikePrice. |
| 206 | Option Attributes. |
| 207 | Security Exchange. |
| 461 | CFI Code. |
| 526 | SecondaryClOrdID. |
| 574 | MatchType. |
| 775 | BookingType. Client to specify if they are acting as a Systematic Internaliser, trading with UBS. Accepted Values: 9 = Trade Reporting (Systematic Internaliser) |
| 448 | Directed 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. |
| 1448 | Client's LEI. The id of the previously quoted data. Required when 40=D. |
| 2448 | Client'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. |
| 3448 | Execute Decision Maker. Short Name of Execution decision Maker . |
| 4448 | Investment 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>"
}
}
}