Contact Us   Site Map
myTrack SDK FX - Tools Services Partners
C Docs
Overview
Functions
Brokerage
Appendix
C/C++
C Home
Downloads
Docs (html)
Platforms
Visual Basic
C/C++
Java
General
General Info
Resources
Billing
FAQ
Support
myTrack SDK Documentation

myTrack SDK
Programmer’s Reference
Version 3.00

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 CodesSales Codes
Error codesBrokerage error codes
myTrack DLL descriptionRevision History
Documentation Table of Contents


Appendix A
Market Codes
Char values are used in: Quote, Future, Option and Intraday Update.
Numerical values used in Background.
CHARNUMDescription
H0 CBOE
A1 AMEX
P2 PACIFIC
X3 PHILADELPHIA
N4 NEW YORK
B5 BOSTON
@6 TRACK DATA
M7 MIDWEST
S8 NASDAQ
T9 TORONTO
!10LONDON AUTOQUOTE OPTIONS
A11AMEX
-12INSTINET
-13OPRA
O14MONTREAL
V15VANCOUVER
E16ALBERTA
L17LONDON (SEAQ 1 DOMESTIC)
Z18SWISS STK EX (ZURICH BASLE GENEVA)
W20OPTION MARKET LONDON (SWEDEN)
Q21SEAQ LEVEL I INTERNATIONAL
U22EOE
R23FRANKFURT
-24DTB (GERMAN OPTION EXCHANGE)
F25PARIS STOCK EXCHANGE
-26IN FRANCE
J27TOKYO STOCK EXCHANGE
K28OSAKA STOCK EXCHANGE
329IBIS (GERMANY)
430AMSTERDAM STOCK EXCHANGE
-31
-32
-33CHICAGO BOARD OF TRADE
-34CHICAGO MERCANTILE EXCHANGE (CME)
035MATIF
-36COMMODITY EXCHANGE OF NEW YORK
-37SIMEX
-38TIFFE
-39KANSAS BOARD OF TRADE
-40MINNISOTA GRAIN EXCHANGE
-41MIDAM COMMODITIES EXCHANGE (MCE)
-42LIFFE - LONDON FUTURES
-43KNIGHT RIDDER FUTURES & CASH
-44MONEP
-45SOFFEX
-46WINNIPEG COMMODITIES EXCHANGE
-47LONDON FOX EXCHANGE
-48LTOM (LONDON OPTION EXCHANGE)
-49LONDON METAL EXCHANGE
-50INTERNATIONAL PETROLIUM EXCHANGE
-51NEW YORK MERCANTILE EXCHANGE (NYMEX)
152MEFF RV (SPANISH EQUITIES)
253MILAN
554MEXICO
G55BROKER TO BROKER (JAPAN)
756JASDAQ (JAPAN)
-57COFFEES SUGAR ETC (CSCE-NYFE)
D58OTC NON-NASDAQ
859OTC BULLETIN BOARD
960HONG KONG
-61MEFF (SPANISH FUTURES)
I62WINNIPEG STOCK EXCHANGE


Appendix B
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:
AACQUISITION BBUNCH TRADE (NASDAQ only)
CCASH SALE DDISTRIBUTION
KAMEX RULE 155 LSOLD LAST
NNEXT DAY OOPENED
P(Reserved) RSELLER (See also "D")
SSPLIT TRADE TFORM-T (NASDAQ only)
ZSOLD @NORMAL SALE

