12.07.2015 Views

XTAPI RTD Server Feature Guide Version 7.7.9 - Trading ...

XTAPI RTD Server Feature Guide Version 7.7.9 - Trading ...

XTAPI RTD Server Feature Guide Version 7.7.9 - Trading ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>XTAPI</strong> <strong>RTD</strong> SERVERFEATURE GUIDEVERSION <strong>7.7.9</strong>DOCUMENT VERSION <strong>7.7.9</strong>.DV1 3/5/14


This document and all related computer programs, example programs, and all TT source code are the exclusiveproperty of <strong>Trading</strong> Technologies International, Inc. (“TT”), and are protected by licensing agreements,copyright law and international treaties. Unauthorized possession, reproduction, duplication, or disseminationof this document, or any portion of it, is illegal and may result in severe civil and criminal penalties.Unauthorized reproduction of any TT software or proprietary information may result in severe civil and criminalpenalties, and will be prosecuted to the maximum extent possible under the law.Information in this document is subject to change without notice. Companies, names, and data used in examplesherein are fictitious unless otherwise noted. No part of this document may be reproduced or transmitted in anyform or by any means, electronic or mechanical, for any purpose, without the express written permission of TT.All trademarks displayed in this document are subject to the trademark rights of TT, or are used under agreementby TT. These trademarks include, but are not limited to, service brand names, slogans and logos and emblemsincluding but not limited to: <strong>Trading</strong> Technologies®, the <strong>Trading</strong> Technologies Logo, TT, X_TRADER®,X_RISK®, MD Trader®, Autospreader®, X_STUDY®, TT_TRADER®, TT CVD®, ADL®, Autotrader, TT Trainer,Back Office Bridge, TTNET. All other referenced companies, individuals and trademarks retain their rights. Alltrademarks are the property of their respective owners. The unauthorized use of any trademark displayed in thisdocument is strictly prohibited.Copyright © 2011-2014 <strong>Trading</strong> Technologies International, Inc.All rights reserved.


Table of ContentsTable of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3Chapter 1: Introducing the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Network and software overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Excel notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Formatting <strong>XTAPI</strong> values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Chapter 2: Creating Instrument IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9About instruments and formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Defining an instrument equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Examples of using the X_TRADER <strong>RTD</strong> generator for additional types of contracts . . . . . . . . . . . 17Specifying additional instrument options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Chapter 3: Creating Order Set IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23About order sets and formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Defining an order set equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Creating order set filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Chapter 4: Requesting Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Requesting an attribute that returns a single value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Requesting an attribute that returns an array of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Requesting multiple attributes in a single equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Creating a global order book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Creating a global fill book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Appendix A: Instrument Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39TTInstrObj object attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Appendix B: Order Set Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59TTOrderSet object attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Appendix C: Order Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63TTOrderObj object attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Appendix D: Fill Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73TTFillObj object attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> 3<strong>Trading</strong> Technologies International, Inc.


1Introducing the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>Network and software overview<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>network<strong>XTAPI</strong> allows customers of <strong>Trading</strong> Technologies to leverage the functionality ofTT’s core network technology by building their own custom applications. Softwareapplications that use the <strong>XTAPI</strong> can access live prices from every Exchangesupported by TT, including:• Access live prices from every exchange supported by TT Gateways• Enter and modify orders• Receive order acknowledgements and fills• Calculate accurate P&LThe TT <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> also uses the <strong>XTAPI</strong> to allow traders to display live datain an Excel spreadsheet. However, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> does not supportentering or modifying orders.Software prerequisitesTo use the TT <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>, you must meet the following prerequisites:• An X_TRADER ® , X_TRADER ® Pro, or TT_Trader application must beinstalled on your workstation.• You must be able to access at least one TT Gateway with valid credentials.• Microsoft Excel 2002 or newer must be installed on your workstation. Thisguide uses Microsoft Excel 2007 for its examples.Additional resourcesTT provides the following resources to help you develop <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>applications:• Sample Excel spreadsheets, located in:\tt\x_trader\xtapi\samples• <strong>XTAPI</strong> <strong>RTD</strong> Tutorial, available from the TT DevNet website and the TTCustomer PortalX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 5<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Excel notes 1 Introducing the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>Excel notesAdjusting the Excelupdate throttling rateExcel automatically limits the rate at which it checks for updates. By default, itsets the throttling rate to 2000 milliseconds (2 seconds). In a fast-paced tradingenvironment, such an update rate could, and likely would, result in stale data. TTrecommends that you disable the default Excel throttling rate by setting its valueto 0. With this value, Excel continuously checks for updates, ensuring that youhave accurate and up-to-date values.TT provides a function called Set<strong>RTD</strong>UpdateRate() that allows you to change theExcel throttling rate from within a spreadsheet.Note: Changing the throttling rate with this function in any spreadsheet affects the defaultthrottling rate for the current and all future Excel sessions.To adjust the Excel throttling rate:1. In your spreadsheet, place the cursor in a cell A1.2. Enter the following formula to set the rate to 0 milliseconds, which disablesthrottling:Some common errormessagesThe following table lists common Excel or <strong>RTD</strong> error conditions you mightencounter.Displayed text#NAME?#N/AemptyDescriptionThe formula in the cell contains an error, such as an invalid propertyname or an improperly formatted formula.The cell contains an invalid reference, or your formula is incorrectlyformatted. For example: =<strong>RTD</strong>("xtapi.rtd",,A1,A2,A3,A5,"Last"),when A5 should be A4.For price data, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> lost its connection to the Price<strong>Server</strong>. Because the existing data would no longer be valid, <strong>XTAPI</strong> <strong>RTD</strong><strong>Server</strong> changes all prices to null strings and sets the Depth iterate to{}. An empty cell does not indicate a problem with a formula, just thatthe requested attribute has no value. For example, if there is noquantity exists on the Ask side, a request for AskQty$ returns an emptystring. You can verify values with X_TRADER when developingformulas.Stopping Excel frominterpreting your valuesBoth Excel and the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> allow you to use the values of cells informulas, which gives you the ability to create dynamic spreadsheets. However,this functionality can create problems if you allow Excel to interpret the cell valuesfor formatting purposes, which is Excel’s default behavior.6 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


1 Introducing the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> Excel notesIf you use default cell formatting in a spreadsheet, Excel automatically formatsthe data based on its value. For example, if you enter 15 into a cell with defaultformatting, Excel interprets and formats it as a number instead of a string. Whenrequesting certain types of information from the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>, you mustspecify the values with specific formats. The name of a contract, for example,might look like a date, such as Jun13 for the ES Jun13 contract on the TT CMEGateway. If you enter the string Jun13 in a cell with default formatting, Excelinterprets the text as a date and displays the value as 13-Jun, which would notmatch the name of the contract.Likewise, some of the optional arguments for instruments and order sets beginwith a plus sign (+). When Excel sees the plus sign, it assumes you intend toperform some calculation. If you enter something like +D in a cell that you use ina formula, Excel interprets it as an invalid calculation and displays #NAME? in thecell.To stop Excel from interpreting and formatting your data, you precede your textwith a single quote ('). The following demonstrates the effect of using the singlequote.Tip: You can also set the Excel cell format to Text to stop Excel from reformattingthe date.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 7<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Formatting <strong>XTAPI</strong> values 1 Introducing the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>Formatting <strong>XTAPI</strong> valuesSpecifying value formatsfor requested dataSome of the attributes allow you to specify the format for price and quantity data.The <strong>XTAPI</strong> provides certain prices and quantities in several formats. Whenspecifying an attribute that deals with prices or quantities, you can append aspecial character to the end of the attribute name to specify the format for thedata. For example, price data can be represented in ticks or points.The following table describes the different formats you can use.Value type Character DescriptionPrice & Ticks (integer)# Points (decimal)$ X_TRADER ® display format (string)~ Differential for inverted tick products (string). Used for tradingBrokerTec yield products, because the “$” format cannotdifferentiate between an actual price (LTP) or a price delta (netchange)..^ Native currency (decimal)@Primary currency (decimal)Quantity & Number (integer)# Number (decimal)$ Number (string)Note: Some market data, such as implied prices, might not always be available when yourequest it. In such cases, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns a null value instead of the normaldata type. TT recommends that your application checks for null values before using anattribute value.Some examplesThe following table illustrates how you can use the attribute modifiers to formatthe return values.Specifying...PricePrice#Limit.^BidQtyAskQty$Returns...Current price in the X_TRADER display formatCurrent price represented as pointsLimit price represented in the native currency, as defined in theGuardian Price TableNumber of bid offers at a price, expressed as an integerNumber of ask offers at a price, converted to a string valueTip: When using different values in combination, such as performing calculations, youshould use the format modifiers to normalize the data.8 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2Creating Instrument IDsAbout instruments and formulas<strong>XTAPI</strong> instrumentobjectsThe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> works in conjunction with the X_TRADER API (<strong>XTAPI</strong>) toaccess information about instruments from TT Gateways. The <strong>XTAPI</strong> storesinformation about instruments in its TTInstrObj objects, which you can accessthrough Excel <strong>RTD</strong>() instrument formulas.<strong>RTD</strong>() formulas forinstrumentsWhen requesting updates for instrument-related information from the <strong>XTAPI</strong> <strong>RTD</strong><strong>Server</strong>, you typically call the <strong>RTD</strong>() function in one of the following forms.To...Return an Instrument IDRequest an attributevalue using contractqualifiersRequest a singleinstrument attributevalue using anInstrument IDRequest multiple valuesfor an Instrument IDUse the following formula=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,Topic,Exchange,Product,ProductType,Contract,InstrumentOptions)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,Topic,Exchange,Product,ProductType,Contract,InstrumentOptions,AttributeName)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,InstrumentID,AttributeName)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,InstrumentID,AttributeName,AttributeName,AttributeName,DataDisplayOptions)The remainder of this chapter shows how to use these different types of formulasto create instrument IDs and retrieve basic instrument data.Parameters forinstrument <strong>RTD</strong>()formulasThe following table describes these formula parameters.Parameter<strong>Server</strong>ID<strong>Server</strong>NameTopicExchangeProductProductTypeDescriptionProgram ID of the local <strong>RTD</strong> <strong>Server</strong>.For the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>; you must use the value, "xtapi.rtd"Name of the external server running the <strong>RTD</strong> Sever.As the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> always runs locally, you must omit avalue for this parameter or supply an empty string (“”).However, you must account for the parameter in the formula, asshown:Valid: <strong>RTD</strong>(“xtapi.rtd”,””,”Instr”...)Valid: <strong>RTD</strong>(“xtapi.rtd”,,”Instr”...)Invalid: <strong>RTD</strong>(“xtapi.rtd”,”Instr”...)Type of object to query. When querying instruments, use Instr.TT Gateway name, including the flavor, such as CME or CME-A.Product symbol, such as ES.Product type, as it appears in an X_TRADER Market Explorerwindow, such as FUTURE.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 9<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


About instruments and formulas 2 Creating Instrument IDsParameterContractInstrumentOptionsInstrumentIDDescriptionContract name, as it appears in the X_TRADER Market Grid.Options that provide access to additional information related toan instrument. Possible values include:"+D": Provides access to market depth updates for aninstrument."+DD": Provides access to detailed depth updates for aninstrument, if the market supports detailed depth. Formore information, refer to the section called More AboutDetailed Depth."+OS": Provides access to instrument updates contained inan order set (such as orders, positions, and P&L)."+OS.LIFO" or "+OS.FIFO": Specifies which algorithm touse when you request average price updates for aninstrument."+OS.Attribute=Value" or "+OS.AttributeValue":Allows you to filter instruments based on attribute valuesfor the order set containing the instrument."+OS.FILLS": Provide access to fill updates associated withthe instrument."+OS.FILLS": Provide access to fill updates associated withthe instrument."+TS=Value": Provides access to the specified number ofTime and Sales updates that involve this instrument(range=1-500; default=100). Each update includes thefollowing fields: Time, Quantity, Price, Market Side, OTC,and, optionally, the Bid Member and Bid Ask counterpartymember fields. When using this option, you must specifyTIMEANDSALES for the AttributeName in the formula.For X_TRADER 7.11.3 and earlier, the <strong>RTD</strong> returns integervalues for the Bid Member and Bid Ask fields. In X_TRADER7.11.4 and later, you can choose to return these fields asintegers, as the full name of the counterparty, or as thealias defined for the counterparty in X_TRADER."-M": Disables merging of implied prices and quantities withthe direct prices and quantities when requesting updatesfor the Bid, Ask, BidQty, and AskQty attributes. By default,the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> merges implied and direct values."-I": Disables using the TT Implieds Engine to calculateimplied prices and quantities. By default, the <strong>XTAPI</strong> <strong>RTD</strong><strong>Server</strong> uses the TT Implieds Engine to calculate impliedvalues.Note: The +DD (detailed depth) and +TS (time and sales)options are available only in XTAPTI <strong>RTD</strong> 7.7.7 or later.Additionally:• You cannot use the Instrument keys returned by formulasusing these options as Instrument key inputs to VBAobjects.• You cannot access the data directly through the <strong>XTAPI</strong>; toaccess it, you must use <strong>RTD</strong>.Unique internal TT instrument identifier returned from another<strong>RTD</strong>() formula that specifies the contract qualifiers.Note: The <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> generates this number each timeit loads the spreadsheet. Consequently, do not store and reusethis ID for later use.10 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs About instruments and formulasParameterAttributeNameDataDisplayOptionsDescriptionName of any instrument attribute returned by the TTInstrObjGet property.For a comprehensive list of possible attribute values, refer toAppendix A, Instrument Attributes or to the TTInstrObjProperty: Get section in the <strong>XTAPI</strong> Class Reference.Optional cell addresses to use for displaying array data. The<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> supports Excel-style cell address, such as:“A1”,”B1”,”C1”CELL(“Address”,A1)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 11<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


