For each algo that you wish to implement, you must create a file named ‘metadata.xml’ which defines the algo’s parameters and how they should be displayed in the TT user interface. This definition file must then be deployed to the TT environment so the TT user interface can find it.
This file must describe the algorithm, its parameters and its graphical layout using FIXatdl. The following is an introduction to a subset of the FIXatdl functionality most commonly used in TT Algo SDK algos. For complete details, see the official FIXatdl web site.
The metadata.xml file describes the algo with the following XML element hierarchy:
The TT Algo SDK software package includes the necessary FIXatdl schema files. They can be used to create a conforming FIXatdl document. The portions of the specification that are not supported by TT Algo SDK algos have been commented out.
Section: file header
The file header consists of the following:
<?xml version=”1.0″ encoding=”utf-8″?>
Section: algo name and description
The <Strategy> element’s xmlns attributes specify the basic information about the algo. In addition to the FixATDL namespaces and schema information, it includes algo-specific attributes.
The <Strategy> element must specify the following algo-specific attributes:
name: Short name of the algo as displayed in the list of algos that a user has permission to launch
uiRep: Full name of the algo as displayed in the algo’s parameter pane
version: Developer-defined version of the algo
providerID: ID of the firm providing the algorithm
entryFile: Name of the algo’s shared object (.so) file
Section: algo parameter descriptions
Each input and output parameter must be defined with a separate <Parameter> element. The following code snippet shows several sample <Parameter> elements:
The <Parameter> element requires the following attributes:
name: Name of the parameter
No two parameters of any strategy may have the same name. Names are case-sensitive and must begin with an alpha character followed only by alpha-numeric characters that must not contain whitespace characters. The value is not case-sensitive.
TT supports several special names which, when used, allow the user to launch the algo more quickly from MD Trader. These fields will be automatically populated with the corresponding values based on where the user clicks.
required: Whether the parameter is required. Valid values are “true” or “false”. The value is not case-sensitive.
initValue: Initial value for the parameter.
dir: Whether a parameter is an input (“In”), an output (“Out”), or both (“Both”). The value is not case-sensitive.
updateable: Whether the parameter can be updated after the algo is launched. Valid values are “true” or “false”. The value is not case-sensitive.
xsi:type: Data type corresponding to the parameter value:
Int_t: Integer value.
Float_t: Decimal value.
Qty_t: Value representing an instrument, fill or order quantity.
Price_t: Value representing an instrument, fill or order price.
PriceOffset_t: Value representing the number of ticks to offset a price.
Note: All of the above types support the following attributes:
minValue: Minimum value of the parameter accepted by the algorithm provider.
maxValue: Maximum value of the parameter accepted by the algorithm provider.
constValue: Value of a parameter that is constant and is not presented in the UI. This value must be sent on the wire by the order generating application.
String_t: String value. This type supports the following attributes:
minLength: Minimum allowable length of the string.
maxLength: Maximum allowable length of the string.
constValue: String value that is constant and is not presented in the UI. This value must be sent on the wire by the order-generating application.
Boolean_t: Boolean value. Valid values are “true” or “false”. The value is not case-sensitive.
UTCTimestamp_t: UTC timestamp.
In TT, instruments and accounts are uniquely identified by 64-bit integers. As FIXatdl does not define this data type, you must use the String_t type to pass 64-bit integers.
Each <Parameter> element can include optional <EnumPair> sub-elements to enumerate a list of valid values.
<Parameter name=”order_side_1″ required=”true” dir
<EnumPair enumID=”eBid” wireValue=”1″/>
<EnumPair enumID=”eAsk” wireValue=”2″/>
</Parameter>
The <EnumPair> element supports the following attributes:
enumID: List item identifier. No two list items may have the same name.
Names must begin with an alpha character followed only by alpha-numeric characters and must not contain whitespace characters.
wireValue: Corresponding index sent on the wire.
The following code snippet shows a sample <Parameter> element with some <EnumPair> elements:
Section: algo input parameters UI layout
You need to specify how each input parameter will be displayed. The most basic structure of the XML for specifying the layout of parameters uses the <lay:StrategyLayout> as follows:
<lay:StrategyLayout>
<lay:StrategyPanel orientation=”VERTICAL”>
<!–
Specify layout of input parameters here with <lay:Control> elements
. . .
–>
</lay:StrategyPanel>
</lay:StrategyLayout>
The layout of each input parameter must be defined with a separate <lay:Control> element.
Note that the instr_acct_ctrl_1 and order_price_ctrl_1 controls have their dependentParam attribute set to “instr_id_1”. As a result, the list of accounts displayed in the Account drop-down list will be filtered to show only those accounts that have permissions to trade this instrument. And when the user clicks the left or right mouse buttons while focus is on the Order Price single-spinner control, the price displayed will be decremented or incremented by one tick.
Notice the following about the sample:
The instr_acct_ctrl_1 and order_price_ctrl_1 controls have their dependentParam attribute set to “instr_id_1”. As a result, the list of accounts displayed in the Account drop-down list will be filtered to show only those accounts that have permissions to trade this instrument.
When the user clicks the left or right mouse buttons while focus is on the Order Price single-spinner control, the price displayed will be decremented or incremented by one tick.
The order_side_ctrl_1 element populates a drop-down list that ensures the user can choose only valid values (Bid or Ask).
As noted, this example shows basic functionality. See the FIXatdl schema files included in the TT Algo SDK package as well as the official FIXatdl web site for complete details.
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.