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
Overview
SDK Functionality
The MyTrack SDK enables you to access MyTrack™ services including real-time and delayed prices, historical prices,
and real-time news. The SDK is available for Windows 98, NT, and 2000.
Architecture
The MyTrack™ SDK is now available as a C/C++ callable library (myTrack.lib) OR as a dynamic-link library (myTrackDLL.lib / myTrackDLL.dll)
For dll info see the myTrack DLL description
The SDK is multitasked internally.
Your program will connect to a myTrack server and request data. Most of your requests will complete asynchronously.
In other words, your subroutine call will return back to you immediately. The data will come back at a later time (usually in a
few milliseconds). In a multi-threaded environment, you will be making requests via one or more threads, and you should have one
thread block on the receipt of data. You can also poll for the data by not blocking on the request for input, but you should keep
in mind that there is a finite number of input buffers. If you submit a request which might result in a stream of data (e.g.
intraday updates), you have to be sure to poll frequently enough to avoid running out of input buffers in the SDK and losing data.
All requests to the myTrack servers have a user-assigned request number (rqn) associated with them. When responses come back
from the server, the response will contain the rqn so that it can be matched up with the request that caused it.
The myTrack SDK insures that the connection to the server is alive by issuing regular heartbeat messages to the server, and
by listening for heartbeats from the server. This heartbeat is a function internal to the server and requires no action by the
applications programmer. If the SDK detects that an unacceptable time has elapsed between heartbeats, it will send a message to
the application program which can then respond appropriately. This is discussed in more detail later in this manual.
Installation
The installation package may be downloaded from the myTrack web site or the
PACT Consulting website. Select the SDK menu choice from the list on the left, choose
your platform and then go to the “downloads” section. The SDK site also contains development schedules, user registration, and
other useful information.
The Windows NT package is a self-extracting executable, so all you have to do is run it to extract the files within.
The installation package contains the following files:
| MyTrack.lib | the SDK library |
| MyTrackDLL.lib | dll import library |
| MyTrackDLL.dll | dynamic-link library (see myTrack DLL description) |
| MyTrack.h | SDK include file function prototypes have been removed |
| MyTrack_func.h | SDK include file, implicitly included by myTrack.h contains the function prototypes |
| MyTrack_funcPtr.h | SDK include file, used with myTrackDll Is implicitly included by myTrack.h when code defines: USING_MYTRACK_DLL |
| Mt_Test.cpp | a platform-independent SDK test program |
| Mt_Test.dsw | Windows NT workspace for the Mt_Test.cpp program |
| Mt_Test.doc | Windows NT project file for the Mt_Test.cpp program |
| MT_SDK.doc | Microsoft Word version of this document |
| MT_SDK.txt | text version of this document |
| Sdkdem1.exe | self-extracting file containing a Windows NT SDK demo |
| Sdkdem2.exe | self-extracting file containing a Windows NT SDK demo |
Getting Started
To run an SDK application you need a valid myTrack ID, with the SDK feature enabled. If you don't already
have a myTrack ID - download myTrack and register as a basic user.
Follow the instructions on the myTrack website to install and start your myTrack program. After you have connected to
the server, go into the “chat” window. Select “administrative”/”credit card” to enter your credit card (as described
below, you can try the SDK for free for 30 days). Then go back to the chat menu bar and select “entitlements”/”features”
and enable the SDK feature.
Fees are posted on the myTrack website. We will not bill your credit
card for 30 days - if you are not happy with the service, cancel it before the 30 days are up.
Important: If you do not cancel before the end of the 30 day trial period, your credit card will be billed.
Running the Windows NT Demos
The Windows NT MFC demo program mtDemo is contained in file sdkdem1.exe. To extract the components
of this demo, simply run sdkdem1.exe and place the files extracted into a folder. Double click on mtDemo.dsw
to start the VC++ programming environment.
Note The following changes will have to be made in order to run the demos:
SdkDem1 (mfc project):
- You’ll have to put a copy of myTrack.h in the file containing the project
- Change line 420 in mtDemoDlg.cpp from:
i = mtRequestNewsByTicker(NewsRqn,(char *)(LPCTSTR)NewsSym);
to:
i = mtRequestNewsByTicker(NewsRqn,(char *)(LPCTSTR)NewsSym, 0);
- In the Project, add the full path of myTrack.lib to the link setting (Project/Setting/Link)
After you have successfully built the program, running it is straightforward. Enter your username & password, then
hit the “Logon” button. A dialog box will appear after a successful logon. You can ask for quotes, historical data or news
headlines by entering a stock symbol in the appropriate input box and hitting the button for the desired data. Output will
appear in the list box below the button.
Programming Basics:
- Call the mtInit() function to initialize the myTrack SDK environment.
- Call the mtConnectToServer() function to connect to the myTrack server.
- Call the mtRequestLogon() function to log on to the server.
Note: you must logon within 10 seconds of the connect.
- Wait for the login response to be returned via mtGetmessage().
- Call the various request functions your application requires.
(i.e. RequestIntradayUpdate to get dynamically updated ticks)
- Handle corresponding response Event(s) from the server.
(i.e.GotIntraday)
- Call RequestLogoff when program is terminated.
Important
- You must logon (mtRequestLogon()) within 10 seconds of the connection (mtConnectToServer()).
- Make sure to handle disconnects (MSG_ERROR_REPORT, error = MT_ERR_DISCONNECT ) message from server by reconnecting,
logging in, and re-issuing outstanding requests.
- All request methods have a rqn parameter
this rqn is returned in the responding Event
the rqn provides 2 capabilities:
- Allows you to match responses to their original requests
- Identifying dynamic requests to the server so that the dynamic request can later be stopped
(see RequestNewsHeadlines & RequestIntradayUpdate)
Warning: an rqn may not have a value of 0.
Function Summary
| Init | initialize the SDK |
| ConnectToServer | connect to MyTrack™ host |
| RequestLogon | requests logon to host |
| RequestLogoff | requests logoff from host |
| RequestBackground | requests background info for given ticker |
| RequestQuote | requests quotation for given ticker |
| RequestIntradayUpdate | request to start/stop dynamic ticker updates |
| RequestHistory | requests historical pricing data |
| RequestNewsHeadlines | request to start/stop dynamic news headlines |
| RequestNewsByTicker | requests all the news headlines for a specific ticker |
| RequestNewsStory | requests a specific news story |
| RequestNewsVendors | requests all news vendor codes and descriptions |
| RequestSymbolLookup | lookup a company name for symbol or vice versa |
| RequestOptionData | request list of available options |
| RequestOptionLinks | request list of option roots for LEAPs & wraps |
| RequestFutureFamilyData | requests quotes on all futures |
| RequestIntradayData | start or stop streaming updates for symbol |
| RequestDataWarehouse | data warehousing request |
| RequestTransactionLog | requests transaction history for today |
| RequestYesterdaysLogs | requests yesterday’s time & sales log |
| RequestNasdaqLevel_2 | starts & stops Nasdaq level 2 for symbol |
| RequestNewsByVendor | gets news headlines by vendor |
| RequestHistoricalNews_Ticker | gets historical news for a symbol |
| RequestHistoricalNews_Story | gets a historical story’s text |
| 3rdParty_MarketPulse | requests Market Pulse display |
| 3rdParty_EdgarOnline | requests Edgar Online |
| 3rdParty_ HemingtonScott | requests Hemmington Scott |
| RequestVolatilityDisplay | requests historic & current volatilities |
| RequestCompositeFamilyData | requests a composite quote |
Broker Functions
| BrokerUseContest | turns contest mode on |
| BrokerUseRealAcct | turns contest mode off |
| BrokerRequestAcctIDs | requests account ID's |
| BrokerRequestAcctSummary | requests summary of account value |
| BrokerRequestAcctPositions | requests list of all positions |
| BrokerCashTransactions | requests all cash transactions |
| BrokerEnterOrder | enters a new order |
| BrokerCancelOrder | cancels an open order |
| BrokerRequestTransactionData | request all account transactions |
| BrokerRequestOrder | requests all orders |
Complete Documentation Table of Contents
SDK Functions