About instruments and formulas 2 Creating Instrument IDsMore About DetailedDepthNote: Detailed depth is supported only for <strong>XTAPI</strong> <strong>RTD</strong> 7.7.7 or later.You can access detailed depth for an instrument through <strong>RTD</strong>, but not through the<strong>XTAPI</strong>. You can enable either market depth (+D) or detailed depth (+DD) for aninstrument reference, but not both.When you specify detailed depth for an instrument that supports it, <strong>RTD</strong> returnsvalues for the following Instrument attributes. Each row returned represents adistinct order resting in the market. For descriptions of these Instrumentattributes, refer to Appendix A, Instrument Attributes.• AskDepth(levels)• AskDepth90(levels)• BidDepth(levels)• BidDepth90(levels)• PriceDepth(levels)• PriceDepth90(levels)• XTDepth(levels)• XTDepth90(levels)If you request detailed depth for an instrument that does not support it, <strong>RTD</strong>returns blank values for all cells referencing detailed depth fields. <strong>RTD</strong> does notsupport detailed depth for implied, indicative, or theoretical prices.12 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs Defining an instrument equationDefining an instrument equationCalling the <strong>RTD</strong>() formulaTo define an instrument equation, use the following Excel <strong>RTD</strong>() formula syntax:=<strong>RTD</strong>("xtapi.rtd",,"Instr", Exchange, Product, ProductType, Contract,AdditionalInstrParams)Specifying theinstrument identifiersand an attribute in asingle equationIf you know the instrument identifiers for a contract, you can enter them directlyin the <strong>RTD</strong>() formula and specify which instrument attribute you want to retrieve.For example, suppose you want to know the last price for the ES Dec13 futuretrading on the TT CME Gateway. You could enter the following formula in a cell, asfollows.=<strong>RTD</strong>("xtapi.rtd","","Instr","CME","ES","FUTURE","Dec13","Last")After you enter the formula, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> retrieves the value of theinstrument’s Last attribute and displays its value in the cell (B3, in this example).You can enter multiple formulas in multiple cells to get a broader picture of themarket. For example, you could display additional information about the contractin adjacent cells. The following adds the quantity traded at the last price and thetotal traded volume for the contract for the trading day.Generating an formulafrom X_TRADERIf you are unsure of the instrument identifiers or the name of the instrument youwant, you can use the <strong>RTD</strong> Generator within X_TRADER to create the formula youneed to enter in a cell. The following example illustrates the <strong>RTD</strong> formula itgenerates for the VOLUME property of the CME ES Dec09 contract.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 13<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Defining an instrument equation 2 Creating Instrument IDsYou can access the <strong>RTD</strong> Generator from the context menu of any contract shownin the Market Grid, then copy the formula and paste it into a cell in yourspreadsheet.For more information about using the X_TRADER <strong>RTD</strong> Generator, refer to theX_TRADER help system.Referencing instrumentidentifiers stored in othercellsIncluding an attribute in the formula provides the desired results, but does notprovide any flexibility. Because you specify all information in every formula, youmust update every formula if you want to monitor a different contract or addadditional parameters, such as requesting Market Depth or Fill information. Tocreate a spreadsheet that you can update dynamically, you can leverage Excel’ssupport for referencing the values from other cells in a formula. Instead ofspecifying the actual value in the <strong>RTD</strong>() formula, you can specify other celladdresses.The following example shows one way you could enter the instrument identifiersin individual cells. Cell B7 contains the Last price of the whatever contract isdefined in cells B2 through B5.14 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs Defining an instrument equationIf you want to check another contract, you need only enter new values in any ofthese cells. The Last price automatically updates, without needing to create anew formula. For example, if you want to check the information for the Mar14contract, you would just change the value in cell B5, as shown.Notes:The values you specify must exactly match those used in X_TRADER.When entering Mar14 in a cell, Excel interprets it as a date and displays it to 10-Mar,which does not match the name of the contract. To prevent Excel from interpretingthe value, you can either:Precede the string with a single quote, as in 'Mar14.Change the format of the cell to type Text.If you mis-type a value, Excel displays #N/A to indicate your formula contains an error.Storing and reusing aninstrument IDYou can make your spreadsheet even more flexible by storing and reusing the ID’sthat the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns for each contract. If you omit the attributefrom the <strong>RTD</strong>() formula, as follows, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns a unique ID forthe instrument.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 15<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Defining an instrument equation 2 Creating Instrument IDsWhen you have an instrument ID, you can use a simplified form of the <strong>RTD</strong>()formula, where you reference the cell containing the ID:=<strong>RTD</strong>("xtapi.rtd","",B7,"Last")16 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs Examples of using the X_TRADER <strong>RTD</strong> generator for additional types of contractsExamples of using the X_TRADER <strong>RTD</strong> generator for additional types of contractsSpecifying a spreadcontractThe following example shows how to specify a spread contract used by theinstrument ID generation formula, specifically the 6E-Sep09/Jun09 calendarspread on the TT CME Gateway.Unlike the names used for futures contracts, spread contracts typically uselengthy names with special syntax. Because contract names must exactly matchthe name used by X_TRADER (including spaces and special characters), you cantake advantage of the X_TRADER <strong>RTD</strong> generator to get the correct contract name.You can generate a formula for the instrument and a property, and copy the stringshown for the contract name. Then you can simply paste the name into theappropriate cell in the spreadsheet.Specifying a strategycontractThe following example shows how you can use the <strong>RTD</strong> generator to get thevalues to use for the instrument identifier fields in your spreadsheet. in this case,you use the values generated for a Sterling (L) strategy contract trading on the TTLIFFE Gateway to populate the corresponding cells in your spreadsheet.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 17<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Examples of using the X_TRADER <strong>RTD</strong> generator for additional types of contracts 2 Creating Instrument IDs18 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs Specifying additional instrument optionsSpecifying additional instrument optionsAvailable optionsWhen you create instrument ID formulas, you can specify the following options toprovide a broader view of the market for an instrument:• +D, which provides access to market depth information for an instrument• +OS, which allows you to retrieve information about orders associatedwith an instrumentMarket depthThe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> does not access market depth unless you specificallyrequest it. To enable market depth access, you include the +D instrument optionin the <strong>RTD</strong>() formula, as follows:=<strong>RTD</strong>("xtapi.rtd",,"Instr","CME","6E","FUTURE","Sep13","+D")You can also expand the spreadsheet to allow you enable market depth, asfollows:Notes:When entering +D in a cell, Excel interprets it as a mathematical expression instead ofa string. To prevent Excel from interpreting the value, you can:Precede the string with a single quote, as in '+D.Change the format of the cell to type Text.If you do not override the default formatting, Excel displays #NAME? because the valueis not valid for an instrument option.When you enable market depth for an instrument, you can access additionalinformation about an instrument, such as the Bid and Ask quantities at differentprice levels. With market depth enabled, you can create a grid that displays theinformation similar to the following. This example uses the PriceDepth attribute toreturn an array of data for five levels of depth on each side of the market.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 19<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Specifying additional instrument options 2 Creating Instrument IDsFor more information about retrieving array data, refer to Requesting an attributethat returns an array of values, on page 32 or to the <strong>XTAPI</strong> <strong>RTD</strong> Tutorial.Accessing order-relatedinformation for aninstrumentSome instrument data, such as net position or P&L, is valid only when aninstrument is part of a working order. To access this type of information, the<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> needs to access the orders that reference an instrument. Usingthe +OS option when you create an instrument ID, as follows, allows you toretrieve information from order sets.=<strong>RTD</strong>("xtapi.rtd",,"Instr","CME","6E","FUTURE","Sep13","+OS")When you enable order set access, you can use the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> to get abroader picture of the instrument in the market, and you can access informationabout working orders and fills. The following example shows some of additionalinformation you can access when you use the +OS option.20 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


2 Creating Instrument IDs Specifying additional instrument optionsFor a list of values you can retrieve from an order set, refer to Appendix B, OrderSet Attributes, on page 59. Also, Chapter 4, Requesting Values provides moreinformation and examples for requesting information from order sets.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 21<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Specifying additional instrument options 2 Creating Instrument IDs22 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


3Creating Order Set IDsAbout order sets and formulas<strong>XTAPI</strong> order set objectsThe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> accesses information about order sets through the <strong>XTAPI</strong>TTOrderSet objects, which you can access through Excel <strong>RTD</strong>() order setformulas.<strong>RTD</strong>() formulas for ordersetsWhen requesting updates for order set information from the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>,you typically call the <strong>RTD</strong>() function in one of the following forms.To...Return an Order Set IDRequest an attributevalue using order setoptionsRequest a singleinstrument attributevalue using anInstrument IDRequest multiple valuesfor an OrderSet IDUse the following formula=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,Topic,OrderSetOptions)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,Topic,OrderSetOptions,AttributeName,DataDisplayOptions)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,OrderSetID,AttributeName)=<strong>RTD</strong>(<strong>Server</strong>ID,<strong>Server</strong>Name,OrderSetID,AttributeName,AttributeName,AttributeName,...,DataDisplayOptions)The remainder of this chapter shows how to use these different types of formulasto create order set IDs and retrieve basic data from the order set.Parameters for order set<strong>RTD</strong>() formulasThe following table describes these function parameters.Parameter<strong>Server</strong>ID<strong>Server</strong>NameTopicOrderSetOptionsOrderSetIDDescriptionProgram ID of the local <strong>RTD</strong> <strong>Server</strong>.For the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>; you must use the value, "xtapi.rtd"Name of the external server running the <strong>RTD</strong> Sever.As the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> always runs locally, you should omitthis parameter or supply and empty string (“”).Type of object to query. When querying order sets, use OS.Optional parameters, including:+OS.Attribute=Value and +OS.AttributeValue, whichallow you to create filters based on order attributes.For more information about using these filters, refer toCreating order set filters, on page 27."+OS.Fills, which causes the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> to retain fillrecords.Unique internal TT order set identifier returned from another<strong>RTD</strong>() formula that defines an order set.Note: The <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> generates this number each timeit loads the spreadsheet. Consequently, do not store and reusethis ID for later use.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 23<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


About order sets and formulas 3 Creating Order Set IDsParameterAttributeNameDataDisplayOptionsDescriptionName of any order set attribute returned by the TTOrderSetGet property.For a comprehensive list of possible attribute values, refer toAppendix B, Order Set Attributes or to the TTOrderSet Getsection in the <strong>XTAPI</strong> Class Reference.Optional cell addresses to use for displaying array data. The<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> supports Excel-style cell address, such as:“A1”,”B1”,”C1”CELL(“Address”,A1)24 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