FOR STOCK QUOTES:
Default for most exchanges:
ADEPTH ON OFFER BDEPTH ON BID
CCLOSING DNEWS DISSEMINATION
FFAST TRADING GPREDICTED OPENING RANGE
HDEPTH ON BID AND OFFER
IORDER IMBALANCE LCLOSED MARKET MAKER (NASD)
NNON-FORM QUOTE OOPENING QUOTE
PNEWS PENDING RREGULAR (NASD OPEN)
STRADING HALT DUE TO RELATED SECURITY
TRESERVED (PHLX)
VTRADING HALT IN VIEW OF COMMON
XEQUIPMENT CHANGEOVERZNO 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:
ValueDescriptionDisplay
0GENERAL_QUOTE_INDNo indicator or '*'
1WARNING_QUOTE_INDW
2MARKET_QUOTE_INDM
3SPECIAL_QUOTE_INDS
4OMISSION_QUOTE_INDO
5NO_QUOTE_INDN
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:
ACANCEL PREVIOUS BOUT OF SEQUENCE (LATE)
CCANCEL LAST DLATE (IN SEQUENCE)
ECANCEL OPENING FOPEN (LATE,OUT OF SEQUENCE)
GCANCEL ONLY TRADE HOPEN (LATE, IN SEQUENCE)
IELECTRONIC TRADE JREOPEN
KADJUSTMENT LSPREAD
MSTRADDLE NSTOPPED
OCANCEL STOPPED <SPACE>NORMAL SALE

i = CORRECTED SPECIAL SALE CONDITION INDICATOR.



Appendix C
Error codes
Client side error codes - will be returned on a API call.

0MT_ERR_NO_ERRORno error
-1MT_ERR_WSAerror on WSAStartup
-2MT_ERR_NO_Qcould not init queues
-3MT_ERR_NO_MALLOCcould not malloc queue elements
-4MT_ERR_NO_SOCKETcould not get a socket
-5MT_ERR_NO_FIND_IP_ADDRcannot find sdk.trackdata.com ip address
-6MT_ERR_NO_CONNECTcould not connect to myTrack
-7MT_ERR_INPUT_THREADcould not start input thread
-8MT_ERR_OUTPUT_THREADcould not start output thread
-9MT_ERR_TIMER_THREADcould not start timer thread
-10MT_ERR_INIT_NOT_CALLEDyou did not call mtInit
-11MT_ERR_NOT_CONNECTEDyou are not connected to a myTrack server
-12MT_ERR_NO_MESSAGEthere is no message right now
-13MT_ERR_SPARE2you are already logged on
-14MT_ERR_ARG_LENGTH# of bytes of an argument is invalid
-15MT_ERR_NO_OUTPUT_Q_LINKScould not send a msg - ran out of queue links
-16MT_ERR_OUT_MSG_TOO_LARGETDC problem - contact Support
-17MT_ERR_IN_MSG_TOO_LARGETDC problem - contact Support
-18MT_ERR_DISCONNECTconnection was disconnected
-19MT_ERR_NO_HB_FROM_SERVERno heart beat from server
-20MT_ERR_INVALID_ARGUMENTpassed to the api routine
-21MT_ERR_INVALID_ACCT_IDpassed to a brokerage api routine
-22MT_ERR_DEINIT_CALLEDcannot call any api function

