Basket Trading Import Format |
Basic text formatThe import format consists of a pure text, ASCII format with:
The format is line-based, each line is terminated with a carriage return/line feed combination (CR/LF, ASCII #13/#10). The header and order lines have each name and value separated with tabular characters (Tab, ASCII #9). Comments and blank linesAny line in the import file can be an empty line or a comment line prefixed by a # character. Empty and comment lines are completely ignored during import, but can be useful to document the file for humans. HeaderThe first non-empty, non-comment line in the import file is interpreted as the header. The header consists of order property names separated by tab characters. The actual basket order values must follow the same order as the corresponding property names in the header. Legal property names are: Market, FeedID, Ticker, ISIN, Currency, ExchangeID, Position, Volume, OpenVolume, PriceSource, PriceDelta, Price, OrderType, Portfolio, ValidDays, Comment, ClientRef, Included, Weight, Custom1, Custom2, Custom3, Custom4, Custom5, Custom6 The specific format and legal values for each property will be listed below. Order valuesBelow the header comes the list of orders and their values. Each order is listed on a separate line and with values for each property in the header, separated by tab characters. Empty values are ignored. The following describes the format for each of the possible properties. Symbol identification fieldsA valid order must at least contain a combination of symbol identification fields. There are four different combinations of symbol identification fields that allow the system to find a specific symbol. FeedID and TickerTogether the FeedID and Ticker fields identify a symbol uniquely. This is the primary identification method in the system and can be used even if the symbols have not been pre-created in the client (by opening a Market window, for instance). FeedID is the three-letter abbreviation of the feed name that you will see in the Market window caption or in the Composite window’s Feed column. For instance, FeedID of the Oslo Stocks feed is OSS, Stockholm Stocks is SSE and Nasdaq Stocks is NSQ. The internal numeric value may also be used - for instance, 18187 for Oslo Stocks or 17921 for Stockholm Stocks. Ticker is the alphanumeric primary symbol code within a feed. For instance Norsk Hydro’s ticker is NHY, Ericsson B-shares is ERIC B and Microsoft is MSFT. Examples of valid values for FeedID and Ticker:
If the system you are importing from does not have or support FeedIDs or Ticker codes, you can use one of the alternative forms below. FeedID and ISINOne alternative set of identification fields is FeedID and ISIN. FeedID is described above. ISIN is an International Securities Identifying Number, a unique international code which identifies a securities issue. Because the same company can be traded at several exchanges using the same ISIN, we still need the FeedID field. For example, Norsk Hydro has the ISIN NO0005052605, Ericsson B-shares is ISIN SE0000108656 and Microsoft is US5949181045. Examples of valid values for FeedID and ISIN:
Market, ISIN and Currency Another alternative is to use the combination of three fields; Market (aka marketplace), ISIN and Currency. Marketplace is a general description of the trading platform that may span multiple feeds. For instance, a Market called ”r;Saxess” might span trading on the feeds Oslo Stocks, Stockholm Stocks and Copenhagen Stocks. Note that the exact names of the market names may vary depending on the trading provider you use. To uniquely identify a symbol within a marketplace ISIN (see description above) must be combined with the symbol’s trading Currency. Currency is a three-letter abbreviation such as NOK for Norwegian Kroner, SEK for Swedish Kroner or USD for United States Dollar. Examples of valid values for Market, ISIN and Currency:
Market and ExchangeIDFinally, an imported symbol can be identified by the combination of Market (aka. marketplace) and ExchangeID (aka. Code or ExchSym). As explained above Market is the name of the trading place (such as Saxess). ExchangeID is a (normally numeric) trading-specific ID that uniquely identifies a symbol within the trading place. For example, the ExchangeIDs for NHY and ERIC B is 15613 and 101, respectively. Note that not all markets and feeds support or use ExchangeIDs. Examples of valid values for Market and ExchangeID:
Volume and position fields The following three fields define the direction of the order (buy or sell), the total volume and the market-visible (open) volume. PositionThis property defines the order as a buy-order or a sell-order. If this property is not present, the sign of the Volume field determines the position. Legal values for Position are: pBuy, pSell VolumeThe Volume property is a numeric field that determines the number of shares or instruments that will be traded. Unless the Position field has been explicitly provided, the sign of the Volume field will decide if this is a buy or a sell order. Positive volumes are buy orders, negative volumes are sell orders. OpenVolumeIf present, OpenVolume sets the open volume of the order - the amount of the Volume that will be visible in the market at any time. Open volume is always given as a positive number that must be equal or less than Volume. Price fieldsThere are several flexible ways of determining the price that should be used for each order. The three following fields define the possibilities. PriceThis is the explicit price of the order. This is used when PriceSource is set to psCustom. PriceDeltaWhen you use a PriceSource other than psCustom, you can include a PriceDelta of how the calculated price should differ from the market price. PriceSourceIf you don’t provide a specific Price, you must provide a PriceSource to get the price value calculated from the current market price of the symbol. The possible values and their meaning are:
Other order fieldsOrderTypeThis field determines the type of the order. The default is a Normal (limit) order. The possible legal values depends on what order types your trading provider supports for the given symbol / feed. The total list of possible order types are: otNormal, otFillAndKill, otFillOrKill, otAllOrNothing, otCrossOrder, otBestPossible, otAtMarket, otMarket, otLimit, otMarketToLimit, tAtMarketAndKill, otRequestQuote, otFunari, otStopLimit, otStopLoss, otContingent, otFlex, otInterest, otAccept, otParent PortfolioThis is the name of the portfolio the order will be inserted into. If the Trading login has a single available portfolio, that will be used as default. Otherwise the portfolio configured under Tools | Trading will be used as default. Note that the Trading login must have access to the portfolio given by this property. ValidDaysThis field gives the valid until date for the order, specified in relative days. The default or 0 is today, 1 is until tomorrow, 2 is two days and so on. The import only supports relative dates. Using absolute dates would quickly make the dates invalid (as they would become in the past). CommentThis is a text field containing a comment for the order. ClientRefThis is a text field containing a client reference for the order. Custom order fieldsA specific trading provider may choose to define a number of custom trading fields for each marketplace. These fields may be used to define odd-lot orders, special order handling, etc. The number, names and valid values for these fields are defined in the trading server at the discretion of the trading provider. The Basket Trading window and the import function supports up to 6 such custom fields, named Custom1, Custom2, Custom3, Custom4, Custom5 and Custom6. In general these fields accept strings of the form ”r;Name=Value”, where Name is the descriptive name of the custom field (identical to the label shown for the custom field in the New Order window) and Value is one of the drop-down values or a free-text input value or numeric value. Note that the available custom fields are often different for different marketplaces. For instance, the available fields and valid values may be different for the Nordic and the American markets. The easiest way to see the available custom fields and valid values is to:
The Custom fields can be added as columns in the Basket Trading window by:
Basket order specific fieldsThe following fields are not used when sending the order to the market, instead they are used as helper fields when defining the orders in the basket itself. IncludedThis is a Boolean value (True/False or 1/0) that indicates if the order will be included in the basket when the basket is executed or not. WeightThis is a numeric value defining the weight of the order. The value is used when manually distributing a total value to all the orders in the Basket Trading window. Error handlingIf the file you try to import contains unknown property names (or the header is missing) or invalid values, you will be informed by a dialog box listing the errors. Even if an order has an invalid value for one property, the other values will be imported. Examples of import filesThe following section will list some examples of valid import files. Example #1This example shows the minimum set of three values that can be imported into valid orders:
Example #2This is an example that shows blank lines, comments and additional columns:
|