3 Creating Order Set IDs Defining an order set equationDefining an order set equationIdentifying an order setWhen requesting information from order sets, you identify an order set as shownin the <strong>RTD</strong>() function call:=<strong>RTD</strong>("xtapi.rtd",,"OS",OrderSetOptions)For example, if you want to generate an order set ID that can access allinformation in the order set, you would specify the formula as follows.=<strong>RTD</strong>("xtapi.rtd",,"OS")Storing an order set IDWhen you use an <strong>RTD</strong>() formula that contains only an OS topic and order setoptions, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> generates a unique ID for the order set and returnsit as a result in the cell. The following illustration shows how to return an order setID that contains all information in the order set.Cell B3 now contains an ID that uniquely identifies the order set. You can use thisvalue in place of all the contract qualifiers in other formulas, as described later.Note: The <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> generates this ID each time it opens the spreadsheet andensures that it uniquely identifies the order set through the current session. However, itdoes not ensure that the actual identifier remains the same each time you open thespreadsheet. Consequently, you should not use the ID directly in formulas; but you canreference the cell that contains the ID.Accessing order set datathrough the <strong>XTAPI</strong>TTOrderSet objectAfter you define an order set, you can specify order set attribute names asparameters in the <strong>RTD</strong>() formula, using either of the following methods:=<strong>RTD</strong>("xtapi.rtd",,"OS",OrderSetOptions,AttributeName)=<strong>RTD</strong>("xtapi.rtd",,OrderSetID,AttributeName)For example, if you want to determine the net position for an order set, you wouldspecify the function parameters as follows. For the second case, assume cell B3contains the Order Set ID.=<strong>RTD</strong>("xtapi.rtd",,"OS","NetPos")=<strong>RTD</strong>("xtapi.rtd",,B3,"NetPos")X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 25<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Defining an order set equation 3 Creating Order Set IDsRetrieving data for thewhole order setWhen an order set formula contains no options or filters, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>automatically defines an order set that contains all orders visible to the currenttrader login. The following example returns the order set attributes specified incolumns A5-A9, calculated for all visible orders.26 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


3 Creating Order Set IDs Creating order set filtersCreating order set filtersCreating filters based onorder attributesThe OrderSetOptions parameter enables you to filter information within an orderset, based on the values of order attributes. When a trader places an order for aninstrument, the <strong>XTAPI</strong> uses an order set as the mechanism for submitting theorder to the Exchange. Because an order set can contain many instruments ormany orders involving the same instrument, you can use attributes of the order tolimit the instruments for which the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns values. For example,you might want the last price (Last instrument attribute) of an instrument only if itwas submitted through a specific account (Acct order attribute).Combining multiplefiltersWhen you use multiple name/value pairs in a formula, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>applies Boolean logic to the values based on whether you specify the same ordifferent attributes and whether you test for equalities or inequalities. Thefollowing table explains how the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> determines which logic to usewhen finding matching records.Attributes Operators Logic ExamplesSame All = Boolean OR "'+OS.Acct=JDOE","'+OS.Acct=BSMITH"Returns records for both JDOE and BSMITHaccountsSame All Boolean AND "'+OS.AcctJDOE","'+OS.AcctBSMITH"Returns records for all accounts except JDOEand BSMITHSame Mixed Boolean AND "'+OS.Acct=JDOE","'+OS.AcctBSMITH"Returns records for both JDOEDifferent All = Boolean AND "'+OS.Acct=JDOE","'+OS.ClrMemberABC"Returns records for both JDOEDifferent All Boolean OR "'+OS.AcctJDOE","'+OS.ClrMemberABC"Returns records for all accounts except JDOEand all clearing members except ABCDifferent Mixed Boolean OR "'+OS.AcctJDOE","'+OS.ClrMember=ABC"Returns records for all accounts except JDOEand all records with clearing member ABCX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 27<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Creating order set filters 3 Creating Order Set IDsRequesting data for afiltered order setYou can use order set filters to create smaller, more focused order sets. Forexample, you could define an order set that contains orders only for a specificaccount or a single contract. As a reminder, you can use any of the TTOrderObjattributes listed in Appendix C, Order Attributes in the OS Filter field.The following example shows the same data, but limits it only to the orderssubmitted with the Acct attribute set to 123. The order set ID formula (cell B3) inthis spreadsheet uses the values in cells B1 and B2, if specified, when definingthe order set.28 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


4Requesting ValuesOverviewTypes of data you canrequestThe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> allows you to request values from the <strong>XTAPI</strong> by accessingattributes associated with certain objects. You can get values for the following:• Instrument information through the <strong>XTAPI</strong> TTInstrObj attributes• Order set information through the <strong>XTAPI</strong> TTOrderSet attributes• Order information through the <strong>XTAPI</strong> TTOrderObj attributes• Fill information through the <strong>XTAPI</strong> TTFillObj attributesWays to request valuesWhen you request information from the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>, you need to take intoaccount not only the object, but also the type of data you want. This chaptershows you how to access different types of information in the following ways:• Requesting an attribute that returns a single value• Requesting an attribute that returns an array of values• Requesting multiple attributes in a single equation• Creating a global order book• Creating a global fill bookX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 29<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Requesting an attribute that returns a single value 4 Requesting ValuesRequesting an attribute that returns a single valueRequesting aninstrument’s bid priceThe following example shows how to request the Bid price for the ES Sep13contract from the TT CME Gateway. The formula for cell E2 uses the text enteredin cell D2 to specify the data to retrieve (the Bid attribute, in this example).Note: Because this example does not use the +D or +OS options when generating theInstrument ID, it can request only inside market updates.For a complete list of instrument attributes you can request, refer to Appendix A,Instrument Attributes.Requesting the netposition for aninstrumentThe following example shows how to request the net position for the ES Sep13contract on the TT CME Gateway. Because the net position for an instrumentrequires access to working orders, the Instrument ID formula must include the+OS option so the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> can access information contained in ordersets.In this example, the formula in cell B8 used the following formula to include the+OS option specified in cell B6.=<strong>RTD</strong>("xtapi.rtd",,"Instr",B2,B3,B4,B5,B6)Requesting filtered P&LWhen you enable the +OS option, you gain access to attributes of working ordersin the order set. You can use the order attributes to define filters that limit whichorders from which the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> retrieves values.The following example displays the net position and P&L for the ES Sep09contracting trading on the TT CME-A Gateway for only those orders submittedthrough the gs003003 account. The PL.^ attribute displays the P&L, calculatedwith the last traded price (Last attribute), in the native currency.30 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


4 Requesting Values Requesting an attribute that returns a single valueTip: You can specify multiple optional arguments to create more detailed filters.For a list of order attributes you can use as filters, refer to Appendix C, OrderAttributes.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 31<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Requesting an attribute that returns an array of values 4 Requesting ValuesRequesting an attribute that returns an array of valuesHow Excel handles arraydataThe <strong>RTD</strong>() function call you use to request market depth looks much like the oneyou use to request single values, except that in addition to the instrumentattribute, you specify a place in memory to store the data. The following exampleshows how to request five levels of market depth and store it in an in-memoryarray:=<strong>RTD</strong>(“xtapi.rtd”,,$C$8,”PriceDepth(5)”,CELL(“Address”,A1))You determine the amount of data to request from the <strong>XTAPI</strong> by the number youspecify for the PriceDepth attribute. In this example, you specify PriceDepth(5);then the X_TRADER API <strong>RTD</strong> <strong>Server</strong> returns five levels of depth on each side ofthe market, where column A contains the prices, column B contains the Bidquantities, and column C contains the Ask quantities.By specifying the CELL(“Address”,A1) parameter in the formula, you instructExcel to use cell A1 of the hidden spreadsheet as the starting location for thedata. When it receives the data, Excel populates the hidden cells just like pastingan array of values into a regular spreadsheet, where each value occupies its owncell. You can think of the returned data as a three-column, ten-row spreadsheetand can reference the different values just like you would in a regularspreadsheet. For example, if you specify CELL(“Address”,C2), Excel returns thevalue in the third column of the second row (in this case, the number of Asks fourticks away from the inside market, or 90575).Requesting market depthfor an instrumentThe following example shows how to request five levels of market depth for ESSep09 contract from the TT CME Gateway. Because the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong>retrieves only inside market data by default, you must use the +D option toenable market depth access. The example uses the PriceDepth attribute to requestfive levels of depth.32 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


4 Requesting Values Requesting an attribute that returns an array of valuesThe BidQty and AskQty columns both contain empty cells because the Ask sideof the market contains no bid offers and the Bid side of the market contains noask offers.Note: If you do not specify the number of levels, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns five levelsof depth on each side of the market.Identifying attributes thatreturn array dataYou can identify the attributes that return arrays of data by checking their datatype information. For example, by looking at the Data Type column for theinstrument attributes in Appendix A, Instrument Attributes, you can see that thefollowing attributes return array values:• AskDepth• AskDepth90• BidDepth• BidDepth90• IAskDepth• IAskDepth90• IBidDepth• IBidDepth90• IPriceDepth• IPriceDepth90• IXTDepth• IXTDepth90• PriceDepth• PriceDepth90• XTDepth• XTDepth90You can use the same approach to determine the fill, order, and order setattributes that return arrays of values. For lists of attributes, refer to theappropriate appendixes.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 33<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Requesting multiple attributes in a single equation 4 Requesting ValuesRequesting multiple attributes in a single equationAbout arrays withmultiple valuesSome attributes, such as OS.Orders and OS.Fills for instruments, return variablesizedarrays. You can specify the number to retrieve (rows) and any number ofcorresponding attributes (columns). For example, you could request threeattributes for 10 orders, eight attributes for 15 fills, and so on.Requesting an orderbook update for aninstrumentThe following example requests updates for three attributes (BuySell, Qty, andPrice) for the last five orders submitted for the ES Dec13 contract trading on TTCME Gateway. The OS.Orders attribute returns an array of values retrieved from anorder object. You can specify any number of order attributes. In this example, the<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns a 5x3 array.Note: To access information from working orders, you must use the +OS option (cell B6)when generating the instrument ID.When using the OS.Orders attribute, you can use the following expressions tospecify how many orders to request:• OS.Orders(n) to return the first n orders• OS.Orders(first*n) to return the first n orders• OS.Orders(last*n) to return the last n orders• OS.Orders(n:m) to return orders n through m, inclusiveFor a complete list of all order attributes you can request through the OS.Ordersattribute, refer to Appendix C, Order Attributes.Requesting fill updatesfor an instrumentThe following example requests updates for four attributes (BuySell, Qty, Price, andFillType) for the last five fills received for the ES Dec13 contract trading on TT CMEGateway. The OS.Fills attribute returns an array of values retrieved from an orderobject. You can specify any number of order attributes. In this example, the <strong>XTAPI</strong><strong>RTD</strong> <strong>Server</strong> returns a 5x4 array.34 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


4 Requesting Values Requesting multiple attributes in a single equationNote: To access information from fills, you must use the +OS.FILLS option (cell B6) whengenerating the instrument ID.When using the OS.Fills attribute, you can use the following expressions to specifyhow many fills to request:• OS.Fills(n) to return the first n fills• OS.Fills(first*n) to return the first n fills• OS.Fills(last*n) to return the last n fills• OS.Fills(n:m) to return fills n through m, inclusiveFor a complete list of fill attributes you can request through the OS.Fills attribute,refer to Appendix D, Fill Attributes.Recommendations whenspecifying array sizesWhen you specify the number of rows for the array in the formula, TTrecommends that you specify a number slightly larger than the number of rowsyou expect to return. If you do not specify a value for the number of array rows,Excel retrieves the data and updates only enough rows to contain the data itreceived. However, when you specify a number of rows, Excel inserts emptystrings into the rows not filled by the data. Allowing Excel to determine thenumber of rows to update dynamically can leave expired orders still displayed inthe spreadsheet.In the previous example, suppose you specified Orders() instead of Orders(5)in the formula. The first update fills the spreadsheet as shown, with five rows ofdata. Suppose on the next update that the order in row four had been filled, sothe <strong>RTD</strong> server sent updates only for the first three orders. Because you did notspecify a number of rows to fill, Excel updates the array with the only the newdata. As a result, the fourth and fifth rows would still contain the data for ordersthat are no longer valid, and you would incorrectly think that the orders are stillvalid. If you had specified a number of rows, five in this example, Excel wouldhave updated the first three rows with the new data, and then filled the remainingtwo rows with empty strings. The filled orders would not still appear in thespreadsheet.X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 35<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Creating a global order book 4 Requesting ValuesCreating a global order bookAbout order objectattributesThe Orders attribute retrieves order information through an order set ID, in thesame way that the OS.Orders attribute returns order information through aninstrument ID. From an order set, the Orders attribute requests information fromall visible orders, not just those orders associated with some instrument.For a complete list of order attributes you can request, refer to Appendix C, OrderAttributes.Sample order bookThe following example requests updates for several order attributes for the firstten working orders visible in the order set.Filtering the order bookby TT GatewayBy default, the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> requests information from all orders visible inthe order set. You might want to limit the results to some particular subset ofvisible orders. If you specify an order set filter when generating the order set ID,the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> returns data only for those orders which match the filtercriteria.The following example uses a filter option (cell B2) to limit the query to orders nottrading on the TT MX Gateway. It requests the last ten orders. However, as theorder set does not contain ten orders that match the filter criteria, the <strong>XTAPI</strong> <strong>RTD</strong><strong>Server</strong> returns the six orders that match and fills the remaining four rows withempty strings.36 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