Server side Error Codes - will be returned as "error" in the data message
0MTS_ERR_NO_ERRORno error
1MTS_ERR_NO_ROOMno more room for connection. this error will be sent back (mc=0) upon the tcp/ip connection, before you call mtConnectToServer().
2MTS_ERR_UNKNOWN_CONNECTIONunknown connection
3MTS_ERR_TOO_MANY_CONNECTIONStoo many connections open. currently up to 4 connections from the same IP address allowed.
4MTS_ERR_NO_HEART_BEATno heartbeat received - disconnecting (mc=2)
5MTS_ERR_INVALID_ACCTinvalid account-password
7MTS_ERR_NO_SUCH_TICKERticker not on database
8MTS_ERR_NOT_LOGONyou did not logon
9MTS_ERR_LOGON_ALREADYyou logged on already
10MTS_ERR_TOO_MANY_REQUESTStoo many requests outstanding
11MTS_ERR_DB_NOT_AVAILABLEdatabase requested is temporarily not available. If condition persists please contact SDK Support.
12MTS_ERR_NO_ACTIVITYno activity in a while - connection will be closed reconnect when you need more data.
13MTS_ERR_DB_ERRORdatabase error, with your request, database is probably ok
14MTS_ERR_NO_DATAno data available for the ticker requested
15MTS_ERR_NO_PRIOR_REQUESTno prior request
16MTS_ERR_INVALID_REQUESTinvalid request (check your parameters)
17MTS_ERR_UNKNOWN_REQUESTno such request (invalid messageCode)
18MTS_ERR_TOO_MANY_LINES# of lines of data requested exceeds system max
19MTS_ERR_UNKNOWN_RQNunknown request # (rqn)
20MTS_ERR_INVALID_RQNrqn of 0 is invalid
21MTS_ERR_TOO_MANY_CONCURRENTtoo many concurrent requests
22MTS_ERR_INVALID_VERSIONyour version # is no longer supported
23MTS_ERR_WAREHOUSE_NOT_AVAILABLEdata warehouse system not available
25MTS_ERR_TDS_NOT_AVAILABLEtds data base not available
26MTS_ERR_WAREHOUSE_GETdata request (get) for key specified not found
27MTS_ERR_WAREHOUSEdata warehouse error on access to data base
28MTS_ERR_WAREHOUSE_PUTdata warehouse error on put to data base
30MTS_ERR_PROFILEprofile data base error
31MTS_ERR_NO_OPTIONSsecurity has no options
32MTS_ERR_NO_FUTURESsecurity has no futures
33MTS_ERR_NO_COMPOSITEsecurity has no composite markets
34MTS_ERR_NO_OTC_BBsecurity not on otc bb
35MTS_ERR_NO_TRADEcould not forward trade request to db server
39MTS_ERR_FILEfile does not exist
42MTS_ERR_NO_SDK_FEATURESDK feature not enabled
43MTS_ERR_NO_SDK_REGISTRATIONyou did not register for the SDK - we cross check your username if it's on file

Brokerage Error Codes
0no error8closing non-existing position
1database error9closing more than your position
2order error10option purchase more than 50% of open interest
3cannot sell short in this account11stock purchase more than 20% of yesterdays volume
4cannot sell what you don't own12not enough buying power, including open orders
5cannot buy to cover what you don't sell short13mismatched inst type
6not enough buying power, for this order14contest invalid order type
7no such security




Appendix D
myTrack DLL description
The SDK is available as a dynamic-link library (DLL):
MyTrackDLL.dllthe dynamic-link library

The following supplementary files are also included:
MyTrack_funcPtr.hinclude 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


Appendix E
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
SDK FunctionalityArchitecture
InstallationGetting Started
Running the Windows NT DemosProgramming Basics
Function Summary

getVersion() (2.41)mtGetVersion() (3.00)
mtInit()mtDeInit()
mtSetHost()mtSetProxy()
mtSetUsingTunnel()mtIsConnected()
mtConnectToServer()mtDisconnect()
mtGetMessage()mtGetStats()
mtRequestLogon()mtRequestLogoff()
mtRequestHistoricalData()mtRequestQuoteData()
mtRequestBackground()mtRequestIntradayUpdate()
mtRequestNewsHeadlines()mtRequestNewsByTicker()
mtRequestNewsStory()mtRequestNewsVendors()
mtRequestSymbolLookup()mtRequestOptionData()
mtRequestOptionLinks()mtRequestFutureFamilyData()
mtRequestIntradayData()mtRequestIntradayDataTime()
mtRequestDataWarehouse()mtRequestTransactionLog()
mtRequestNasdaqLevel_2()mtRequestOrderBook()
mtRequestNewsByVendor()mtRequestHistoricalNews_Ticker()
mtRequestHistoricalNews_Story()mt3rdParty_MarketPulse()
mt3rdParty_ZacksEarnings()mt3rdParty_EdgarOnline()
mt3rdParty_ HemingtonScott()mtRequestVolatilityDisplay()
mtRequestCompositeFamilyData()mtRequestYesterdaysLogs()

mtBrokerUseContest()mtBrokerUseRealAcct()
mtBrokerRequestAcctIDs()mtBrokerRequestAcctSummary()
mtBrokerRequestAcctPositions()mtBrokerCashTransactions()
mtRequestMarketMakers()mtBrokerEnterOrder()
Brokerage Order Response MessagesMtBrokerEnterCondOrder()
mtBrokerCancelOrder()mtBrokerRequestTransactionData()
mtBrokerRequestOrder()