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

Overview
SDK FunctionalityArchitecture
InstallationGetting Started
Running the Windows NT DemosProgramming Basics
Function SummaryDocumentation Table of Contents

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.libthe SDK library
MyTrackDLL.libdll import library
MyTrackDLL.dlldynamic-link library (see myTrack DLL description)
MyTrack.hSDK include file
function prototypes have been removed
MyTrack_func.hSDK include file, implicitly included by myTrack.h
contains the function prototypes
MyTrack_funcPtr.hSDK include file, used with myTrackDll
Is implicitly included by myTrack.h when code defines: USING_MYTRACK_DLL
Mt_Test.cppa platform-independent SDK test program
Mt_Test.dswWindows NT workspace for the Mt_Test.cpp program
Mt_Test.docWindows NT project file for the Mt_Test.cpp program
MT_SDK.docMicrosoft Word version of this document
MT_SDK.txttext version of this document
Sdkdem1.exeself-extracting file containing a Windows NT SDK demo
Sdkdem2.exeself-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):

  1. You’ll have to put a copy of myTrack.h in the file containing the project
  2. Change line 420 in mtDemoDlg.cpp from:
    i = mtRequestNewsByTicker(NewsRqn,(char *)(LPCTSTR)NewsSym);
    to:
    i = mtRequestNewsByTicker(NewsRqn,(char *)(LPCTSTR)NewsSym, 0);
  3. 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

  1. You must logon (mtRequestLogon()) within 10 seconds of the connection (mtConnectToServer()).
  2. Make sure to handle disconnects (MSG_ERROR_REPORT, error = MT_ERR_DISCONNECT ) message from server by reconnecting, logging in, and re-issuing outstanding requests.
  3. 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
Initinitialize the SDK
ConnectToServerconnect to MyTrack™ host
RequestLogonrequests logon to host
RequestLogoffrequests logoff from host
RequestBackgroundrequests background info for given ticker
RequestQuoterequests quotation for given ticker
RequestIntradayUpdaterequest to start/stop dynamic ticker updates
RequestHistoryrequests historical pricing data
RequestNewsHeadlinesrequest to start/stop dynamic news headlines
RequestNewsByTickerrequests all the news headlines for a specific ticker
RequestNewsStoryrequests a specific news story
RequestNewsVendorsrequests all news vendor codes and descriptions
RequestSymbolLookuplookup a company name for symbol or vice versa
RequestOptionDatarequest list of available options
RequestOptionLinksrequest list of option roots for LEAPs & wraps
RequestFutureFamilyDatarequests quotes on all futures
RequestIntradayDatastart or stop streaming updates for symbol
RequestDataWarehousedata warehousing request
RequestTransactionLogrequests transaction history for today
RequestYesterdaysLogsrequests yesterday’s time & sales log
RequestNasdaqLevel_2starts & stops Nasdaq level 2 for symbol
RequestNewsByVendorgets news headlines by vendor
RequestHistoricalNews_Tickergets historical news for a symbol
RequestHistoricalNews_Storygets a historical story’s text
3rdParty_MarketPulserequests Market Pulse display
3rdParty_EdgarOnlinerequests Edgar Online
3rdParty_ HemingtonScottrequests Hemmington Scott
RequestVolatilityDisplayrequests historic & current volatilities
RequestCompositeFamilyDatarequests a composite quote

Broker Functions
BrokerUseContestturns contest mode on
BrokerUseRealAcctturns contest mode off
BrokerRequestAcctIDsrequests account ID's
BrokerRequestAcctSummaryrequests summary of account value
BrokerRequestAcctPositionsrequests list of all positions
BrokerCashTransactionsrequests all cash transactions
BrokerEnterOrderenters a new order
BrokerCancelOrdercancels an open order
BrokerRequestTransactionDatarequest all account transactions
BrokerRequestOrderrequests all orders


Complete Documentation Table of Contents

SDK Functions
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()

Market CodesSales Codes
Error codesBrokerage error codes
myTrack DLL descriptionRevision History