4 Requesting Values Creating a global order bookX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 37<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Creating a global fill book 4 Requesting ValuesCreating a global fill bookAbout fill objectattributesThe Fills attribute retrieves fill information through an order set ID, in the sameway that the OS.Fills attribute returns fill information through an instrument ID.From an order set, the Fills attribute requests information from all fills in the orderset, not just those fills associated with a particular instrument.For a complete list of fill attributes you can request, refer to Appendix D, FillAttributes.Sample fill bookThe following example requests information about the last ten fills. To use the Fillsattribute, you must include the +OS.Fills option (cell B2) when generating theorder set ID.38 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


AInstrument AttributesTTInstrObj object attributesAbout the TTInstrObjobjectThe <strong>XTAPI</strong> stores information about instruments in the TTInstrObj object. Whenthe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> requests information about an instrument, the <strong>XTAPI</strong> looksfor the attributes defined for the object. You can request values for any of theTTInstrObj object attributes.Available attributesYou can access information about an instrument with the following <strong>XTAPI</strong>TTInstrObj attributes.Attribute Description DataTypeAsk (~Ask)Ask$ (~Ask$)Ask# (~Ask#)Ask& (~Ask&)AskDepth(levels)AskDepth#(levels)AskDepth&(levels)AskDepth90(levels)AskDepth90#(levels)AskDepth90&(levels)AskMktQty (~Ask)AskMktQty$ (~Ask$)AskMktQty# (~Ask#)AskMktQty& (~Ask&)AskOrderIdBest ask price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Note: When the MergeImpliedsIntoDirects property isenabled, the Ask price contains the better of the direct andimplied prices.Two-dimensional array of prices and the quantity associatedwith each price (each row is price, quantity) for the specifiednumber of depth levels.Column-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each column contains a price and a quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Market order quantity during the pre-open phase, as aninteger.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Order ID for the best ask.(Currently supported only for BrokerTec)AsspecifiedArray ofspecifieddata typesArray ofspecifieddata typesAsspecifiedStringTable 1. TTInstrObj Get property attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 39<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeAskQty (~AskQty)AskQty$ (~AskQty$)AskQty# (~AskQty#)AskQty& (~AskQty&)AvgOpenPriceInDecimalAvgOpenPriceInTicksAvgOpenPriceRndAvgOpenPriceRnd#AvgOpenPriceRnd$AvgOpenPriceRnd&Bid (~Bid)Bid$ (~Bid)Bid# (~Bid#)Bid& (~Bid&)Best ask quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Note: When the MergeImpliedsIntoDirects property isenabled, AskQty contains the quantity for the better of thedirect and implied Ask prices.Note: The TT EBS Gateway supports the concept of “at leastthis many” quantities for depth levels. If theEBSAskQtyExceeded attribute is TRUE, this attribute isaffected as follows:The AskQty$ and ~AskQty$ attributes append a plus sign(+) to indicate that that at least that number of Asksexiss.Your application should treat the other AskQty formats as“at least” quantities as well.Average price of open position in decimal format. Valid onlywhen you attach the instrument to a TTOrderSet object withits EnableFillCaching property set to TRUE.Average price of open position in ticks and fractions of a tick.Valid only when you attach the instrument to a TTOrderSetobject with its EnableFillCaching property set to TRUE.Average price of open position rounded to the nearest tick.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksValid only when you attach the instrument to a TTOrderSetobject with its EnableFillCaching property set to TRUE.Best bid price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Note: When the MergeImpliedsIntoDirects property isenabled, the Bid price contains the better of the direct andimplied prices.AsspecifiedDecimalDecimalAsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)40 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeBidAskMid (~BidAskMid)BidAskMid$ (~BidAskMid$)BidAskMid# (~BidAskMid#)BidAskMid& (~BidAskMid&)BidDepth(levels)BidDepth#(levels)BidDepth&(levels)BidDepth90(levels)BidDepth90#(levels)BidDepth90&(levels)BidMktQty (~Ask)BidMktQty$ (~Ask$)BidMktQty# (~Ask#)BidMktQty& (~Ask&)BidOrderIdAverage of the best bid price and the best ask price (roundeddown to the nearest tick), in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Row-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price and a quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Column-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each column contains a price and a quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Market order quantity during the pre-open phase, as aninteger.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Order ID for the best bid.(Currently supported only for BrokerTec)AsspecifiedAsspecifiedAsspecifiedAsspecifiedStringTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 41<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeBidQty (~BidQty)BidQty$ (~BidQty$)BidQty# (~BidQty#)BidQty& (~BidQty&)BuyWrkCallPutChange (~Change)Change$ (~Change$)Change# (~Change#)Change& (~Change&)Close (~Close)Close$ (~Close$)Close# (~Close#)Close& (~Close&)ContractContractAliasBest bid quantity as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Note: When the MergeImpliedsIntoDirects property isenabled, BidQty contains the quantity for the better of thedirect and implied Bid prices.Note: The TT EBS Gateway supports the concept of “at leastthis many” quantities for depth levels. If theEBSBidQtyExceeded attribute is TRUE, this attribute isaffected as follows:The BidQty$ and ~BidQty$ attributes append a plus sign(+) to indicate that that at least that number of Asksexiss.Your application should treat the other AskQty formats as“at least” quantities as well.Quantity of working buy orders.Valid only when you attach the instrument to a TTOrderSetobject.Whether the option on the instrument is a call or put:C: CallP: PutNet price change in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Prior session’s closing price for the instrument in X_TRADERdisplay format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Default name of the instrument as displayed in theX_TRADER ® Market Grid Contract field (example: ESSep13).Alias name associated with the instrument (as assigned inGuardian), along with the contract’s expiry information.If the instrument has no alias, the property returns thedefault instrument name and expiry information.AsspecifiedIntegerStringAsspecifiedAsspecifiedStringStringContractShort Short name associated with the instrument (example: ES M5) StringTable 1. TTInstrObj Get property attributes (Continued)42 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeCurrencyISO currency code associated with the instrument. ISOsymbol for the source and target currencies.StringDecimals Number of implied decimals used in prices. IntegerDeliveryUnitEBSAskDepth(levels)EBSAskDepth#(levels)EBSAskDepth&(levels)EBSAskQuantityExceededEBSBestBidEBSBestBid$EBSBestBid#EBSBestBid&EBSBestAskEBSBestAsk$EBSBestAsk#EBSBestAsk&EBSBidDepth(levels)EBSBidDepth#(levels)EBSBidDepth&(levels)EBSBidQuantityExceededEBSLocalBidEBSLocalBid$EBSLocalBid#EBSLocalBid&Exchange-provided delivery unit for instruments in flowcontracts; 1 for all others.Two-dimensional array of prices and the quantity associatedwith each (each row contains price, quantity) for the specifiednumber of depth levels. The attribute returns the price in thespecified data type, but always returns the quantity as astring, including the plus sign (+) where appropriate.(Valid only for the TT EBS Gateway)Whether the AskQty attribute represents an “at least”quantity.(Valid only for the TT EBS Gateway)Best bid price available from the exchange, regardless ofwhether or not the trader, based on available credit with theexchange and other members, is able to hit this price.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)Best asking price available from the exchange, regardless ofwhether or not the trader, based on available credit with theexchange and other members, is able to hit this price.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)Two-dimensional array of prices and the quantity associatedwith each (each row contains price, quantity) for the specifiednumber of depth levels. The attribute returns the price in thespecified data type, but always returns the quantity as astring, including the plus sign (+) where appropriate.(Valid only for the TT EBS Gateway)Whether the BidQty attribute represents an “at least”quantity.(Valid only for the TT EBS Gateway)Bid price originating from an EBS customer trading floor.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)IntegerArray ofspecifieddata typesBooleanAsspecifiedAsspecifiedArray ofspecifieddata typesBooleanAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 43<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeEBSLocalAskEBSLocalAsk$EBSLocalAsk#EBSLocalAsk&EBSPriceDepth(levels)EBSPriceDepth#(levels)EBSPriceDepth&(levels)EBSRegularBidEBSRegularBid$EBSRegularBid#EBSRegularBid&EBSRegularAskEBSRegularAsk$EBSRegularAsk#EBSRegularAsk&EBSRegularQtyEBSXTDepth(levels)EBSXTDepth#(levels)EBSXTDepth&(levels)Asking price originating from an EBS customer trading floor.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)Row-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price, bid quantity, and askquantity. The attribute returns the price values in thespecified data type, but always returns the quantities asstrings, including the plus sign (+) where appropriate.(Valid only for the TT EBS Gateway)Worst bid price at which the trader can be filled for an EBSRegular Quantity order.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)Worst asking price at which the trader can be filled for an EBSRegular Quantity order.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : Ticks(Valid only for the TT EBS Gateway. Returns NULL if requestedfrom any other TT Gateway.)EBS-provided size of the contract that is guaranteed to befilled in its entirety at the corresponding EBSRegularBid orEBSRegularAsk prices. Note that the exchange can updatethis value during a trading session.(Valid only for the TT EBS Gateway. Returns TT_INVALID_QTYif requested from any other TT Gateway.)Row-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each row contains a bid price, bid quantity, askprice, and ask quantity. The attribute returns the price valuesin the specified data type, but always returns the quantitiesas strings, including the plus sign (+) where appropriate.(Valid only for the TT EBS Gateway)AsspecifiedArray ofspecifieddata typesAsspecifiedAsspecifiedAsspecifiedArray ofspecifieddata typesExchange Name of the exchange on which the instrument trades. StringExpirationDateInstrument expiration date in the form, MM/DD/YY. Forcontracts that have no expiration date, this attribute returnsNULL.COleDateTimeExpiry Instrument expiration, in month and year (example: Sep13). StringFillsDownloaded Whether all fills have been downloaded from the exchange. BooleanTable 1. TTInstrObj Get property attributes (Continued)44 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeFractionalFractional$High (~High)High$ (~High$)High# (~High#)High& (~High&)IAsk (~IAsk)IAsk$ (~IAsk$)IAsk# (~IAsk#)IAsk& (~IAsk&)IAskDepth(levels)IAskDepth#(levels)IAskDepth&(levels)IAskDepth90(levels)IAskDepth90#(levels)IAskDepth90&(levels)IAskQty (~IAskQty)IAskQty$ (~IAskQty$)IAskQty# (~IAskQty#)IAskQty& (~IAskQty&)Ticking scheme for the instrument. Possible values include:D: DecimalF: FractionalHigh price during the current trading session, in X_TRADERdisplay format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Implied ask price for the instrument, in X_TRADER displayformat.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Row-based, two-dimensional array of implied ask prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price and a quantity, inX_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksColumn-based, two-dimensional array of implied ask pricesand corresponding quantities for the specified number ofdepth levels, where each column contains a price and aquantity, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksImplied ask quantity, as a integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.StringAsspecifiedAsspecifiedArray ofspecifieddata typesArray ofspecifieddata typesAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 45<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeIBid (~IBid)IBid$ (~IBid$)IBid# (~IBid#)IBid& (~IBid&)IBidDepth(levels)IBidDepth#(levels)IBidDepth&(levels)IBidDepth90(levels)IBidDepth90#(levels)IBidDepth90&(levels)IBidQty (~IBidQty)IBidQty$ (~IBidQty$)IBidQty# (~IBidQty#)IBidQty& (~IBidQty&)IndAsk (~IndAsk)IndAsk$ (~IndAsk$)IndAsk# (~IndAsk#)IndAsk& (~IndAsk&)IndAskQty (~IndAskQty)IndAskQty$ (~IndAskQty$)IndAskQty# (~IndAskQty#)IndAskQty& (~IndAskQty&)Implied bid price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Row-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price and a quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Column-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each column contains a price and a quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Implied bid quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative ask price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative ask quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedArray ofspecifieddata typesArray ofspecifieddata typesAsspecifiedAsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)46 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeIndBid (~IndBid)IndBid$ (~IndBid$)IndBid# (~IndBid#)IndBid& (~IndBid&)IndBidQty (~IndBidQty)IndBidQty$ (~IndBidQty$)IndBidQty# (~IndBidQty#)IndBidQty& (~IndBidQty&)IndClosePrice (~IndClosePrice)IndClosePrice$ (~IndClosePrice)$)IndClosePrice# (~IndClosePrice)#)IndClosePrice& (~IndClosePrice)&)IndCloseQty(~IndCloseQty)IndCloseQty$ (~IndCloseQty$)IndCloseQty# (~IndCloseQty#)IndCloseQty& (~IndCloseQty&)IndOpenPrice (~IndOpenPrice)IndOpenPrice$ (~IndOpenPrice$)IndOpenPrice# (~IndOpenPrice#)IndOpenPrice& (~IndOpenPrice&)IndOpenQty(~IndOpenQty)IndOpenQty$ (~IndOpenQty$)IndOpenQty# (~IndOpenQty#)IndOpenQty& (~IndOpenQty&)Indicative bid price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative bid quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative closing price indicating the settlement price for thesession, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative close quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative opening price indicating the settlement price forthe session, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Indicative open quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedAsspecifiedAsspecifiedAsspecifiedAsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 47<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeIndPrice (~IndPrice)IndPrice$ (~IndPrice$)IndPrice# (~IndPrice#)IndPrice& (~IndPrice&)Indicative, or equalibrium, pre-open phase price indicatingthe price a market would match if it were open, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedIndSettle (~IndSettle)IndSettle$ (~IndSettle$)IndSettle# (~IndSettle#)IndSettle& (~IndSettle&)Indicative closing price indicating the intra-day settlementprice, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedInstr Default instrument name as displayed in the X_TRADER ®Market Grid Contract field.StringInstrStatusIPriceDepth(levels)IPriceDepth#(levels)IPriceDepth&(levels)IPriceDepth90(levels)IPriceDepth90#(levels)IPriceDepth90&(levels)IsAskOwnerIsBidOwnerStatus of the connection for underlying series. Possible valuesinclude:ConnectedFoundNonexistentValidUndefinedRow-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price, bid quantity, and askquantity, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksColumn-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each column contains a price, bid quantity, andask quantity, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksWhether an order belonging to the current trader is the bestask.(Currently supported only for BrokerTec)Whether an order belonging to the current trader is the bestbid.(Currently supported only for BrokerTec)StringAsspecifiedAsspecifiedBooleanBooleanTable 1. TTInstrObj Get property attributes (Continued)48 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeIsFlowContractIsHitWhether the instrument is an energy product and can tradewith quantities in flow.Whether the aggressor in the workup was a seller.Valid only for BrokerTec.BooleanBooleanIsLTQAccum Whether the GAL setting for LTQ accumulation is enabled. BooleanIsPrivateWorkupIsPublicWorkupIs<strong>Server</strong>DownWhether the market is in a private workup state.(Currently supported only for BrokerTec)Whether the market is in a public workup state.(Currently supported only for BrokerTec)Whether the price server associated with the instrument isdown.BooleanBooleanBooleanIs<strong>Server</strong>Up Whether the price serve associated with the instrument is up. BooleanIsSubscribed Whether the instrument receives live price updates. BooleanIsTakeIsTradedInFlowIsWorkupIXTDepth(levels)IXTDepth#(levels)IXTDepth&(levels)IXTDepth90(levels)IXTDepth90#(levels)IXTDepth90&(levels)KeyLast (~Last)Last$ (~Last$)Last# (~Last#)Last& (~Last&)Whether the aggressor in the workup was a buyer.Valid only for BrokerTec.Whether the contract is a flow contracted deliveringquantities in flow.(Valid only for energy products)Whether the market is in a public or private workup state.(Currently supported only for BrokerTec)Row-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each row contains a bid price, bid quantity, askprice, and ask quantity, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksColumn-based, two-dimensional array of implied prices andcorresponding quantities for the specified number of depthlevels, where each column contains a bid price, bid quantity,ask price, and ask quantity.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Unique, internal ID that TT associates with the instrument.Same as Series and SeriesKey attributes.Price at which the instrument last traded, in X_TRADERdisplay format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.BooleanBooleanBooleanArray ofspecifieddata typesArray ofspecifieddata typesStringAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 49<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeLastQty (~LastQty)LastQty$ (~LastQty$)LastQty# (~LastQty#)LastQty& (~LastQty&)LLimit (~LLimit)LLimit$ (~LLimit$)LLimit# (~LLimit#)LLimit& (~LLimit&)Login.fieldLotSizeLow (~Low)Low$ (~Low$)Low# (~Low#)Low& (~Low&)LTPDirectionQuantity of all trades at the last traded price, as in integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Lower limit used during price reasonability checks, as aninteger.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Information about the current user login. Possible field valuesinclude:CLRMEMBERDEFAULTACCTGATEWAYIPGROUPHANDOFFGROUPHANDOFFMEMBERHANDOFFTRADERMEMBERTRADERExchange-provided lot size for instruments that are flowcontracts; 1 for all others.Lowest trading price for the current trading session, inX_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Direction of the most recently traded price for the instrument.Possible values include:1 : Up0 : Unchanged-1 : DownIf retrieved before price updates are received, the valuereturns TT_INVALID_QTY.AsspecifiedAsspecifiedStringIntegerAsspecifiedIntegerTable 1. TTInstrObj Get property attributes (Continued)50 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeLTPDirection$MarketMarketImbalanceMaxDecimalsMIAsk (~MIAsk)MIAsk$ (~MIAsk$)MIAsk# (~MIAsk#)MIAsk& (~MIAsk&)MIAskQty (~MIAskQty)MIAskQty$ (~MIAskQty$)MIAskQty# (~MIAskQty#)MIAskQty& (~MIAskQty&)MIBid (~MIBid)MIBid$ (~MIBid$)MIBid# (~MIBid#)MIBid& (~MIBid&)Direction of the most recently traded price for the instrument.Possible values include:‘+’ : Up‘ ‘ : Unchanged‘-’ : DownIf retrieved before price updates are received, the valuereturns an empty string.Name of the exchange associated with the TT Gateway;equivalent to the Exchange attribute.Degree of imbalance between the number of bids and asks forthe full depth of the Instrument. Positive values indicate morebids than asks; negative values indicate more asks that bids.Maximum number of significant digits to the right of thedecimal point of a price.Better of the direct best ask price and the implied ask price,in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.One of the following:Direct best ask quantity if the direct best ask price is betterthan the implied ask priceImplied ask quantity if the implied ask price is better thanthe direct best ask priceDirect and implied ask quantities added together if thedirect and implied ask prices are the same.The attribute returns an integer value by default.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Better of the direct best bid price and the implied bid price, inX_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.StringStringIntegerIntegerAsspecifiedAsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 51<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeMIBidQty (~MIBidQty)MIBidQty$ (~MIBidQty$)MIBidQty# (~MIBidQty#)MIBidQty& (~MIBidQty&)One of the following:Direct best bid quantity if the direct best bid price is betterthan the implied bid priceImplied bid quantity if the implied bid price is better thanthe direct best bid priceDirect and implied bid quantities added together if thedirect and implied bid prices are the same.The attribute returns an integer value by default.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedMMMYY Contract name, using the 3-character month identifier and 2-digit year (example: Jun13).StringFor products of type STOCK, this value returns an emptystring.Name Default instrument name as displayed in the X_TRADER ®Market Grid Contract field.StringNetCntNetPosNetTicksNetWrkNumberOfAskOrders(priceLevel)NumberOfBidOrders(priceLevel)Open (~Open)Open# (~Open#)Open$ (~Open$)Open& (~Open&)Value of the NetCnt attribute in the attached TTOrderSet,which is the total number of working orders (Number of BuyOrders + Number of Sell Orders).Valid only when you attach the instrument to a TTOrderSetobject.Value of the NetPos attribute in the attached TTOrderSet,which is the current net position (Quantity Purchased -Quantity Sold), based on fill information.Valid only when you attach the instrument to a TTOrderSetobject.Value of the NetTicks attribute in the attached TTOrderSet,which is the net cost in ticks of the current position (Revenuefrom all Sells - Cost of all Buys).Valid only when you attach the instrument to a TTOrderSetobject.Value of the NetWrk attribute in the attached TTOrderSet,which is the total quantity of working orders (Quantity ofWorking Buys + Working Sells).Valid only when the instrument has an attached TTOrderSetobject.Number of resting ask orders at the specified priceLevel (0 forthe inside market).Number of resting bid orders at the specified priceLevel (0 forthe inside market).Opening price of the instrument for the current tradingsession, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksIntegerIntegerIntegerIntegerIntegerIntegerAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)52 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeOpenPLOpenPL&OpenPL#OpenPL$OpenPL~OpenPL^OpenPL.^OpenPL@OpenPL.[Currency]OS.objAttributeOTCPrc (~OTCPrc)OTCPrc$ (~OTCPrc$)OTCPrc# (~OTCPrc#)OTCPrc& (~OTCPrc&)OTCQty (~OTCQty)OTCQty$ (~OTCQty)OTCQty# (~OTCQty)OTCQty& (~OTCQty&)Current value of open positions in ticks, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe OpenPL$ value is expressed as USD currency.Valid only when you attach the instrument to a TTOrderSetobject with its EnableFillCaching property set to TRUE.Current market value of open positions as:~ : String delta format^ : Native currency.^ : Native currency@ : Primary currencyValid only when you attach the instrument to a TTOrderSetobject with its EnableFillCaching property set to TRUE.Current market value of open positions in the currency whosecode you specify (Currency).Possible values include:• ARS• ATS• AUD• BEF• BRL• CAD• CHF• DEM• ESP• EUR• FRF• GBP• HKD• INR• ITL• JPY• KRW• NLG• PTE• RUR• SGD• USD• XBA• XEUValid only when you attach the instrument to a TTOrderSetobject with its EnableFillCaching property set to TRUE.Value of the specified object attribute in TTOrderSet.Valid only when the instrument has an attachedTTOrderSet.Price of the last wholesale trade for the instrument inX_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Quantity of the last wholesale trade, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedAsspecifiedStringAsspecifiedAsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 53<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeOwnAskOrderKeyOwnBidOrderKeyPctChangePctChange$PLPL$PL#PL&PL~PL^PL.^PL@PL.[Currency]PL.[LOTS]PL.ZPL.Z$PL.Z#PL.Z&Order key of the best ask if the order belongs to the currenttrader. Valid only when you attach the instrument to aTTOrderSet object.(Currently supported only for BrokerTec)Order key of the best bid if the order belongs to the currenttrader. Valid only when you attach the instrument to aTTOrderSet object.(Currently supported only for BrokerTec)Percentage change from the previous close price to thecurrent price, as a decimal value. You can use the $ modifierto return the value as a string.P & L (NetPos * LTP + NetTicks), as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe PL$ value is expressed as USD currency.Valid only when you attach the instrument to a TTOrderSetobject.P & L in string delta format, in one of the following formats:~ : String delta format^ : Native currency.^ : Native currency@ : Primary currencyValid only when you attach the instrument to a TTOrderSetobject.P & L in the currency whose code you specify (Currency).Possible values include:• ARS• ATS• AUD• BEF• BRL• CAD• CHF• DEM• ESP• EUR• FRF• GBP• HKD• INR• ITL• JPY• KRW• NLG• PTE• RUR• SGD• USD• XBA• XEUValid only when you attach the instrument to a TTOrderSetobject.P & L for instruments that trade in flow in lots; for instrumentsthat do not trade in flow, returns in contracts.Valid only when you attach the instrument to a TTOrderSetobject.P & L since the last ClearQuotePosition call, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerValid only when a quoting TTOrderSet is attached to theinstrument.StringStringAsspecifiedAsspecifiedAsspecifiedStringIntegerAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)54 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypePointValuePriceDepth(levels)PriceDepth#(levels)PriceDepth&(levels)Value of one price point. ProductName Variable extracts thisvalue from the TT Guardian product table for the instrument.Row-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each row contains a price, bid quantity, and askquantity. The value returns in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)DoubleArray ofspecifieddata typesPriceDepth90(levels)PriceDepth90#(levels)PriceDepth90&(levels)Column-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each column contains a price, bid quantity, andask quantity. The value returns in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Array ofspecifieddata typesPriceStatePriceState$PriceTypeProdTypeProdType&Current workup state and type as string or bitmask accordingto the following:0x00 : “None”0x01 : “Workup Private”0x02 : “Workup Public”0x0F : “Other States”0x10 : “Aggressor is bid“0x20 : “Aggressor is ask“0x40 : “Workup correction““Other States” serves as a mask for unused values. Commonvalues for PriceState include:0 : “No workup“17 : “Private workup aggressor is bid“18 : “Public workup aggressor is bid“33 : “Private workup aggressor is ask“34 : “Private workup aggressor is ask“(Currently supported only for BrokerTec)ProductName Variable price display type. For a description ofpossible values, refer to “Price types” on page 639.Name of (ProdType) or integer (ProdType&) representing theinstrument’s product type. For a list of possible product types,see “Product types” on page 641.AsspecifiedIntegerAsspecifiedProduct Name of the product. StringProductAliasProductTitleRoundLotQtySellWrkName of a product alias (as it is assigned in Guardian). If theproduct does not have an alias, ProductAlias returns thedefault name of the product.Product name followed by the product type in parenthesis (forexample, ES (FUTURE)).Size of trading quantity multiplier. Some contracts must betraded in fixed mulitples of the lot quantity. For example, acontract might require you to trade it only in mulitples of 5.Quantity of working sells.Valid only when you attach the instrument to a TTOrderSetobject.StringStringIntegerIntegerTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 55<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeSeriesSeriesKeySeriesNameSettle (~Settle)Settle$ (~Settle$)Settle# (~Settle#)Settle& (~Settle&)StatusStatus&Status$StrikeStrikeDecimalsStrikeFlagsUnique, internal ID that TT associates with the instrument.Same as Key and SeriesKey attributes.Unique, internal ID that TT associates with the instrument.Same as Key and Series attributes.Exchange-provided name for the instrument, if it exits;“Contract” otherwise.Instrument’s settle price, in X_TRADER display format.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Status of the instrument on the exchange, such as <strong>Trading</strong>,Pre-trade, etc., as an integer. You can use the followingmodifiers to return the value in a specific format:& : Integer$ : StringFor more information, refer to Product status types, on page639.Strike price as an integer (not ticks). Valid only for optionsinstruments.Number of significant digits to the right of the decimal usedfor the strike price. Valid only for options instruments.Display format for the instrument’s strike price. Possiblevalues include:D: Decimal points (default)N: Fractional tickValid only for options instruments.StringStringStringAsspecifiedAsspecifiedIntegerIntegerAsspecifiedStrikePrecision Default market precision for the instrument’s strike price. IntegerTAsk (~TAsk)TAsk$ (~TAsk$)TAsk# (~TAsk#)TAsk& (~TAsk&)TAskQty (~TAskQty)TAskQty$ (~TAskQty$)TAskQty# (~TAskQty#)TAskQty& (~TAskQty&)Theoretical ask price for a mass quote, in X_TRADER displayformat.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Theoretical ask quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedAsspecifiedTable 1. TTInstrObj Get property attributes (Continued)56 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


