PACT Consulting
12/07/2001
For a description of this version’s enhancements see ‘Version 3.00 Enhancements
See running the windows NT demos for important information about running the demo programs
Please report bugs, enhancements or suggestions to sdksupport@pactconsulting.com
Contents
Appendices
Market Codes
Char values are used in: Quote, Future, Option and Intraday Update.
Numerical values used in Background.
| CHAR | NUM | Description |
| H | 0 | CBOE |
| A | 1 | AMEX |
| P | 2 | PACIFIC |
| X | 3 | PHILADELPHIA |
| N | 4 | NEW YORK |
| B | 5 | BOSTON |
| @ | 6 | TRACK DATA |
| M | 7 | MIDWEST |
| S | 8 | NASDAQ |
| T | 9 | TORONTO |
| ! | 10 | LONDON AUTOQUOTE OPTIONS |
| A | 11 | AMEX |
| - | 12 | INSTINET |
| - | 13 | OPRA |
| O | 14 | MONTREAL |
| V | 15 | VANCOUVER |
| E | 16 | ALBERTA |
| L | 17 | LONDON (SEAQ 1 DOMESTIC) |
| Z | 18 | SWISS STK EX (ZURICH BASLE GENEVA) |
| W | 20 | OPTION MARKET LONDON (SWEDEN) |
| Q | 21 | SEAQ LEVEL I INTERNATIONAL |
| U | 22 | EOE |
| R | 23 | FRANKFURT |
| - | 24 | DTB (GERMAN OPTION EXCHANGE) |
| F | 25 | PARIS STOCK EXCHANGE |
| - | 26 | IN FRANCE |
| J | 27 | TOKYO STOCK EXCHANGE |
| K | 28 | OSAKA STOCK EXCHANGE |
| 3 | 29 | IBIS (GERMANY) |
| 4 | 30 | AMSTERDAM STOCK EXCHANGE |
| - | 31 | |
| - | 32 | |
| - | 33 | CHICAGO BOARD OF TRADE |
| - | 34 | CHICAGO MERCANTILE EXCHANGE (CME) |
| 0 | 35 | MATIF |
| - | 36 | COMMODITY EXCHANGE OF NEW YORK |
| - | 37 | SIMEX |
| - | 38 | TIFFE |
| - | 39 | KANSAS BOARD OF TRADE |
| - | 40 | MINNISOTA GRAIN EXCHANGE |
| - | 41 | MIDAM COMMODITIES EXCHANGE (MCE) |
| - | 42 | LIFFE - LONDON FUTURES |
| - | 43 | KNIGHT RIDDER FUTURES & CASH |
| - | 44 | MONEP |
| - | 45 | SOFFEX |
| - | 46 | WINNIPEG COMMODITIES EXCHANGE |
| - | 47 | LONDON FOX EXCHANGE |
| - | 48 | LTOM (LONDON OPTION EXCHANGE) |
| - | 49 | LONDON METAL EXCHANGE |
| - | 50 | INTERNATIONAL PETROLIUM EXCHANGE |
| - | 51 | NEW YORK MERCANTILE EXCHANGE (NYMEX) |
| 1 | 52 | MEFF RV (SPANISH EQUITIES) |
| 2 | 53 | MILAN |
| 5 | 54 | MEXICO |
| G | 55 | BROKER TO BROKER (JAPAN) |
| 7 | 56 | JASDAQ (JAPAN) |
| - | 57 | COFFEES SUGAR ETC (CSCE-NYFE) |
| D | 58 | OTC NON-NASDAQ |
| 8 | 59 | OTC BULLETIN BOARD |
| 9 | 60 | HONG KONG |
| - | 61 | MEFF (SPANISH FUTURES) |
| I | 62 | WINNIPEG STOCK EXCHANGE |
Sales Codes
Used in Trans Log
I = SPECIAL SALE/QUOTE CONDITION INDICATOR
FOR STOCK SALES:
High bit flags the SIAC 'STOPPED' indicator.
Lower 7 bits:
| A | ACQUISITION | B | BUNCH TRADE (NASDAQ only) |
| C | CASH SALE | D | DISTRIBUTION |
| K | AMEX RULE 155 | L | SOLD LAST |
| N | NEXT DAY | O | OPENED |
| P | (Reserved) | R | SELLER (See also "D") |
| S | SPLIT TRADE | T | FORM-T (NASDAQ only) |
| Z | SOLD | @ | NORMAL SALE |
FOR STOCK QUOTES:
Default for most exchanges:
| A | DEPTH ON OFFER | B | DEPTH ON BID |
| C | CLOSING | D | NEWS DISSEMINATION |
| F | FAST TRADING | G | PREDICTED OPENING RANGE |
| H | DEPTH ON BID AND OFFER |
| I | ORDER IMBALANCE | L | CLOSED MARKET MAKER (NASD) |
| N | NON-FORM QUOTE | O | OPENING QUOTE |
| P | NEWS PENDING | R | REGULAR (NASD OPEN) |
| S | TRADING HALT DUE TO RELATED SECURITY |
| T | RESERVED (PHLX) |
| V | TRADING HALT IN VIEW OF COMMON |
| X | EQUIPMENT CHANGEOVER | Z | NO OPEN/NO RESUME |
For Japanese stock quotes:
The byte is split into 2 nibbles. The high for the bid, low for the ask. The value in the nibble indicates
the respective condition as follows, and is generally displayed with the indicated letter:
| Value | Description | Display |
| 0 | GENERAL_QUOTE_IND | No indicator or '*' |
| 1 | WARNING_QUOTE_IND | W |
| 2 | MARKET_QUOTE_IND | M |
| 3 | SPECIAL_QUOTE_IND | S |
| 4 | OMISSION_QUOTE_IND | O |
| 5 | NO_QUOTE_IND | N |
If both bid and ask are GENERAL, then show nothing, otherwise show a '*' for the one that's GENERAL
in a 2 char field. E.G. General Bid, Special Ask, show '*S'.
FOR OPTION SALES:
| A | CANCEL PREVIOUS | B | OUT OF SEQUENCE (LATE) |
| C | CANCEL LAST | D | LATE (IN SEQUENCE) |
| E | CANCEL OPENING | F | OPEN (LATE,OUT OF SEQUENCE) |
| G | CANCEL ONLY TRADE | H | OPEN (LATE, IN SEQUENCE) |
| I | ELECTRONIC TRADE | J | REOPEN |
| K | ADJUSTMENT | L | SPREAD |
| M | STRADDLE | N | STOPPED |
| O | CANCEL STOPPED | <SPACE> | NORMAL SALE |
i = CORRECTED SPECIAL SALE CONDITION INDICATOR.
Error codes
Client side error codes - will be returned on a API call.
| 0 | MT_ERR_NO_ERROR | no error |
| -1 | MT_ERR_WSA | error on WSAStartup |
| -2 | MT_ERR_NO_Q | could not init queues |
| -3 | MT_ERR_NO_MALLOC | could not malloc queue elements |
| -4 | MT_ERR_NO_SOCKET | could not get a socket |
| -5 | MT_ERR_NO_FIND_IP_ADDR | cannot find sdk.trackdata.com ip address |
| -6 | MT_ERR_NO_CONNECT | could not connect to myTrack |
| -7 | MT_ERR_INPUT_THREAD | could not start input thread |
| -8 | MT_ERR_OUTPUT_THREAD | could not start output thread |
| -9 | MT_ERR_TIMER_THREAD | could not start timer thread |
| -10 | MT_ERR_INIT_NOT_CALLED | you did not call mtInit |
| -11 | MT_ERR_NOT_CONNECTED | you are not connected to a myTrack server |
| -12 | MT_ERR_NO_MESSAGE | there is no message right now |
| -13 | MT_ERR_SPARE2 | you are already logged on |
| -14 | MT_ERR_ARG_LENGTH | # of bytes of an argument is invalid |
| -15 | MT_ERR_NO_OUTPUT_Q_LINKS | could not send a msg - ran out of queue links |
| -16 | MT_ERR_OUT_MSG_TOO_LARGE | TDC problem - contact Support |
| -17 | MT_ERR_IN_MSG_TOO_LARGE | TDC problem - contact Support |
| -18 | MT_ERR_DISCONNECT | connection was disconnected |
| -19 | MT_ERR_NO_HB_FROM_SERVER | no heart beat from server |
| -20 | MT_ERR_INVALID_ARGUMENT | passed to the api routine |
| -21 | MT_ERR_INVALID_ACCT_ID | passed to a brokerage api routine |
| -22 | MT_ERR_DEINIT_CALLED | cannot call any api function |
Server side Error Codes - will be returned as "error" in the data message
| 0 | MTS_ERR_NO_ERROR | no error |
| 1 | MTS_ERR_NO_ROOM | no more room for connection. this error will
be sent back (mc=0) upon the tcp/ip connection, before you call mtConnectToServer(). |
| 2 | MTS_ERR_UNKNOWN_CONNECTION | unknown connection |
| 3 | MTS_ERR_TOO_MANY_CONNECTIONS | too many connections open. currently
up to 4 connections from the same IP address allowed. |
| 4 | MTS_ERR_NO_HEART_BEAT | no heartbeat received - disconnecting (mc=2) |
| 5 | MTS_ERR_INVALID_ACCT | invalid account-password |
| 7 | MTS_ERR_NO_SUCH_TICKER | ticker not on database |
| 8 | MTS_ERR_NOT_LOGON | you did not logon |
| 9 | MTS_ERR_LOGON_ALREADY | you logged on already |
| 10 | MTS_ERR_TOO_MANY_REQUESTS | too many requests outstanding |
| 11 | MTS_ERR_DB_NOT_AVAILABLE | database requested is temporarily not
available. If condition persists please contact SDK Support. |
| 12 | MTS_ERR_NO_ACTIVITY | no activity in a while - connection will be closed reconnect when you need more data. |
| 13 | MTS_ERR_DB_ERROR | database error, with your request, database is probably ok |
| 14 | MTS_ERR_NO_DATA | no data available for the ticker requested |
| 15 | MTS_ERR_NO_PRIOR_REQUEST | no prior request |
| 16 | MTS_ERR_INVALID_REQUEST | invalid request (check your parameters) |
| 17 | MTS_ERR_UNKNOWN_REQUEST | no such request (invalid messageCode) |
| 18 | MTS_ERR_TOO_MANY_LINES | # of lines of data requested exceeds system max |
| 19 | MTS_ERR_UNKNOWN_RQN | unknown request # (rqn) |
| 20 | MTS_ERR_INVALID_RQN | rqn of 0 is invalid |
| 21 | MTS_ERR_TOO_MANY_CONCURRENT | too many concurrent requests |
| 22 | MTS_ERR_INVALID_VERSION | your version # is no longer supported |
| 23 | MTS_ERR_WAREHOUSE_NOT_AVAILABLE | data warehouse system not available |
| 25 | MTS_ERR_TDS_NOT_AVAILABLE | tds data base not available |
| 26 | MTS_ERR_WAREHOUSE_GET | data request (get) for key specified not found |
| 27 | MTS_ERR_WAREHOUSE | data warehouse error on access to data base |
| 28 | MTS_ERR_WAREHOUSE_PUT | data warehouse error on put to data base |
| 30 | MTS_ERR_PROFILE | profile data base error |
| 31 | MTS_ERR_NO_OPTIONS | security has no options |
| 32 | MTS_ERR_NO_FUTURES | security has no futures |
| 33 | MTS_ERR_NO_COMPOSITE | security has no composite markets |
| 34 | MTS_ERR_NO_OTC_BB | security not on otc bb |
| 35 | MTS_ERR_NO_TRADE | could not forward trade request to db server |
| 39 | MTS_ERR_FILE | file does not exist |
| 42 | MTS_ERR_NO_SDK_FEATURE | SDK feature not enabled |
| 43 | MTS_ERR_NO_SDK_REGISTRATION | you did not register for the SDK - we cross check your username if it's on file |
Brokerage Error Codes
| 0 | no error | 8 | closing non-existing position |
| 1 | database error | 9 | closing more than your position |
| 2 | order error | 10 | option purchase more than 50% of open interest |
| 3 | cannot sell short in this account | 11 | stock purchase more than 20% of yesterdays volume |
| 4 | cannot sell what you don't own | 12 | not enough buying power, including open orders |
| 5 | cannot buy to cover what you don't sell short | 13 | mismatched inst type |
| 6 | not enough buying power, for this order | 14 | contest invalid order type |
| 7 | no such security |
myTrack DLL description
The SDK is available as a dynamic-link library (DLL):
| MyTrackDLL.dll | the dynamic-link library |
The following supplementary files are also included:
| MyTrack_funcPtr.h | include file for the dll, loads the dll and
initializes the (using ‘explicit’ / ‘dynamic load’ or ‘run-time’ dynamic linking). This file will be included by myTrack.h
(the standard include file) by adding the following line to your code: #define USING_MYTRACK_DLL |
The demo application mt_test can be used to test the DLL:
- Change the Project Settings (Settings/Links/General: remove myTrack.lib
- Add the following line to the beginning of mt_test.cpp:
#define USING_MYTRACK_DLL
- Make sure MyTrackDLL.dll and MyTrack_funcPtr.h are in the in the path or the same directory as the executable
Revision History
Version 2.1
Changes To Previous Function Definitions and Structures
OPTION_PACKET structure:
exchangeRoot changed from int to char[4]
New Functions for Version 2.1:
Version 2.2
Changes To Previous Function Definitions and Structures
SYMBOL_LOOKUP structure:
'spare' member changed to 'nob' (type remains as char)
New Functions for Version 2.2:
Version 2.3
New Functions for Version 2.3:
Version 2.4
New Functions for Version 2.4:
Other Enhancements:
fixed BROKERAGE_TRANSACTIONS transTime
fixed ACCT_POSITION long/short
added BACKGROUND lotsize
Version 2.41
New functions for Version 2.41:
Other Enhancements:
compatible with TrackData domain name
produced a “dynamic-link library” (DLL) version of the SDK
added ‘turnaround’ to BROKER_ORDER struc, for mapping ACK messages to requests
fixed bug in mtDeinit()
Changed to release version of Lib
Added documentation for specifying brokerage order routing
MyTrack.h
Function prototypes removed
MyTrack_func.h
New include file contains function prototypes
This file is implicity included by myTrack.h
MyTrack_funcPtr.h
New include file for DLL
See
Appendix D for dll instructions
Version 3.00
Version 3.00 Enhancements:
Firewall Tunnelling:
This release has embedded TunnelThru™ Firewall tunneling software. This will allow SDK users to
run applications behind corporate firewalls. If the firewall does not also use a proxy server then no coding changes are
required. Otherwise you must specify the proxy server to the SDK software. See
mtSetProxy()
and
mtSetUsingTunnel() for details.
New functions:
Other Enhancements & bug fixes:
mtRequestIntradayDataTime() is now included in the dll version of the SDK.
Complete Documentation Table of Contents
Overview