A Instrument Attributes TTInstrObj object attributesAttribute Description DataTypeTBid (~TBid)TBid$ (~TBid$)TBid# (~TBid#)TBid& (~TBid&)TBidQty (~TBidQty)TBidQty$ (~TBidQty$)TBidQty# (~TBidQty#)TBidQty& (~TBidQty&)Theoretical bid price for a mass quote, in X_TRADER displayformat.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Theoretical ask quantity, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedAsspecifiedText Same as the Name and Instr attributes. StringTickIncrementTPrc (~TPrc)TPrc$ (~TPrc$)TPrc# (~TPrc#)TPrc& (~TPrc&)ULimit (~ULimit)ULimit$ (~ULimit$)ULimit# (~ULimit#)ULimit& (~ULimit&)Smallest valid tick increment as an integer. The default valueis 1. For reduced tick spreads, the value of underlying legs iseither 2 or 4.Theoretical mid price, as a decimal.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksThe tilde (~) prefix returns the last change (delta) in theattribute.Upper limit used during price reasonability check, as aninteger.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.IntegerAsspecifiedAsspecified<strong>Version</strong> <strong>Version</strong> of the option. StringVola (~Vola)Vola$ (~Vola$)Vola# (~Vola#)Vola& (~Vola&)Theoretical volatility, as an integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.AsspecifiedTable 1. TTInstrObj Get property attributes (Continued)X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 57<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTInstrObj object attributes A Instrument AttributesAttribute Description DataTypeVolume (~Volume)Volume$ (~Volume$)Volume# (~Volume#)Volume& (~Volume&)WorkupStateWorkupState&WorkupTypeWorkupType&XTDepth(levels)XTDepth#(levels)XTDepth&(levels)XTDepth90(levels)XTDepth90#(levels)XTDepth90&(levels)Total quantity traded for the day, as a integer.You can also use one of the following modifiers to display thevalue in a specific format:$ : String# : Decimal value& : IntegerThe tilde (~) prefix returns the last change (delta) in theattribute.Current workup state as a string. Possible values include:"None""Public""Private"(Currently supported only for BrokerTec)Current workup state as an enumeration. Possible valuesinclude:WORKUP_TYPE_NONEWORKUP_TYPE_PRIVATEWORKUP_TYPE_PUBLIC(Currently supported only for BrokerTec)Current workup type as a string. Possible values include:"None""Hit""Take"(Currently supported only for BrokerTec)Current workup type as an enumeration. Possible valuesinclude:WORKUP_TYPE_NONEWORKUP_TYPE_HITWORKUP_TYPE_TAKE(Currently supported only for BrokerTec)Row-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each row contains a bid price, bid quantity, askprice, and ask quantity. Returns prices in X_TRADER displayformat.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)Column-based, two-dimensional array of prices andcorresponding quantities for the specified number of depthlevels, where each column contains a bid price, bid quantity,ask price, and ask quantity. Returns prices in X_TRADERdisplay format.You can also use one of the following modifiers to display thevalue in a specific format:# : Decimal value& : Integer (Ticks)AsspecifiedStringEnumEnumEnumArray ofspecifieddata typesArray ofspecifieddata typesTable 1. TTInstrObj Get property attributes (Continued)58 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


BOrder Set AttributesTTOrderSet object attributesAbout the TTOrderSetobjectThe <strong>XTAPI</strong> stores information about order sets in the TTOrderSet object. Whenthe <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> requests information about an order set, the <strong>XTAPI</strong> looksfor the attributes defined for the object. You can request values for any of theTTOrderSet object attributes.Available attributesYou can access information about an order set with the following <strong>XTAPI</strong>TTOrderSet attributes.Attribute Description DataTypeBuyCnt Number of buy orders in the order set IntegerBuyFillCntBuyFillsBuyFills90BuyLimitsBuyOPosBuyOrdersBuyOrders90Number of fills for buy orders.Valid only when the EnableFillCaching property is TRUE.Row-based, two-dimensional array of values from all filled buyorders, where each row contains an fill and each columncontains an attribute value.Column-based, two-dimensional array of values from all filledbuy orders, where each column contains an fill and each rowcontains an attribute value.Whether the order set checks self-imposed limits (MaxBuyattributes) when submitting buy ordersQuantity of contracts purchased based on successfullyexecuted buy ordersRow-based, two-dimensional array of values from all buyorders, where each row contains an order and each columncontains an attribute value.Column-based, two-dimensional array of values from all buyorders, where each column contains an order and each rowcontains an attribute value.IntegerVariantVariantBooleanIntegerVariantVariantBuyPos Quantity purchased based on fill information IntegerBuyTicks Cost in ticks of all purchased contracts IntegerBuyWrk Quantity of working buys IntegerFillsFills90Row-based, two-dimensional array of values from all fills,where each row contains an fill and each column contains anattribute value.Column-based, two-dimensional array of values from all fills,where each column contains an fill and each row contains anattribute value.VariantVariantMaxBuyOrderQty Maximum quantity allowed in a single buy order IntegerMaxBuyOrders Maximum number of buy orders allowed in the order set IntegerMaxBuyWorking Maximum number of working orders allowed in the order set IntegerMaxFillsMaximum number of fill records that can be included in one fillblockIntegerMaxOrderQty Maximum quantity allowed in a single buy or sell order IntegerTable 1. TTOrderSet Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 59<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderSet object attributes B Order Set AttributesAttribute Description DataTypeMaxOrders Maximum number of orders allowed in the order set IntegerMaxOrderStatusUpdatesMaxPositionMaximum number of consecutive order updates allowed beforeallowing other events to fireMaximum long or short position (in ticks) allowed in the ordersetIntegerIntegerMaxRejects Maximum number of order rejection events sent in succession IntegerMaxSellOrderQty Maximum quantity allowed in a single sell order IntegerMaxSellOrders Maximum number of sell orders allowed in the order set IntegerMaxSellWorkingMaximum number of working sell orders allowed in the ordersetIntegerMaxWorking Maximum number of working orders allowed in the order set IntegerNetCnt Total number of working orders (Buys + Sells) IntegerNetFillCnt Total number of filled orders IntegerNetLimitsNetLongPosMaxWhether the order set checks self-imposed position limits whensubmitting an orderMaximum net long position since order set was opened(quantity purchased - quantity sold), based on fill informationBooleanIntegerNetOPos Current net position based on orders IntegerNetPos Current net position based on fill information IntegerNetShortPosMaxNetTicksMaximum net short position since order set was opened(quantity sold - quantity purchased), based on fill informationValue of the NetTicks attribute, which is the net cost in ticks ofthe current position. Valid only when you attach the instrumentto a TTOrderSet object.IntegerDecimalNetWrk Total quantity of working orders (working buys + working sells) IntegerOrdersOrders90Row-based, two-dimensional array of values from all orders,where each row contains an order and each column contains anattribute value.Column-based, two-dimensional array of values from allorders, where each column contains an order and each rowcontains an attribute value.ArrayArrayOrderStateCorrection TT internal use only. BooleanRealizedPL Current realized P&L in ticks IntegerSellCnt Number of sell orders in the order set IntegerSellFillCntSellFillsSellFills90SellLimitsNumber of fills for sell orders.Valid only when the EnableFillCaching property is TRUE.Row-based, two-dimensional array of values from all filled sellorders, where each row contains an fill and each columncontains an attribute value.Column-based, two-dimensional array of values from all filledsell orders, where each column contains an fill and each rowcontains an attribute value.Whether the order set checks self-imposed limits (MaxSell*attributes) when submitting sell ordersIntegerVariantVariantIntegerSellOPosTable 1. TTOrderSet Get attributesQuantity of contracts sold based on successfully executed sellordersInteger60 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


B Order Set Attributes TTOrderSet object attributesAttribute Description DataTypeSellOrdersSellOrders90Row-based, two-dimensional array of values from all sellorders, where each row contains an order and each columncontains an attribute value.Column-based, two-dimensional array of values from all sellorders, where each column contains an order and each rowcontains an attribute value.ArrayArraySellPos Quantity sold based on fill information IntegerSellTicks Cost in ticks of all sold contracts IntegerSellWrk Quantity of working sells IntegerThrowLimitErrorsHow the <strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> responds when a self-imposed limitis violated. Possible values include:FALSE, reduces order to self-imposed limitTRUE, throws an errorIntegerTable 1. TTOrderSet Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 61<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderSet object attributes B Order Set Attributes62 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


COrder AttributesTTOrderObj object attributesAbout the TTOrdeObjobjectThe <strong>XTAPI</strong> stores information about orders in the TTOrderObj object. When the<strong>XTAPI</strong> <strong>RTD</strong> <strong>Server</strong> requests information about an order, the <strong>XTAPI</strong> looks for theattributes defined for the object. You can request values for any of theTTOrderObj object attributes.Available attributesYou can access information about an order set with the following <strong>XTAPI</strong>TTOrderObj attributes.Attribute Description DataTypeAcct Customer's or trader's account number StringAcctTypeAccountTypeBuySellBuySell$ChangeChgCode indicating the desired account typeType of order. Possible values include:B: BuyS: SellSpecifying BuySell$ returns Buy or Sell.Whether the order changedStringStringBooleanClrMember Clearing Member ID StringCntrGroup Counter Side Clearing Group ID StringCntrMember Counter Side Clearing Member ID StringCntrTrader Counter Side Clearing Trader ID StringColorPriColorSecContractContract$Color to display in the MD Trader® working orders grid, where:ColorPri represents the order’s main color (left-side of thegrid)ColorSec represents the secondary color (right-side of thegrid)The value is an integer value representing the RGB value forthe color. The value corresponds to a Microsoft ColorRef datatype.Instrument's name with expiration (e.g. ES Sep13)IntegerStringContractAlias Instrument's alias name with expiration (e.g. E-Mini Sep13) StringContract.getAttribute Get attribute for the attached instrument (TTInstrObj) VariousDate Date of the order in MM/DD/YY (e.g. 05/18/12)The value contains valid data only in the date portion of theCOleDateTime object.COleDateTimeDisclosedQtyDiscQtyQuantity of the order visible in the market. Valid only fordisclosed quantity orders.IntegerTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 63<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderObj object attributes C Order AttributesAttribute Description DataTypeEx:OrderNoExecutionTypeOrder number for the specified exchange (e.g. CME:107578464)Current state of the order. Possible values include:-1: Order is in an invalid state0: Order is in pre-execution state (not yet sent to a TTGateway)1: Order is in post-execution state and the <strong>XTAPI</strong> hasreceived a response from the TT GatewayStringIntegerExGroup Exchange Group ID for this order StringExMember Exchange Member ID for this order StringExOrderIDExpiryExchange Order ID assigned to this order. This attributecorresponds to the OrderNo attribute for exchanges that do notreturn strictly numeric order numbers.Note: If the exchange does not provide a value, the <strong>XTAPI</strong>populates it with the OrderNo attribute value.Expiration date for the order. Possible values include:Null: GTC orderToday’s date: GIS or GTD orderFuture date: Expiration dateThe value contains valid data only in the date portion of theCOleDateTime object.StringCOleDateTimeExTrader Exchange Trader ID for this order StringExTransNo Unique identifier for the order transaction. StringFFT1FFT2FFT3FillFillQtyGiveUpFree-form text fields. FFT1 typically contains the accountnumber.Order quantity already filledGive-up member's clearing ID, when the fill is assigned toanother memberNote: The TT ICE Gateway does not support the GiveUpattribute; instead, it uses the ClrMember attribute for Give Uporders.StringIntegerStringGroup Group name of the trader from the Member/Group/Trader ID StringInstrInstr$Default instrument name as displayed in the X_TRADER ®Market Grid Contract field (e.g., ES Sep13)StringInstrAlias Instrument's alias name with expiration (e.g. E-Mini Sep13) StringInstr.getAttribute Value of the specified object attribute in the TTInstrObj object VariousIsAON Whether the order is an All-Or-None order BooleanIsAuction Whether the order is only valid for auction BooleanIsAuto-AggressWhether the order is auto-aggressive(Currently supported only for BrokerTec)BooleanIsAutomated Whether the order orginates from an automated program. BooleanTable 1. TTDropHandler Get attributes64 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


C Order Attributes TTOrderObj object attributesAttribute Description DataTypeIsAwayMarketWhether an away market maker should match BBO of an awaymarketBooleanIsBasis Whether the order is a basis order BooleanIsBestLimitWhether the order is a best limit order(Currently supported only for the TT TOCOM Gateway)BooleanIsBlock Whether the order is a block order BooleanIsBuy Whether the order is a buy order BooleanIsFAS Whether the order is a fill and save order BooleanIsFlex Whether the order is a flex option order BooleanIsFOK Whether the order is a fill or kill order BooleanIsGIS Whether the order is a good-in-session order BooleanIsGTC Whether the order is a good-tll-canceled order BooleanIsGTD Whether the order is a good-till-date order BooleanIsIceberg Whether the order is an Iceberg order BooleanIsIfTouchedWhether the order requires additional action when a price istouchedBooleanIsIOC Whether the order is an immediate-or-cancel order BooleanIsLOCIsLOOWhether the order is a limit-on-close order to be filled or killedwhen market closesWhether the order is a limit-on-open order to be filled or killedwhen the market opensBooleanBooleanIsLSM Whether the order is a limit-stop-market order BooleanIsLTMWhether the order is a limit to market order to be converted toa market order on closeBooleanIsMarketToLimit Whether the order is a market-to-limit order BooleanIsMLM Whether the order is a market-limit-market order BooleanIsMOC Whether the order is a market-on-close order BooleanIsMOO Whether the order is a market-on-open order BooleanIsMTL Whether the order is a market-to-limit order BooleanIsMV Whether the order is a minimum volume order BooleanIsNon-LeaveIsOrderColorSupportedWhether the order is a non-leave order(Currently supported only for BrokerTec)Whether the version of X_TRADER ® installed on a trader’ssystem supports receiving order color information from an<strong>XTAPI</strong> application.If color is supported, X_TRADER ® uses the values in theColorPri and ColorSec object attributes for theTTOrderProfile and TTOrderObj objects in theMD Trader ® widow. You can define the colors by setting theattributes with the Set method.BooleanBooleanTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 65<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderObj object attributes C Order AttributesAttribute Description DataTypeIsPartial Whether the order is partially filled BooleanIsPassiveWhether the order is passive(Currently supported only for BrokerTec)BooleanIsSell Whether the order is a sell order BooleanIsShortExempt Whether the order is a sell short order exempt from notification BooleanIsStop Whether the order is a stop order BooleanIsTimed Whether the order is a timed order BooleanIsTriggered Whether the order has been triggered BooleanIsTriggeredTime Whether the order was triggered after a time submission BooleanIsVolatility Whether the order is a volatility order BooleanKeyLinkTypeLimitLimit#Limit$Limit&Internal static key that represents the order throughout itslifetimeType of link identifying the relationship between orders. Valuesinclude:AlgoAlgoCAlgoLASASQASHASROCOOMASSESSECSSERStage-BKRStage-INTStage-UNKUNMNote: In some instances an order can have more than one linktype, separated by a comma (e.g. SSE, OCO).Limit used during price reasonability checks.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksStringStringAs specifiedLocation Order sender country and region code. StringMember Member ID of the trader from the Member/Group/Trader ID StringMinQtyMsgMinimum quantity needed to be immediately available at thelimit price for this order to be submitted into the marketExchange or gateway message describing the reason for anorder reject or order deleteIntegerStringTable 1. TTDropHandler Get attributes66 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


C Order Attributes TTOrderObj object attributesAttribute Description DataTypeOldOrderNoPrevious number used for the order, if the exchange created anew order numberStringOnHold Whether an order is on hold (out of the market) BooleanOpenCloseOpenClose$OrdActionWhether the order opens or closes a position. Possible valuesinclude:O: OpenC: CloseF: FIFOSpecifying OpenClose$ returns the corresponding full string.Note: The TOCOM Exchange changes the OpenClose value of afill corresponding to a FIFO order as either C (Close) or O(Open).Action associated with the order. Possible values include:ORD_ACTION_ADDORD_ACTION_CHANGEORD_ACTION_DELETEORD_ACTION_SUBMITORD_ACTION_HOLDORD_ACTION_REPLACEORD_ACTION_UNKNOWNStringStringOrderNo Order number assigned by the exchange. StringNote: For CME products, this property contains a differentrepresentation of the order number that matches the formatused by other exchanges. To see the actual order numberreceived from the CME, check the ExOrderID attribute.OrderQty Number of contracts contained in the order IntegerOrderRestrOrderSourceOrderSource$Restriction on the order. For a list of order restrictions, see thesection called Order restrictions, on page 637.Where the order originated:0: X_TRADER1: Autospreader Desktop2: Autotrader3: <strong>XTAPI</strong>4: Ext Source (Exchange)5: FA Licensed (Licensed FIX Adapter)6: FA Unlicensed (Unlicensed FIX Adapter)7: XT Lite (X_TRADER Lite)8: TT_TRADER9: Autospreader Engine10: Synthetic SE Engine11: TT API in X_TRADER Mode12: Algo SE21: TT API in Universal Login Mode22: ADLSpecifying OrderSource$ returns the corresponding string.StringAs specifiedTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 67<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderObj object attributes C Order AttributesAttribute Description DataTypeOrdStatusOrdStatus&Indication of the response to the most recent action performedon the order. Possible values include:As specifiedInteger String Description0 Void Default value8200 New New order released by client8201 Accepted Order accepted by the server8202 OK Order active in the market8203 XT Filled Order filled8204 Hold Order is on hold8205 Deleted Order has been deleted8206 Expired Order has expired8207 Rejected Order was rejected8208 Resubmitted Hold order was resubmitted8299 Unknown Order status could not be retrievedOrderTagOrderTraitsOrderTypeOrderType$OrigOrdActionUser-definable text (15 char max) containing user-definedinformation included in the corresponding order profile.Traits associated with the order as a concatenated stringcontaining the order status history, order flag, and orderrestriction.Type of order. Possible values include:B (OCO): OCO orderC (CMO): CMO orderL (Limit): Limit orderM (Mkt): Market orderO (BatchOrder): Batch orderQ (Quote): Quote orderS (BL): Best Limit order (TOCOM only)T (MTL): Market To Limit orderX (Cross): Cross orderThe text in parenthesis indicates the value associated with the$ suffix.Action specified in the original order submission, which mightdiffer from the current order action. For example, a Cancel/Replace order comprises two separate order actions: Deleteand Add. This attribute stores the original action (Replace, inthis example). Possible values include:ORD_ACTION_ADDORD_ACTION_CHANGEORD_ACTION_DELETEORD_ACTION_SUBMITORD_ACTION_HOLDORD_ACTION_REPLACEORD_ACTION_UNKNOWNStringStringStringStringParentKey Site order key identifying the parent order. StringTable 1. TTDropHandler Get attributes68 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


C Order Attributes TTOrderObj object attributesAttribute Description DataTypePricePrice#Price$Price&Order price.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksAs specifiedPriceCheck Whether price reasonability checking is enabled StringQty Number of contracts contained in the order IntegerRecoverableFailureWhether an order was rejected temporarily, but might succeedin the futureBooleanRiskAccount ID for the risk account StringSenderSender$SenderSubIDIP address of the machine that submitted the order, as aninteger or stringUnique trader (or operator) ID used to distinguish betweendifferent traders when the current MGT routes orders formultiple traders.Note: Some exchanges, such as CME, require clients to providethis information when routing orders on behalf of multipletraders.As specifiedString (32character limit)Series.getAttribute Value of the specified attribute in the TTInstrObj object VariousSeriesKeySiteKeySiteOrderKeySourceInternal ID that uniquely identifies the instrument contained inthe orderTT-generated static key that represents the order throughoutits lifetimeWhere the order originated:0: X_TRADER1: Autospreader Desktop2: Autotrader3: <strong>XTAPI</strong>4: Ext Source (Exchange)5: FA Licensed (Licensed FIX Adapter)6: FA Unlicensed (Unlicensed FIX Adapter)7: XT Lite (X_TRADER Lite)8: TT_TRADER9: Autospreader Engine10: Synthetic SE Engine11: TT API in X_TRADER Mode12: Algo SE21: TT API in Universal Login Mode22: ADLStringStringIntegerStopStop#Stop$Stop&Stop price.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksAs specifiedTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 69<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderObj object attributes C Order AttributesAttribute Description DataTypeTag(x) User-defined tag, where x is any integer StringTimeTime$TimeExchangeTimeExchange$TimeLocalUpdTimeLocalUpd$TimeProcessedTimeProcessed$TimeReceivedTimeReceived$TimeRoutedTimeRouted$Time the CoreAPI sent the order to the exchange, in the forms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.Time the exchange received the order. The time represents thelocal time at the exchange, in the forms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.Time the <strong>XTAPI</strong> received the order, in the forms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.Time the TT Gateway processed the order and sent it to theexchange, in the forms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.Time the TT Gateway received the order from the <strong>XTAPI</strong>, in theforms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.Time the <strong>XTAPI</strong> sent the order to X_TRADER ® , in the forms:Variant containing a COleDateTime structureHH:MM:SS:mmmThe value contains valid data only in the time portion of theCOleDateTime object.NOTE: These values exist only for the lifetime of yourapplication and are not visible to other applications.As specifiedAs specifiedAs specifiedAs specifiedAs specifiedAs specifiedTrader Trader ID of the trader from the Member/Group/Trader ID StringTriggerQtyUserData(x)UserTagMinimum traded quantity required for a stop to trigger at thespecified stop priceUser-defined tag, where x is any integerValid values: 0-1023User-definable text (15 char max) containing user-definedinformation included in the corresponding order profile.IntegerIntegerStringTable 1. TTDropHandler Get attributes70 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


C Order Attributes TTOrderObj object attributesAttribute Description DataTypeUsernameWrkWrkQtyTrader login. The value differs based on the type of credentialsused:For MGT-based logins, the value contains the concatenationof the Member, Group, and Trader attributes.For universal logins, the value contains the trader’s login IDOrder quantity that is working and has not been filledStringIntegerTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 71<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTOrderObj object attributes C Order Attributes72 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


DFill AttributesTTFillObj object attributesAbout the TTFillObjobjectThe <strong>XTAPI</strong> stores information about fills in the TTFillObj object. When the <strong>XTAPI</strong><strong>RTD</strong> <strong>Server</strong> requests information about a fill, the <strong>XTAPI</strong> looks for the attributesdefined for the object. You can request values for any of the TTFillObj objectattributes.Available attributesYou can access information about a fill with the following <strong>XTAPI</strong> TTFillObjattributes.Attribute Description DataTypeAccountType Code indicating the desired account type StringAcct Customer's or trader's account number StringAcctType Code indicating the desired account type StringBuy Number of contracts bought (same as Long) IntegerBuySellBuySell$ClearingDateType of order. Possible values include:B: BuyS: SellFor a buy order, BuySell returns B, while BuySell$ returns Buy.Clearing date for the fill, as specified by an Exchange. SomeExchanges, such as the TT SGX Gateway, use this attribute tosupport different dates for when a trade executes (DateExecattribute) and when the clearing firm clears the trade(ClearingDate attribute).StringCOleDateTimeClrMember Clearing Member ID StringCntrClearing Counter party trader’s Firm ID StringCntrMember Counter party trader’s Member ID StringComboCodeColorPriColorSecContractContract$Combination code for the fill. Possible values include:““ (empty string): Non-spread fillC: Calendar spreadF: All other spread fillsColor to display in the MD TRADER® working orders grid, where:ColorPri represents the order’s main color (right-side of thegrid)ColorSec represents the order’s secondary color (left-side ofthe grid)The value is an integer representing the RGB value of the color.The value corresponds to the Microsoft ColorRef data type.Instrument's name with expiration (e.g. ES Sep13)StringIntegerStringContract.objAttribute Object attribute for the attached instrument (TTInstrObj) VariousTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 73<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTFillObj object attributes D Fill AttributesAttribute Description DataTypeContractAlias Instrument's alias name with expiration (eg. E-Mini Sep13) StringDate Date of the order in MM/DD/YY (e.g. 03/18/13)The value contains valid data only in the date portion of theCOleDateTime object.DateExec Date the fill occurred in MM/DD/YY (e.g. 03/18/13)The value contains valid data only in the date portion of theCOleDateTime object.COleDateTimeCOleDateTimeEx:OrderNoOrder number for the specified exchange (eg. CME-S:107578464)StringExchange Name of the TT Gateway that sent the fill StringExGroup Exchange Group ID for the fill StringExMember Exchange Member ID for the fill StringExOrderID Exchange Order ID assigned to the fill StringNote: If the exchange does not provide a value, the X_TRADERAPI populates it with the OrderNo attribute value.ExRecNo Transaction ID provided by the exchange StringExTrader Exchange Trader ID for the fill StringExTransNo Transaction ID provided by the exchange StringFFT1FFT2FFT3Free-form text fields. FFT1 typically contains the account.StringFee Fee code for the fill. The fee codes are exchange-dependent. StringFillKey Fill ID supplied by the exchange StringFillTicks Total value of the fill in ticks IntegerFillTypeGiveUpType of fill. Possible values include:P: PartialF: FullGive-up member's clearing ID, when the fill is assigned toanother memberNote: The TT ICE Gateway does not support the GiveUpattribute; instead, it uses the ClrMember attribute for Give Uporders.StringStringGroup Group name of the trader from the Member/Group/Trader ID StringInstrInstr$Default instrument name, as displayed in the <strong>XTAPI</strong> MarketGrid Contract field (e.g., ES Sep13)StringInstrAlias Instrument's alias name with expiration (e.g. E-Mini Sep13) StringInstr.objAttributeValue of the specified object attribute for the relatedTTInstrObj objectNote: You can access only static, contract-related attributes,such as Contract, Expiry, and Exchange.VariousIsAON Whether the order is an All-Or-None order BooleanIsAuction Whether the order is only valid for auction BooleanTable 1. TTDropHandler Get attributes74 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


D Fill Attributes TTFillObj object attributesAttribute Description DataTypeIsAuto-AgressIsAuto-AggressIsAutomatedIsAwayMarketWhether the order is auto-aggressive(Currently supported only for BrokerTec)Whether the matching order orginated from an automatedprogram.Whether an away market maker should match BBO of an awaymarket(Currently supported only for BrokerTec)BooleanBooleanBooleanIsBasis Whether the fill represents a basis order BooleanIsBestLimit Whether the fill represents is a best limit order BooleanIsBlock Whether the fill represents a block order. BooleanIsBuy Whether the fill represents a buy order BooleanIsConfirmed Whether the fill is a confirmed fill BooleanIsDetailedSOD Whether the fill represents a detailed SOD record BooleanIsFAS Whether the fill represents a fill and save order BooleanIsFlex Whether the fill represents a flex option order BooleanIsFOK Whether the fill represents a fill or kill order BooleanIsIceberg Whether the fill represents an iceberg order BooleanIsIfTouchedIsInvertedWhether the order requires additional action when a price istouchedWhether the fill is canceled and that the trader’s position hasbeen adjusted to reflect the cancelled fillBooleanBooleanIsIOC Whether the fill represents an immediate-or-cancel order BooleanIsLOCIsLOOWhether the fill represents a market to limit order to be filled orkilled on market closeWhether the fill represents a market to limit order to be filled orkilled on market openBooleanBooleanIsLSM Whether the fill represents a limit-stop-market order BooleanIsLTMWhether the fill represents a limit order to be converted to amarket order on closeBooleanIsManualFill Whether the fill was entered as a manual fill BooleanIsMarketToLimit Whether the fill represents a market-to-limit order BooleanIsMLM Whether the fill represents a market-limit-market order BooleanIsMOC Whether the fill represents a market-on-close order BooleanIsMOO Whether the fill represents a market-on-open order BooleanIsMTL Whether the fill represents a market-to-limit order BooleanIsMV Whether the fill represents a minimum volume order BooleanIsNon-leaveWhether the fill represents a non-leave order(Currently supported only for BrokerTec)BooleanTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 75<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTFillObj object attributes D Fill AttributesAttribute Description DataTypeIsPassiveWhether the fill represents a passive(Currently supported only for BrokerTec)BooleanIsSell Whether the fill represents a sell order BooleanIsShortExemptWhether the fill represents a sell short order exempt fromnotificationBooleanIsSOD Whether the fill is a start-of-day fill BooleanIsStop Whether the fill represents a stop order BooleanIsTimed Whether the fill represents a timed order BooleanIsTriggered Whether the order has been triggered BooleanIsTriggeredTime Whether the order was triggered after a time submission BooleanIsVolatility Whether the fill represents a volatility order BooleanKeyLinkTypeInternal static key that represents the order throughout itslifetimeType of link identifying the relationship between orders. Valuesinclude:AlgoAlgoCAlgoLASASQASHASROCOOMASSESSECSSERStage-BKRStage-INTStage-UNKUNMNote: In some instances an order can have more than one linktype, separated by a comma (e.g. SSE, OCO).SiteOrderKeyStringLocation Order sender country and region code. StringLong Number of contracts bought (same as Buy) IntegerMember Member ID of the trader from the Member/Group/Trader ID StringNetQty Total quantity of contracts or shares executed for this fill IntegerNetTicks Total value of the fill in ticks IntegerTable 1. TTDropHandler Get attributes76 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


D Fill Attributes TTFillObj object attributesAttribute Description DataTypeOpenCloseOpenClose$OrderNoOrderRestrOrderSourceOrderSource$OrderTagOrderTraitsFor market fills, whether the fill opened or closed a position; forinjected fills, the source of an injected fill. Possible valuesinclude:A: XRisk AdminC: CloseD: Detailed SODF: FIFOM: Manual FillO: OpenR: RolloverS: SODNote: The TOCOM Exchange changes the OpenClose value of afill corresponding to a FIFO order as either C (Close) or O(Open).Order number assigned by the exchange. For CME products, thisproperty contains a different representation of the order numberthat matches the format used by other exchanges. To see theactual order number received from the CME, check theExOrderID attribute.Order restriction on the order.For a list of possible values, see Order restrictions, on page 636.Where the order originated:0: X_TRADER1: Autospreader Desktop2: Autotrader3: <strong>XTAPI</strong>4: Ext Source (Exchange)5: FA Licensed (Licensed FIX Adapter)6: FA Unlicensed (Unlicensed FIX Adapter)7: XT Lite (X_TRADER Lite)8: TT_TRADER9: Autospreader Engine10: Synthetic SE Engine11: TT API in X_TRADER Mode12: Algo SE21: TT API in Universal Login Mode22: ADLUser-definable text (15 char max) containing user-definedinformation included in the corresponding order profile.Traits associated with the order as a concatenated stringcontaining the order status history, order flag, and orderrestriction.StringStringStringInteger orStringStringStringTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 77<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTFillObj object attributes D Fill AttributesAttribute Description DataTypeOrderTypePartialPricePrice$Price#Price&Price@Price[Currency]Price^Type of order corresponding to the fill. Possible values include:B: OCO orderC: CMO orderL: Limit orderM: Market orderO: Batch orderQ: Quote orderS: Best Limit order (TOCOM only)T: Market To Limit orderX: Cross orderType of fill executed. Possible values include:F: Full fillP: Partial fillNote: A TT Eurex Gateway that enables Fast Fills does not setthis attribute to “F” for partial Fast Fills.When your application later reconciles its fills with the Eurex Fill<strong>Server</strong>, one of the partial fills marked as “P” will be changed to“F” to indicate which fill completely filled the order.Fill price.You can also use one of the following modifiers to display thevalue in a specific format:$ : X_TRADER display format# : Decimal value& : TicksFill price converted to the primary currency (as set in theGuardian currency tables).If you access this attribute before the currency table finishesloading, the attribute returns TT_INVALID_PRICE.Current market value of open positions in the currency whosecode you specify (Currency). Valid only when the instrument hasan attached TTOrderSet.Fill price converted to the native currency (as set in the Guardiancurrency tables)StringStringAs specifiedDecimalDecimalStringQty Number of contracts contained in the fill IntegerRiskAccount ID for the risk account StringSell Number of contracts sold (same as Short) IntegerSenderSubIDSeriesSeries$Series.objAttributeUnique trader (or operator) ID used to distinguish betweendifferent traders when the current MGT routes orders formultiple traders.Note: Some exchanges, such as CME, require clients to providethis information when routing orders on behalf of multipletraders.Unique ID for the instrument, provided by the exchangeValue of the specified object attribute for the instrument(TTInstrObj)String (32character limit)StringVariedTable 1. TTDropHandler Get attributes78 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


D Fill Attributes TTFillObj object attributesAttribute Description DataTypeSeriesKeyInternal ID that uniquely identifies the instrument contained inthe orderStringSessionId Session ID for the fill IntegerShort Number of contracts sold (same as Sell) IntegerSiteKeySiteOrderKeyInternal static key that represents the order throughout itslifetimeStringSOD Whether the fill represents a start-of-day record BooleanSODTypeSourceType of start-of-day message. Possible values include:“Start of Day”“Current”“Correction”Source of the fill. For normal fills, the value contains a unique IDfor the Fill server. For manual fills generated by an <strong>XTAPI</strong>application, the value contains an ID based on the systemrunning the application.StringStringTag(x) User-defined tag, where x is any integer. StringTimeTime$TimeExecTimeExec$TimeLocalUpdTimeLocalUpd$Time the X_TRADER API sent the order to the exchange, in theform HH:MM:SS:mmm.Time the exchanged matched the trade, in the formHH:MM:SS:mmm.Time the X_TRADER API received the fill, in the formHH:MM:SS:mmm.TimeStringTimeStringStringTrader Trader ID of the trader from the Member/Group/Trader ID. StringTTFillCodeUserData(x)UserTagUsernameFill code associated with the fill. Possible values include:1000: Normal fill1001: Fast Fill1002: Reverse Trade1003: Adjustment1004: Clearing Error1005: RolloverUser-defined tag, where x is any integer.Valid values: 0-1023User-definable text (15 char max) containing user-definedinformation included in the corresponding order profile.Trader login. The value differs based on the type of credentialsused:For MGT-based logins, the value contains the concatenationof the Member, Group, and Trader attributes.For universal logins, the value contains the trader’s login IDIntegerIntegerStringStringTable 1. TTDropHandler Get attributesX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong> 79<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


TTFillObj object attributes D Fill Attributes80 X_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong><strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


Send Us Your CommentsX_TRADER API <strong>RTD</strong> <strong>Server</strong> <strong>Feature</strong> <strong>Guide</strong> <strong>Feature</strong> <strong>Guide</strong>7.X<strong>Trading</strong> Technologies ® welcomes your comments and suggestions on the accuracy and usefulness ofthis publication. Your input is important and valuable in revising our documentation and helps ensurea constantly improving level of quality.• Did you find any errors?• Is the information clearly presented?• Do you need more information? If so, where?• Are the examples correct? Do you need more examples?• Which features did you find particularly useful?• What did you like most about this manual or document?If you encounter any errors in this document or would like to share other suggestions you might havefor improving this document, send comments to: documentation.dept@tradingtechnologies.com.If possible, please indicate the chapter, section, and page number relevant to your feedback.<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information


<strong>Trading</strong> Technologies International, Inc. Proprietary and Confidential Information

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!