MT_gateway™
Version 4.34 Documentation
06/06/2006
COPYRIGHT NOTICE
All information in this document and related software whether technical or non-technical shall be the exclusive property of PACT (a.k.a. Partners for Advanced Careers in Technology), Brooklyn, New York. The recipient may use this ONLY in conjunction with the mT_Gateway™ package. Failure to observe this shall be construed as violation of copyright rules.
Important:
General Philosophy of SDK Usage and Implementation Message
The myTrack SDK is specifically designed to be event driven. It is not intended to be a frequently or continuously polled “database”.
A number of the SDK community seem to be building applications that ignore the event driven features. Instead of subscribing to updates on a security they will with high frequency, issue quote requests. Others appear to make repeated requests for order status, rather than awaiting the order execution message. The effect of this misuse of the SDK is to drain resources from the systems serving all of the SDK user community. It is analogous to Denial of Service attacks on web servers. We’ve experienced such scenarios over the past months.
We ask those of you who may now recognize the fact that their code falls into this category, to move to re-mediate the problem. If you need assistance, we are happy to help.
We have put in place monitoring systems to identify sources of this misuse going forward. It will allow us to notify those of SDK community that may not realize that their software is misbehaving.
Table of Contents
New Broker message types (rev. 4.00)
Function RequestTickHistoryTime
Function RequestTodaysLog (aka: Time & Sales)
Function RequestYesterdaysNews
Function RequestThirdPartyBarra
Function RequestThirdPartyEdgarOnline
Event GotThirdPartyEdgarOnline
Function RequestThirdPartyHemmingtonScott
Event GotThirdPartyHemmingtonScott
Function RequestThirdPartyMarketGuide
Event GotThirdParty MarketGuide
Function RequestThirdPartyMarketPulse
Event GotThirdPartyMarketPulse
Function RequestThirdPartyMediaGeneral
Function RequestThirdPartySimplyStocks
Event GotThirdPartySimplyStocks
Function RequestThirdPartyVickers
Function RequestThirdPartyZacksEarnings
Event GotThirdPartyZacksEarnings
Event GotBrokerTable (New 4.00)
Event GotBrokerMessage (New 4.00)
Function BrokerRequestAcctInfo
Function BrokerRequestAcctSummary
Function BrokerRequestAcctPositions
Function BrokerRequestAllocation
Function BrokerRequestTransactionData
Function BrokerEnterConditionalOrder
Function BrokerEnterMutualFundOrder (NEW 4.00)
Function BrokerEnterOptionSpreadOrder (NEW 4.00)
Function RequestMarketMakerDefinition
Function BrokerEnterOrder (deprecated)
Function BrokerCancelOrder (deprecated)
Function BrokerRequestCancelOrder
Stock Sale Condition Indicators:
The following fields of Type msgQuote
Added the following fields to Type
msgOptionData
This release incorporates Track Data’s new broker message format.
New message types:
New message types will be sent for: See the individual requests for details.
BrokerRequestTransactionData()
Acknowledgment of a new or canceled brokerage order
Response to request for open and closed
orders, positions, transactions, account summary and info:
1) The host sends 1 MsgBrokerTable header message containing a list of field headings
2) Then 0 - n MsgBrokerTable detail messages are sent.
Each message contains a list of values corresponding to the hesdings
in the first message.
3) Then the host sends a MsgBrokerTable end message indicating that all detail messages were sent.
Dynamic updates triggered by changes in
order status:
When an order is entered, cancelled or processed by host:
§ A MsgBrokerMessage is sent by the host
§ the host will update the order information by sending a series of MsgBrokerTable append, update and remove messages
The MT_OCX Control enables you to access MyTrack™ services, including real-time and delayed prices, historical prices, real-time news headline & stories
System Requirements Windows NT or Windows 98
Visual Basic 6.0
Dependencies: MsWinSck.OCX (included in install package)
The installation package installs the following file:
mtocx.ocx installed in the “system” directory
Download the demo code/applications at: http://www.pactconsulting.com/mytracksdk/general/resources.html
To get started you need a valid myTrack id.
·
If you don't
have one - download myTrack (www.mytrack.com) and register as a basic user.
To enable the SDK, run the myTrack program and go into “chat window”:
1. Select Administrative / credit card - to enter your credit card
(SDK feature is free for 30 days - see below)
2. Then select Entitlements / features and enable the SDK feature.
Fees are posted on the www.mytrack.com web site. We will not bill
your credit card for 30 days - hence you can try it for 30 days and if not
happy just cancel it before the 30 days is up.
‘Bugs’ in the SDK
http://www.pactconsulting.com/mytracksdk/Support/supSDK.html
Include any relevant information, including the following details:
Bad
Data
To ensure that questions regarding the validity of the data are handled in the most efficient manner, try to recreate the error in the myTrack application.
If
the error occurs in myTrack:
Report this error to Track Data support
§ Send e-mail to: support@trackdata.com
or
§ From the myTrack application, you can report the bug using the Chat or Tell Track features.
Important:
report this bug based only on its occurrence within the myTrack application. Do not mention the SDK; doing so will cause your request to be forwarded to the wrong department, delaying the response.
If the error does not occur in myTrack:
§ Follow the instructions above for ‘Bugs’ in the SDK
Billing
issues
Billing
issues are handled by Track Data Corp™.
Please contact them directly
§ By Email: billing@trackdata.com
Or From the myTrack™ application, use:
§ ‘Chat’
§ ’Tell Track’
SDK-specific resources:
FAQ: http://www.pactconsulting.com/mytracksdk/General/faqPage.html
Send requests to: sdksupport@pactconsulting.com
Non SDK-specific resources: (general myTrack™ issues)
myTrack™ help (F1 from the myTrack™ application)
Send requests to support@myTrack.com
(i.e. RequestTicks to get dynamically updated ticks)
(i.e. GotTicks)
·
Do not issue
requests that will result in the server response of more than 1200 simultaneous
messages. The server will drop messages over than limit.
An rqn may not have a value of 0
All request methods have an rqn parameter
This rqn is returned in the response Event
The rqn provides 2 capabilities:
(See
RequestNewsHeadlines
& RequestTicks)
------------------------------------------------------------------------------------------------------------
Returns version #
Public
Function GetVersion() As String
Syntax:
version = object.GetVersion ()
------------------------------------------------------------------------------------------------------------
Initialize this Control
Syntax:
errCode = object.Init()
Note:
1. must be called before everything else
2. There is no response to this function
------------------------------------------------------------------------------------------------------------
De-initializes the control
Syntax:
errCode = object. DeInit()
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Connect to MyTrack™ host
Syntax:
errCode = object.Connect()
Note:
There is no response to this function
Signals connection to host is broken
GotDisconnect ()
The SDK will not automatically reconnect you in the event of a disconnect.
Make sure to handle disconnects by reconnecting, logging in, and reissuing outstanding requests. If the above sequence fails, you must re-initialize the myTrack environment by calling DeInit, then Init before trying to reconnect
------------------------------------------------------------------------------------------------------------
got error message from host
GotError(rqn as integer, msg As msgError)
error condition reported by host
Properties:
error As mtErrorCode see server side errors
------------------------------------------------------------------------------------------------------------
Got unsolicited message from Track Data
GotMsgFromTrack (rqn as integer, msg As msgFromTrack)
text As String
flag As String ' =more text to follow, 2=this is the last line
End Type
------------------------------------------------------------------------------------------------------------
Request logon from(tm) MyTrack™ host.
Syntax:
errCode = object.RequestLogon(rqn, user, password, product, revH,
revL)
Parameters:
rqn As Integer request # - returned in response
username As String 16 bytes maximum
password As String 16 bytes maximum
productName As String, your product name - 12 bytes max
revHO As Byte your product rev # high order, must be < 99
revLO As Byte your product rev # low order, must
be < 99
Control responds with GotLogonResponse Event
GotLogonResponse(rqn as integer, msg As msgLogon)
error As mtErrorCode 0 = ok, see server side errors below
host As String myTrack host name
features(16) As byte to be defined
End Type
!!!
Important !!!
1. You must logon within 10 seconds of the call to mtConnectToServer()
2. Distributors of myTrack SDK based software:
set productName, revHO, revLO to identify your product to distinguish users of your software for support and other matters. These values must be less
------------------------------------------------------------------------------------------------------------
Request logoff from(tm) MyTrack™ host.
Syntax:
errCode = object.RequestLogon(rqn)
Parameters:
rqn As Integer request # - returned in response
Control responds with GotLogoffResponse Event
GotLogoffResponse(rqn As Integer, Code As mtErrorCode)
Note:
A successful logoff will also disconnect you (will trigger gotDisconnect).
To logon again you will have to connect first and then logon
------------------------------------------------------------------------------------------------------------
Retrieves internal statistics
Syntax:
ErrCode = object.GetStats (stats)
Parameters:
stats As mtStats statistics returned here
inputFaults As Integer # of input queue faults
inputHigh As Integer Highest # of messages on input queue
inputMax As Integer max # of messages input queue can hold
inputCnt As Integer current # of messages on input queue
inputTotal As Integer total # of messages put onto input queue
inputSkips As Integer # of skipped (lost) input messages
inputGaps As Integer # of gaps in input message stream
(Each gap has1 or more skipped messages)
outputFaults As Integer # of input queue faults
outputHigh As Integer Highest # of messages on output queue
outputMax As Integer max # of messages output queue can hold
outputCnt As Integer current # of messages on output queue
outputTotal As Integer total # of messages put onto output queue
------------------------------------------------------------------------------------------------------------
Starts logging debug messages
Syntax:
ErrorCode = object.logStart(level as mtLogLevel)
Parameters:
level as mtLogLevel level of logging, will only log messages of
that or a greater level.
llFatal = 1 highest level
llFailure = 2
llError = 3
llMessage = 4
llInfo = 5 lowest
End Enum
Ends logging
Syntax:
ErrorCode = object.logEnd()
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Request quotation for ticker.
Syntax:
errCode = object.RequestQuote (rqn, ticker optionCode)
Parameters:
rqn As Integer request # - returned in response
ticker As String, ticker symbol - up to 16 bytes
optionCode As String 2 byte option code if requesting an option
or null string if not an option
Control responds with GotQuote Event.
GotQuote(rqn as integer, msg As msgQuote)
note:
There are two types of packets returned: options and everything else.
Non-options are returned in the stock structure.
error As mtErrorCode 0 = ok, see server side errors
instType mtInstType instrument type, see definition of mtInstType
rtFlag As Byte 0=real time 1=delayed
tradeTime as mtTime see definition of myTime
volume As
Long today’s total volume for primary
(or if one is
specified, for the specified) exchange.
Do not multiply by blockFactor
last As Double
yestClose As Double
bid As Double
ask As Double
bidSize As Long
askSize As Long
high As Double
low As Double
open As Double
exchange
As String primary exchange (i.e. N for New
York) up to 2
letters, see appendix for listing of exchanges
yestVolume As Long
tickValue As Byte
'***** This is the non-option Data section ********
annualHigh As Double
annualLow As Double
afterMktLast As Double 0 during regular trading
lastTradeVolume As Long
tick As Byte
volatility As Byte number between 0-150, for formula, see myTrack
help “glossary”
divFrequency As Byte
divDate As mtDate
divAmt As Single
eps As Single
blockFactor As Integer multiplier for msgTick.volume
shortableQuantity As Integer 0 = not shortable else, = amt can be shorted
in 100's
implied As Long deprecated
newsValue As Integer seconds from midnight for the latest news
compositeVolume As Long today’s total volume for all exchanges
combined. Do not multiply by blockFactor
afterMktTime As mtTime see definition of mtTime
timeOfQuote As mtTime see definition of mtTime
stock fields
afterMktVolume As Long
vwap As Double Volume weighted average price
newsVendor As String vendor of latest news story
'***** This ends the non-option Data section ********
'***** This is the option Data section ********
strikePrice As Double
openInterest As Long
optionDesignation As String
daysToExpiration As Integer
seriesNumber As Byte
numDividends As Byte
callPutFlag As Byte 0=call 1=put
exchangeRoot As Byte
contractSize As Integer
'***** This ends the option Data section ********
NOTE:
Do not use this function to poll the servers for quote updates.
Use RequestTicks for dynamic updates
Real-time / delayed status depends on your myTrack account Plan
------------------------------------------------------------------------------------------------------------
Requests composite data
Syntax:
ErrorCode = object.RequestCompositeData(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String ticker symbol - up to 16 bytes
Control responds with GotCompositeData event for every exchange that security trades on.
GotCompositeData(rqn As Integer, msg As Type msgQuote)
See definition of Type msgQuote,
------------------------------------------------------------------------------------------------------------
Request background info of ticker.
Syntax:
errCode = object.RequestBackground (rqn, ticker)
Parameters:
rqn As Integer request # - returned in response
ticker As String, ticker symbol - up to 16 bytes
Control responds with GotBackground Event.
GotBackground(rqn as integer, msg As msgBackground)
error As mtErrorCode 0 = ok, see server side errors below
instType As mtInstType instrument type, see defin. of mtInstType
description As String name of company
cusip As String standard industry id for this security
industryGroup As String
startDate As mtDate history start date
endDate As mtDate history end date (will be 0 0 0 for active stocks)
optionFlag As Byte 0=no options, 1=has options
shortInterest As Long in units
sharesInFloat As Long in thousands
sharesOutstanding As Long in thousands
primaryMarketCode As Byte see appendix for list of market codes
averageDailyVolume As Long in units
End Type
------------------------------------------------------------------------------------------------------------
Request to start / stop dynamic ticker updates.
Syntax:
errCode = object.RequestTicks (rqn, ticker, optionCode, flag)
Parameters:
rqn As Integer request # - returned in response
ticker As String, ticker symbol - up to 16 bytes
optionCode As String 2 byte option code if requesting an option
or null string if not an option
flag As mtStartStopEnum 1=start request 2=stop
Control responds with GotTick,GotNewsUpdate and GotMiscUpdate Events.
GotTick(rqn as integer, msg As msgTick)
error As mtErrorCode 0 = ok, see server side errors below
instType mtInstType instrument type, see defin. of mtInstType
flag As Byte 0 = regular msg,
1 = cancellation of a previous msg
the msg to be cancelled has the same sequence # that is in this msg
2 = correction of previous message
the msg to be corrected has the same sequence # that is in this msg
replace value/volume/saleCode
or bid/ask/bidSize/askSize
tickType As mtTickType 0=trade 1=quote
time As mtTime
seq As Long unique seq # of this trade
**** these items are only valid for trades (i.e. tickType = 0) ****
value As Double value of last trade
volume As Long volume of last trade, must be multiplied by the
msgQuote.blockFactor to get the actual volume
saleCode As Byte ASCII value, a code defining the type of sale, usually a blank - for listing of sales condition codes see appendix
******************************************************
**** these items are only valid for quotes (i.e. tickType = 1) ****
bid As Double
ask As Double
bidSize As Integer
askSize As Integer
******************************************************
***********************************************************************
Not all fields are defined for each record type:
the following are the valid fields per type of record
for Sale (a trade):
type time format seq value volume saleCode
stock Yes Yes Yes Yes Yes Yes
index Yes Yes Yes Yes No No
option Yes Yes Yes Yes Yes No
reg stock Yes Yes Yes Yes Yes Yes
mkt stat Yes Yes Yes Yes No No
future Yes Yes Yes Yes Yes No
for Quotes (a bid/ask quote):
type time format seq bid ask bid
size ask size
stock Yes Yes Yes Yes Yes Yes Yes
index Yes Yes Yes Yes No No No
option Yes Yes Yes Yes Yes No No
reg stock Yes Yes Yes Yes Yes Yes Yes
mkt stat n/a
future Yes Yes Yes Yes Yes Only on GLOBEX Only on GLOBEX
Note:
Data will be delayed 15-20 minutes unless your myTrack account is enabled for real-time prices for the particular exchange
GotMiscUpdate(rqn As Integer, msg As msgMiscUpdate)
CompositeVolume As Long
vwapRaw As
long Volume
weighted average price
convert using Block Factor
End Type
GotNewsUpdate(rqn As Integer, msg As msgNewsUpdate)
newsTime As mtTime time of last news story
newsVendor As String vendor of last news story
newsStoryNum As String last news story #
End Type
------------------------------------------------------------------------------------------------------------
Request history for intraday tick data
Syntax:
errCode = object.RequestTickHistory (rqn, ticker, daysBack)
Parameters:
rqn As Integer request # - returned in response
ticker As string root security name
daysBack As Byte 0 = most current day
1 = 1 day back
… 15 = 15 days back
control responds with GotTickHistory Event
GotTickHistory
(rqn As Integer, msg As msgTickHistory)
error As mtErrorCode
instType
As mtInstType instrument type, see defin. of mtInstType
date As mtDate
packetFlag As Byte 0=more packets to follow,
1=last packet for this ticker
time As mtTime
format As Byte for internal use
endSeq As Long ending sequence #
open As Double
high As Double
low As Double
close As Double
volume As
Long Do
not multiply by msg.quote.blockFactor
End Type
Note:
Data is for the specific exchange (primary, if none specified)
Data is points start at 8:00 AM ET
------------------------------------------------------------------------------------------------------------
Request
history for intraday tick data, start at MFM minutes from midnight to present
time
Syntax:
errCode = object.RequestTickHistory (rqn, ticker, daysBack, minFromMid,)
Parameters:
rqn As Integer request # - returned in response
ticker As string root security name
daysBack As Byte 0 = most current day
1 = 1 day back
… 15 = 15 days back
minFromMid As
Integer THIS FIELD IS
IGNORED
start time, minutes from midnight
control responds with GotTickHistory Event
------------------------------------------------------------------------------------------------------------
Requests todays transaction log
Syntax:
ErrorCode = object.RequestTodaysLog(rqn, pageFlag, requestText)
Parameters:
Rqn As Integer request # - returned in response
PageFlag As mtPageFlag see below
RequestText As String typically a ticker symbol
Control responds with GotTodaysLog event, line by line
FirstPage = 0
PageDown = 1
PageUp = 2
End Enum
GotTodaysLog(rqn As Integer, msg As mtLine)
all fields of mtLine are valid. See definition of mtLine
The format for the transaction log text (mtLine.text) is as follows:
Day of month (for GotYesterdaysLog only)
Time of Transaction
Exchange Code
Volume (if it was a trade, left blank if it was a quote)
Price (if it was a trade) Bid – Ask – Size (if it was a quote
Transaction Log code – usually blank, see appendix for codes
For more help see the myTrack help for “using transaction log”
------------------------------------------------------------------------------------------------------------
Requests yesterdays transaction log
Syntax:
ErrorCode = object. RequestYesterdaysLog (rqn, pageFlag, requestText)
Parameters:
Rqn As Integer request # - returned in response
PageFlag As Enum mtPageFlag
RequestText As String typically a ticker symbol
Control responds with GotYesterdaysLog event, line by line
GotYesterdaysLog (rqn As
Integer, msg As
Type mtLine)
all fields of mtLine are valid. See definition of mtLine
For the format of the transaction log text see GotTodaysLog above
------------------------------------------------------------------------------------------------------------
Request historical pricing data.
Syntax:
errCode = object. RequestHistory (rqn, ticker, endDate, numPkts,
period)
Parameters:
rqn As Integer request # - returned in response
ticker As String, ticker symbol - up to 16 bytes
endDate As mtDate latest date of history
numPkts As Integer, # of packets requested
period As mtPeriodicityEnum daily,weekly or monthly
Notes:
1. The server will send you the data backwards in time from the most recent day
going backwards. The # of packets requested has to be between 1 and 255. If you need more data, make additional requests.
2. When requesting history for options, the 2 character option code must be capitalized (ex: “ibm AT” )
Control responds with GotHistory Event
GotHistory(rqn as integer, msg As msgHistory)
error As mtErrorCode 0 = ok, see server side errors below,
generalSplitFactor As Long see below
instType As mtInstType instrument type, see defin. of mtInstType packetFlag As Byte 0 = more packets to follow
1 = last transmission for this request
2 = no more data for this ticker
numPackets As Byte # of historyItem packets returned (see below)
Item() As historyItem array returned with this request
End Type
date As mtDate
open As Double O H L C data is for the period requested
(week day or month)
high As Double
low As Double
closePrice As Double
dailySplitFactor As Long See below
volume As Long Do not multiply by msg.quote.blockFactor
openInterest As
Long only for Futures
End Type
Note:
The following are the valid fields per type of record.
type date open high low close volume openInterest
split
stock Yes Yes Yes Yes Yes Yes No yes
index Yes Yes Yes Yes Yes No No no
option Yes Yes Yes Yes Yes Yes No no
mkt stat Yes Yes Yes Yes Yes Yes No no
future Yes Yes Yes Yes Yes Yes Yes no
mutual fund Yes NAV Offer No No No No no
dailySplitFactor and generalSplitFactor
The DailySplitFactor / generalsplitfactor are used to correct the historical data for splits.
The historical prices have been ‘split adjusted’ using the the SplitFactor fields as follows:
‘split adjusted’ value = (historical value * GeneralSplitFactor) / DailySplitFactor
------------------------------------------------------------------------------------------------------------
Request for data on (all) options of an option-able security
Syntax:
errCode = object.RequestOptionData (rqn, ticker, requestType,
composite, pctOut, pctIn,
numlines, more)
Parameters:
rqn As Integer request # - returned in response
ticker As string root security name
requestType As Byte 0=calls 1=puts 2=both
composite As Byte 0=one market 1=all markets
pctOut As Integer % out of the money filter
pctIn As Integer % in the money filter
numlines As Byte max # of lines to send, see below
more As Long 0=initial request; 1= more of prev request
Control responds with GotOptionData Event for each option.
GotOptionData(rqn
As Integer, msg As msgOptionData)
error As mtErrorCode 0 = ok, see server side errors below,
instType As mtInstType instrument type, see defin. of mtInstType rtFlag As Byte 0 = real time ticker 1 = delayed ticker
eomFlag As Byte 0 = more packets will be sent
1 = last packet
2 = end of options
(this msg does not contain an option packet)
time As mtTime see definition of mtTime
last As Double
yestClose As Double
volume As Long do not multiply by msg.quote.blockFactor
bid As Double
ask As Double
bidSize As Long
askSize As Long
high As Double
low As Double
openInterest As Long
exchange As String see list of exchange codes in appendix
designation As String
strikePrice As Double
daysToExp
As Integer
seriesNum As Byte
numDivPay As Byte
callOrPut As Byte 0=call 1=put
yestVolume As Long do not multiply by msg.quote.blockFactor
root As String symbol of root
open As Double
numTrades As Long
End Type
Notes:
Numlines
should not exceed 400 for primary market or 100 for all markets requests
eomFlag
The interpretation of the eomFlag is:
0 = more to follow for this request
1 = this request has been satisfied (num_lines has been reached),
but there are more options for this stock
2 = no more options for this stock. The packet containing this
flag does not contain any option data.
------------------------------------------------------------------------------------------------------------
Request for link root symbols used for options
Syntax:
errCode = object. RequestOptionLinks (rqn, ticker)
Parameters:
rqn As Integer request # - returned in response
ticker As string root security name
Control responds with GotOptionLinks Event.
GotOptionLinks(rqn
As Integer, msg As msgOptionLinks)
error As mtErrorCode
num As Byte # of link tickers
ticker(20) As String array of tickers
End Type
------------------------------------------------------------------------------------------------------------
Request for data on all futures of as future family.
Syntax:
errCode = object. RequestFutureData (rqn, ticker)
Parameters:
rqn As Integer request # - returned in response
ticker As string0 root name of future family
Control responds with GotFutureData Event for each future.
GotFutureData(rqn
As Integer, msg As msgFutureData)
error As mtErrorCode
instType As mtInstType instrument type, see defin. of mtInstType
rtFlag As Byte 0=real time ticker 1=delayed ticker
eomFlag As Byte 0=more packets will be sent 1=last packet
time As mtTime see definition of mtTime
last As double
yestClose As double
volume As double do not multiply by msg.quote.blockFactor
bid As double
ask As double
high As double
low As double
openHi As double
openLo As double
annualHi As double
annualLo As double
tick As Byte > 0 is an up tick, < 0 is a downtick.
exch As String market letter (i.e. N for New York) up to 2 letters,
for list of exchange codes see appendix
volatility As Byte between 0 and 150, for formula see volatility
in myTrack help “glossary”
firstDeliveryDate As mtDate see definition of mtDate
lastDeliveryDate As mtDate
lastTradeDate As mtDate
hasOptions As Byte 0=no 1=yes
implied As double deprecated
yestVolume As Long
openInterest As Long
ticker As String
End Type
------------------------------------------------------------------------------------------------------------
Request for Volatility display
Syntax:
ErrorCode = object.RequestVolatility(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotVolatility event, in pages
GotVolatility (rqn As Integer, msg As type mtPage)
See definition of mtPage
For format of volatility display see appendix,
------------------------------------------------------------------------------------------------------------
Requests Nasdaq Level II data Entitlement (see ‘note’ below)
Syntax:
ErrorCode = object.RequestNasdaqLevelII(rqn, flag, showClosed,
NumLines, requestText)
Parameters:
rqn As Integer
flag As mtStartStopEnum 1 = start monitor, 2 = stop monitor
showClosed As Byte 1=do not display closed mm (default)
2=display closed mm
NumLines As Byte min 8 lines, max 24 lines
requestText As String ticker symbol in UPPERCASE
Control responds with GotNasdaqLevelII event
GotNasdaqLevelII(rqn As Integer, msg As msgNasdaqLevelII)
error As Byte
flag As Byte 0 = more data to come, 1 = no more data
numPackets As Byte number of packets
packets() As NasdaqPacket array of packets, see below
End Type
Type NasdaqPacket
MMid As String market maker id 4 bytes
Action As Byte 1=valid mm record
2=delete this MM record, this MM has gone out of scope,
no more updates will be sent for this MM
Qc As String quote condition 'C' = closed 1 byte
askTrend As mtNasdaqTrend see definition below
bidTrend As mtNasdaqTrend
Mmbid As Single bid price
Mmbidsz As Long bid size
Mmask As Single ask price
Mmasksz As Long ask size
time As mtTime time of quote
NumBid As Integer # of times at the inside bid
NumAsk As Integer # of times at the inside ask
End Type
Up = 1
Down = 2
End Enum
Notes:
1. The server will stop dynamic updating after 15 minutes hence if the window is still monitoring, you should refresh this request every 10 minutes. In this case, rqn must be same as in the previous request(s).
2. This function will mirror your myTrack account’s Nasdaq Level II entitlements.
a. In order to receive NLII data you must enable the Nasdaq Level II feature for your myTrack account.
b. If you aren’t enabled for Nasdaq level II, MSFT will work (dynamically) as a sample
c. Subscription to NASDAQ Level II requires real-time NASDAQ2 exchange.
d. Depending on your myTrack service level you can display either 1 NASDAQ Level II window or up to 4 windows simultaneously.
e. Depending on your myTrack service level The Nasd LII data will be either static or dynamically updating.
3. To change your entitlements or add exchanges,
from the myTrack application go to:
Chat / Entitlements / Features
Or
Chat / Entitlements / Exchanges
------------------------------------------------------------------------------------------------------------
Request lookup info on ticker symbol or company name.
Syntax:
errCode = object. RequestSymbolLookup(rqn, reqType, symbol,
maxReturnItems, more)
Parameters:
rqn As Integer request # - returned in response
reqType As Byte 0 = ticker 1 = company name
symbol As string ticker or partial company name
maxReturnItems As Byte max # of items to return
more As Byte, 0 = initial request 1 = more
Control responds with GotSymbolLookup Event for symbol or each company found.
GotSymbolLookup
(rqn As Integer, msg As msgSymbolLookup)
error As mtErrorCode
reqType As Byte initial request type
eomFlag As Byte 0=more to follow
1=last line but you can ask for more
2=no more matching what you requested
ticker As String
exch As String
desc As String
End Type
Note:
For ‘company name’ lookups, ‘eom’ will always indicate ‘more to follow’ for the initial request and ‘no more’ for subsequent requests regardless of the results.
You should ask for more until you find the number of matches to satisfy your request.
------------------------------------------------------------------------------------------------------------
Request to start/stop dynamic news headlines.
Syntax:
errCode = object.RequestNewsHeadlines (rqn, flag)
Parameters:
rqn As Integer request # - returned in response
flag As mtStartStopEnum start, stop
Control responds with GotNewsHeadline Events
GotNewsHeadline(rqn as integer, msg As msgNewsHeadline)
flag As Byte 0=more to come 1=last msg
text As String text of headline
storyNum as string story #
vendor as string vendor code
time as mtTime see definition of mtTimc,
End Type
To request a specific story use RequestNewsStory see definition
------------------------------------------------------------------------------------------------------------
request tick (transaction) data for a
symbol
currently has 30 days of data
currently has trade data only (no quote
data)
Syntax:
errCode = object. RequestTickData (rqn, ticker,dateFlag,
RequestType , lastTickerSeq , lastControl)
Parameters:
rqn As Integer request # - returned in response
ticker As String ticker symbol - up to 10 bytes
dateFlag As Integer day you want ticks 0 = today, 1= yesterday .
RequestType As Integer 1= trades 2= quotes 3=both
lastTickerSeq As Long start the request by setting to 0
each response will have a seq # associated
with each tick. to get more - send back the
last one you received.
lastControl As Long same as above - will be used to keep track
of where you are in the file.
on initial request set it to 0
on subsequent requests just send back what
you got back on your prior request.
Control responds with (multiple) GotTickData Event(s).
gotTickData (rqn as integer, msg As msgTickData)
error As mtErrorCode
instType As mtInstType
packetFlag As Byte 0=more packets to follow
1=last transmission for this request
2=no more data for this ticker
numTicks As Byte # of ticks returned
date As mtDate
control As Long (use to request more)
tick(100) As tickDatum array of ticks (see numTicks)
End Type
Type tickDatum
seq As Long sequence # of tick (use to request more)
time As mtTime
value As Double value of trade
volume As Long volume = some instruments will not have
volume - hence it will be set to 0
buySell As Byte ' type of trade it was
1=buy 2=sell 0=unknown
market As Byte ' market code of exchange
tradeCode As String ' trade code - usually a blank - see appendix
End Type
------------------------------------------------------------------------------------------------------------
Requests all the news headlines for a specific ticker.
Syntax:
errCode = object. RequestTkrHeadlines (rqn, ticker)
Parameters:
rqn As Integer request # - returned in response
ticker As String, ticker symbol - up to 16 bytes
Control responds with GotTkrHeadline Event.
GotTkrHeadline(rqn as integer, msg As msgNewsHeadline)
flag As Byte 0=more to come 1=last msg
text As String text of headline
storyNum as string story #
vendor as string vendor code
time as mtTime hour and minute
End Type
To request a specific story use RequestNewsStory see definition below
------------------------------------------------------------------------------------------------------------
Requests yesterdays news by ticker.
Syntax:
ErrorCode = object.RequestYesterdaysNews(rqn, ticker)
Parameters:
rqn As Integer request
# - returned in response
Ticker As String up to 16 bytes
Control responds with event GotNewsHeadlines
To request a specific story use RequestNewsStory, see definition below
------------------------------------------------------------------------------------------------------------
Request for a specific news story (for today’s or yesterday’s story only, for historical stories use RequestHistStory)
Syntax:
errCode = object. RequestNewsStory (rqn, storyNumber)
Parameters:
rqn As Integer request # - returned in response
storyNumber As String story # - up to 8 bytes
Control responds with GotNewsStory Event
GotNewsStory(rqn as integer, msg As msgNewsStory)
error As mtErrorCode 0 = ok, see server side errors below
flag As Byte 0=more to come 1=last msg
text As String line of text
End
Note:
Headlines and stories are sent 1 line at a time.
The headline will have the following format:
story # vendorCode time text
i.e.: 01235 R 6.06 Judge rules against Microsoft
01235 is the unique story # - use this # to retrieve the story
R is the vendor code (Reuters) - see msgNewsVendor
6.06 is the time - 6:06 am 6:06 would be 6:06 pm
------------------------------------------------------------------------------------------------------------
Requests historical headlines
Syntax:
ErrorCode = object.RequestHistHeadlines(rqn, ticker, numLines, more)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
NumLines As Byte number of headlines requested
More As Byte 0 = first request, 1 = get more headlines
Control responds with GotHistHeadlines event.
GotHistHeadlines(rqn As Integer, msg As Type msgNewsHeadline)
See definition of msgNewsHeadline
------------------------------------------------------------------------------------------------------------
Requests a historical story
Syntax:
ErrorCode = object.RequestHistStory(rqn, storyNum, date)
Parameters:
Rqn As Integer request # - returned in response
StoryNum As String Story Number of requested story
Date As mtDate date of story requested
Control responds with GotHistStory event
GotHistStory(rqn As Integer, msg As Type msgNewsStory)
See definition of msgNewsStory
------------------------------------------------------------------------------------------------------------
Requests news for all tickers being actively monitored (by function RequestTicks)
Syntax:
ErrorCode = object.RequestNewsRoundup(rqn, TodayFlag)
Parameters:
Rqn request # - returned in response
TodayFlag As mtTodayYesterday see below
specifies today’s or yesterday’s news
Control
responds with Event gotNewsHeadline
See definition of gotNewsHeadline
To request a specific story use RequestNewsStory
Today = 1
Yesterday = 2
End Enum
Note:
Must be actively monitoring ticks (RequestTicks) to use NewsRoundup function
------------------------------------------------------------------------------------------------------------
Request for all newsvendor codes and descriptions
Syntax:
errCode = object. RequestNewsVendors (rqn)
Parameters:
rqn As Integer request # - returned in response
Control responds with GotNewsVendor Event
GotNewsVendor(rqn as integer, msg As msgNewsVendor)
flag As Byte 0=more to come 1=last msg
enabled As Byte 0=you are not enabled 1=you are enabled
vendorCode As String 1 to 3 chars - vendor code
vendorSubCode As String 1 to 2 chars - vendor sub code
vendorName As String actual name
End Type
------------------------------------------------------------------------------------------------------------
Requests news headlines of specified vendor
Syntax:
ErrorCode = object.RequestByVendor(rqn, vendor, headlineNum)
Parameters:
Rqn As Integer request # - returned in response
vendor As String vendor requested, use vendor codes in
msgNewsVendor above
headlineNum As Byte start at one, will return up to 24, to get more
add 1 to last returned headlineNum
Control responds with GotNewsByVendor event
GotNewsByVendor (rqn As Integer, msg As Type msgNewsHeadline)
See definition of msgNewsHeadline
------------------------------------------------------------------------------------------------------------
Request for Barra display
Syntax:
ErrorCode = object.RequestThirdPartyBarra(rqn,
ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyBarra event, line by line
GotThirdPartyBarra(rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Edgar Online data
Syntax:
ErrorCode = object.RequestThirdPartyEdgarOnline
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyEdgarOnline event,
GotThirdPartyEdgarOnline (rqn As Integer, msg As msgEdgarOnline)
Error As Byte
eomFlag As Byte 1 = more to come, 2 = last one
date As mtDate
headline As String headline of story
url As String address of story
End Type
------------------------------------------------------------------------------------------------------------
Request for Barra display
Syntax:
ErrorCode = object.RequestThirdPartyHemmingtonScott
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyHemmingtonScott event
GotThirdPartyHemmingtonScott
(rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Market Guide page data
Syntax:
ErrorCode = object.RequestThirdPartyMarketGuide
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyMarketGuide event, in pages
GotThirdParty MarketGuide (rqn As Integer, msg As mtPage)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Market Pulse page data
Syntax:
ErrorCode = object.RequestThirdPartyMarketPulse
(rqn, pageNum)
Parameters:
Rqn As Integer request # - returned in response
pageNum As String see appendix for pageNum descriptions
Control responds with GotThirdPartyMarketPulse event, in pages
GotThirdPartyMarketPulse (rqn As Integer, msg As Type mtLine)
See definition of mtLine
Note:
The host refreshes market pulse data every 15/20 minutes.
------------------------------------------------------------------------------------------------------------
Request for Media General data
Syntax:
ErrorCode = object.RequestThirdPartyMediaGeneral
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyMediaGeneral event, line by line
GotThirdMediaGeneral (rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Simply Stocks data
Syntax:
ErrorCode = object.RequestThirdPartySimplyStocks
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartySimplyStocks event, line by line
GotThirdPartySimplyStocks (rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Vickers page data
Syntax:
ErrorCode = object.RequestThirdPartyVickers (rqn,
ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker
As String up to 16 bytes
Control responds with GotThirdPartyVickers event, in pages
GotThirdPartyVickers (rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Zacks Earnings page data
Syntax:
ErrorCode = object.RequestThirdPartyZacksEarnings
(rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotThirdPartyZacksEarnings event, in pages
GotThirdPartyZacksEarnings (rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
Request for Net Earnings
Syntax:
ErrorCode = object.RequestNetEarnings (rqn, ticker)
Parameters:
Rqn As Integer request # - returned in response
Ticker As String up to 16 bytes
Control responds with GotNetEarnings event, line by line
GotNetEarnings (rqn As Integer, msg As Type mtLine)
See definition of mtLine
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Enables storing and retrieving data via myTrack servers
!!! Important !!!
Do
not use the data warehouse functions if you also use the myTrack program.
Saves data to myTrack™ servers
Syntax:
ErrorCode = object.RequestDataSave(rqn, key, data)
Parameters:
Rqn As Integer request # - returned in response
Key As Integer page # where data will be saved
Data(99) As Byte up to 100 bytes of data
Control responds with GotDataWarehouse event, below. Msg.Action will be set
to 2
Retrieves data from myTrack™ servers
Syntax:
ErrorCode = object.RequestDataRetrieve (rqn, key)
Parameters:
Rqn As Integer request # - returned in response
Key As Integer page # of data to be retrieved
Control responds with GotDataWarehouse event, below. Msg.Action will be set
to 1
Deletes data from myTrack™ servers
Syntax:
ErrorCode = object.RequestDataDelete(rqn, key)
Parameters:
Rqn As Integer request # - returned in response
Key As Integer page # of data to be deleted
Control responds with GotDataWarehouse event. Msg.Action will be set to 3
GotDataWarehouse(rqn As Integer, msg As msgDataWarehouse)
error As Byte
Action As Byte 1 = retrieve data, 2 = save data, 3 = delete data
key As Integer page number of data
data(99) As Byte if retrieving data (Action = 1),
otherwise data is blank
End Type
************************************************************************
!!! Important !!!
Do
not use the Data Warehouse Functions if you use the myTrack program
************************************************************************
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
NOTE:
Before
calling any brokerage functions:
After
market hours orders will be acknowledged by TDC only, not by Broker.
------------------------------------------------------------------------------------------------------------
Sets contest flag.
Syntax:
ErrCode = object.BrokerContestSet(onOff)
Parameters:
OnOff as Boolean true sets contest on
!!!! Warning !!!!
By turning the contest off, you are no longer
in contest mode. You’re doing real live stock trading. We strongly suggest you
thoroughly check out your application in contest mode before going live.
This function will affect ALL brokerage
functions.
There is no response to this function
------------------------------------------------------------------------------------------------------------
Requests existing brokerage account IDs.
Syntax:
ErrCode = object.BrokerRequestAcctIds(rqn As Integer)
Parameters:
rqn As Integer request # - returned in response
Control responds with Event GotBrokerAcctIds
GotBrokerAcctIds (rqn As Integer, msg as msgBrokerAcctIds)
error As Integer
count As Integer # of accounts
id(20) As String account ids up to 20
End Type
Note:
Create accounts using the myTrack application:
Simulated trading / File / Create Account
MyTrade / Open Account
This function will return IDs for the contest mode you are in ( see function BrokerContestSet).
If contest flag is on, it will return contest IDs only, if contest mode is off, it will only return real account IDs.
------------------------------------------------------------------------------------------------------------
GotBrokerTable (rqn As Integer, msg As msgBrokerTable)
Tabular data for brokerage information
Public fieldCount As Integer
Public length As String
Public lineType As mtBrokerLineType
Public sourceType As mtBrokerTableSourceType
Public text As Single
headingLine = 72 ' H
bodyLine = 66 ' B
endLine = 69 ' E
appendLine = 65 ' A
removeLine = 82 ' R
updateLine = 85 ' U
mtbAccountInfo = 7
MtbAccountSummary = 28
MtbAllOrders = 41
MtbAllPositions = 38
MtbClosedOrders
= 35
MtbClosedPositions = 37
MtbOpenOrders = 32
MtbOpenPositions = 34
MtbOtherOrders =36
MtbOtherTransactions = 30
MtbSecurityTransactions = 33
This message will be sent for the following requests:
BrokerRequestTransactionData()
Unsolicited GotBrokerTable events will be fired to update the position, order and transaction information.
------------------------------------------------------------------------------------------------------------
GotBrokerMessage (rqn As Integer, msg As msgBrokerMessage)
text messages from brokerage system
Public colorCode As mtBrokerColor
Public text As String
COLOR_BLACK = 1
COLOR_BLUE = 2
COLOR_GREEN = 4
COLOR_RED = 3
COLOR_YELLOW = 5
-----------------------------------------------------------------------------------------
Requests personal account information.
Syntax:
ErrCode = object.BrokerRequestAcctInfo(rqn, acctId)
Parameters:
rqn As Integer request # - returned in response
acctId as string ID of account you want info on,
use IDs from msgBrokerAcctIds above
response:
Error:
control responds with gotBrokerError event.
Success:
Control responds with a series of GotBrokerTable events containing msgBrokerTable messages.
MsgBrokerTable.sourceType
= mtbAccountInfo
# of msgs lineType description
1 headingLine field names
1 bodyLine row of data
1 endLine indicates end of responses
See BrokerMsgTable field details for fields headings in response message
------------------------------------------------------------------------------------------------------------
Requests account summary.
Syntax:
ErrCode = object.BrokerRequestAcctSummary(rqn, acctId)
Parameters:
rqn As Integer request # - returned in response
acctId as string ID of account you want summary of
use IDs from msgBrokerAcctIds
response:
Error:
control responds with gotBrokerError event.
Success:
Control responds with a series of GotBrokerTable events containing msgBrokerTable messages.
MsgBrokerTable.sourceType
= MtbAccountSummary
# of msgs lineType description
1 headingLine field names
1 bodyLine row of data
1 endLine indicates end of responses
See BrokerMsgTable field details for fields headings in response message
------------------------------------------------------------------------------------------------------------
Requests account positions.
Syntax:
ErrCode = object.BrokerRequestAcctPositions (rqn, acctId, flag)
Parameters:
rqn As Integer request # - returned in response
acctId As String ID of account you want positions of
use IDs from msgBrokerAcctIds
flag As Byte 1 = open positions, 2 = closed, 3 = all
response
details:
Control responds with a series of GotBrokerTable events containing msgBrokerTable messages.
MsgBrokerTable.sourceType corresponds to flag value in the request:
MtbOpenPositions
MtbClosedPositions
MtbAllPositions
# of msgs lineType description
1 headingLine field names
0 - N bodyLine rows of data
1 endLine indicates end of responses
See BrokerMsgTable field details for fields headings in response message
Dynamic position updates:
When position information changes (a stock is bought or sold…), the host will inform the client of position changes by sending msgBrokerTable messages as GotBrokerTable events:
For positions that are removed
a msgBrokerTable with lineType = removeLine is sent.
For positions that are updated
a msgBrokerTable with lineType = updateLine is sent
For new positions
a msgBrokerTable with lineType = appendLine
is sent
Updates will be sent for each of the position types that have changed.
------------------------------------------------------------------------------------------------------------
For master/slave brokerage accounts
Requests the server to shares from the master account into slave accounts
Should be called (multiple times if necessary) to allocate all the shares
In the master account into the slave accounts
Syntax:
ErrCode = object.BrokerRequestTransactionData (rqn, allocation)
Parameters:
rqn As Integer request # - returned in response
allocation As ALLOCATION instructions for several accounts
Type ALLOCATION ' allocation instructions for multiple accounts accounts
cFromAccount(15) As Byte ' master account id
fPrice As Single ' price
cSymbol(9) As Byte ' ticker
cSpare As Byte ' spare
cNumAccts As Byte ' # of accts passed
acct(49) As ALLOCATION_ACCOUNT ' account's & # of shares
End Type
Type ALLOCATION_ACCOUNT ' allocation instructions for one slave account
cAccount(15) As Byte ' slave account id
lQuantity As Long ' # of shares to trqansfer from master to this account
End Type
response
details:
there is no server response
------------------------------------------------------------------------------------------------------------
Requests the transactions done on that account.
Syntax:
ErrCode = object.BrokerRequestTransactionData (rqn, acctId, symbol,
FromDate, toDate)
Parameters:
rqn As Integer request # - returned in response
acctId As String ID of account you want transactions of
symbol As String transactions done for that symbol
leave blank for all transactions
FromDate As mtDate earlier date
toDate As mtDate later date
response
details:
Control responds with a series of GotBrokerTable events containing msgBrokerTable messages.
MsgBrokerTable.sourceType
= MtbSecurityTransactions
# of msgs lineType description
1 headingLine field names
0 - N bodyLine rows of data
1 endLine indicates end of responses
See BrokerMsgTable field details for fields headings in response message
Dynamic transaction updates:
When transaction information changes (a stock is bought or sold…), the host will inform the client of transaction changes by sending msgBrokerTable messages as GotBrokerTable events:
For transactions that are removed
a msgBrokerTable with lineType = removeLine is sent.
For transactions that are updated
a msgBrokerTable with lineType = updateLine is sent
For new transactions
a msgBrokerTable with lineType = appendLine
is sent
------------------------------------------------------------------------------------------------------------
Requests orders.
Syntax:
ErrCode = object.BrokerRequestOrders (rqn, acctId, FromDate , toDate,
requestType)
Parameters:
rqn As Integer request # - returned in response
acctId As String ID of account you want orders of
use IDs from msgBrokerAcctIds
toDate As mtDate later date
FromDate As mtDate earlier date
RequestType As Byte 1 = Open Orders, 2 = Closed, 3 = Other
response
details:
Control responds with a series of GotBrokerTable events containing msgBrokerTable messages.
MsgBrokerTable.sourceType corresponds to RequestType value:
MtbOpenOrders
MtbClosedOrders
MtbOtherOrders
# of msgs lineType description
1 headingLine field names
0 - N bodyLine rows of data
1 endLine indicates end of responses
See BrokerMsgTable field details for fields headings in response message
Dynamic order updates:
When order information changes (an order is acknowledged by TDC, acked by broker etc.), the host will inform the client of changes to orders by sending msgBrokerTable messages as GotBrokerTable events:
For orders that are removed
a msgBrokerTable with lineType = removeLine is sent.
For orders that are updated
a msgBrokerTable with lineType = updateLine is sent
For new orders
a msgBrokerTable with lineType = appendLine
is sent
Updates will be sent for each of the order types (open, closed…) that have changed.
------------------------------------------------------------------------------------------------------------
Enters a broker order
See notes below
Response is one or more of the following events:
See OrderEntry Response for details.
Syntax:
ErrCode = Object.BrokerEnterNewOrder (rqn, order)
Parameters:
rqn As Integer request # - returned in response
order As orderEntry see definition below
populate all the fields to place an order
turnaround As long use to map broker messages
acct As String
symbol As String
instType As integer (NEW) use mtBrokerInstType
Important! Make sure to set the above value
actionCode As Byte 1=buy, 2=sell, 3=buy to cover, 4=sell short
orderType As Byte 1=market, 2=limit, 3=stop limit, 4 = stop
orderQty As Long
fillKill As Byte 1 = FillOrKill else = 0
AllNone As
Byte 1 = AllOrNone else = 0
dayGTC As Byte 0 = day order, 1 = GTC
limitPrice As Single
stopPrice As Single
route As Routing implements
routing capabilities of the myTrade
system, see Routing
Class
reserveBook As Byte set this to 1 if it's a reserve book order
reserveBookQty As Long Quantity to show on book for a reserved book order
hiddenOrder As Byte 0=no 1=yes to all 2=to all except subscribers
peggedType As Byte 1=peg the bid 2=peg the ask
discretionAmt As Single used for pegging order type
flags As Integer see mtOrderFlagEnum bit fields
end
Server responds with events GotBrokerTable, GotBrokerMessage and GotBrokerError
See below for details.
Response to a successful order request:
Acknowledged
by Track
Acknowledged
by Broker
Executed
Acknowledment
by Track
Server sends an order status and description message.
Server sends an‘open order’ append message.
Server sends an ‘all order’ append message.
|
Event (…Message Type) |
Field |
Value |
|
|
Order status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Received by Track: … |
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘A’ppend |
||
|
rqn |
rqn of the orderEntry request |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘A’ppend |
||
|
rqn |
rqn of the orderEntry
request |
Acknowledment
by Broker
Server sends an order status and description message
Server sends an ‘open order’ update message.
Server sends an ‘all order’ update message.
|
Message |
Event (…Message Type) |
Field |
Value |
|
Order status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Received by Broker: … |
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘U’pdate |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘U’pdate |
Execution by Broker
Server sends an order status and description message.
Server sends a ‘closed order’ update message.
Server sends an ‘all order’ update message.
Server sends an ‘open order’ remove message.
Server sends a ‘position’ update message.
Server sends a ‘transaction’ append message.
|
Message |
Event (…Message Type) |
Field |
Value |
|
Order status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Executed by Broker: … |
|
Closed order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbClosedOrders |
|
lineType |
‘U’pdate |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘U’pdate |
||
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘R’emove |
||
|
Position |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenPositions |
|
lineType |
‘U’pdate |
||
|
Transaction |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbSecurityTransactions |
|
lineType |
‘A’ppend |
Response to a rejected order request:
Server
will respond with event GotBrokerError
There will be no further messages from the server
for rejected orders
Response to a cancel request (Real Account):
Cancel
Acknowledged by Track
Cancel
Acknowledged by Broker
Canceled
Cancel Acknowledged by Track
Server sends an order status and description message.
Server sends an ‘open order’ update message.
Server sends an‘all order’ update message.
|
Message |
Event (…Message Type) |
Field |
Value |
|
Cancel status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Cancel Received by Track: |
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘U’pdate |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘U’pdate |
Cancel Acknowledged by Broker
Server sends an order status and description message.
Server sends an ‘open order’ update message.
Server sends an‘all order’ update message.
|
Message |
Event (…Message Type) |
Field |
Value |
|
Cancel status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Cancel Received by Broker: |
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘U’pdate |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘U’pdate |
Canceled
Server sends an order status and description message.
Server sends an ‘open order’ remove message.
Server sends an ‘all order’ remove message.
|
Message |
Event (…Message Type) |
Field |
Value |
|
Cancel status |
GotBrokerMessage(…msgBrokerMessage) |
Text |
Cancel Received by Broker: |
|
Open order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbOpenOrders |
|
lineType |
‘U’pdate |
||
|
All order |
GotBrokerTable(…msgBrokerTable) |
sourceType |
MtbAllOrders |
|
lineType |
‘U’pdate |
Response to a cancel request (Simulator Account):
Server
sends an order status and description message.
Server
sends an ‘open order’ remove message.
Server
sends an‘all order’ remove message.
· To change the default routing settings see routing class
· ONLY the rqn of the first response to the orderEntry call (i.e.: GotBrokerError, or msgBrokerTable and msgBrokerMessage for the Acknowledged by TDC) will match the rqn of the original orderEntry call.
------------------------------------------------------------------------------------------------------------
Signals a rejected order.
GotBrokerError (rqn As Integer, msg As msgBrokerError)
The rqn will match the rqn of the BrokerEnterNewOrder() function call.
Public errorText As String rejection details
End
------------------------------------------------------------------------------------------------------------
Enters a conditional order.
Syntax:
ErrCode = Object.BrokerEnterConditionalOrder (rqn, order1, order2,
TradeFlag)
Parameters:
rqn As Integer request # - returned in response
order As orderEntry see definition of orderEntry
order As orderEntry see definition above
tradeFlag as mtOsoOcoTrade see definition below
OSOtrade = 1
OCOtrade = 2
End Enum
Notes:
In an OSO trade, the first trade is submitted and executed then the second trade is submitted.
In an OCO trade, the orders must be non-market orders and both orders are submitted to the broker. The execution of one will trigger the cancellation of the other.
See Order Entry Response for response details:
For more info on conditional orders, run the myTrack program select:
chat / Functions / View Topics / trade / trade types
------------------------------------------------------------------------------------------------------------
Enters a mutual fund order.
Syntax:
ErrCode = Object.BrokerEnterMutualFundOrder(rqn, acctID,
buySymbol, sellSymbol, action, instructions, balance, amount As Single)
Parameters:
rqn As Integer request # - returned in response
acctID As String
buySymbol As String
sellSymbol As String
action As mtMutFundAction
instructions As mtMutFundInstruction
balance As mtMutFundBalance
BUY
SELL
XCHANGE ‘use to buy ‘buySymbol’ and sell ‘sellSymbol’
End Enum
REINVEST_ALL 'reinvest dividends & capital gains
PAY_DIVIDENDS 'pay dividends & reinvest cap.gains
PAY_ALL 'pay out dividends & capital gains
End Enum
ENTIRE_BALANCE 'if selling or exchanging entire balance
DOLLAR_AMOUNT 'if by dollar amount (MUST setDollarAmount() )
End Enum
See OrderEntry Response in BrokerEnterOrder for response details
------------------------------------------------------------------------------------------------------------
Enters an option spread order.
Syntax:
ErrCode = Object. BrokerEnterOptionSpreadOrder (rqn, order1,
order2 As OrderEntry)
Parameters:
rqn As Integer request # - returned in response
order1 As OrderEntry
order2 As OrderEntry
See OrderEntry Response in BrokerEnterOrder for response details
------------------------------------------------------------------------------------------------------------
Will implement the routing capabilities of the myTrade order execution system.
Instructions:
1. Call RequestMarketMakerDefinition()
Set flag to the market for which you want a list of Destinations
(Nasdaq, OTC, Listed… see Market Defines in mtRequestMarketMaker() )
The server will return MARKET_MAKER messages for all destinations in that market
2. Set the BROKER_ORDER.mmXXX to the MARKET_MAKER.code of the
destination you wish to set as the default routing destination
3. If you are setting an ECN as a default you will also have to enable that particular
ECN in the ecnMap:
a. Call RequestMarketMakerDefinition() setting flag = ECN // 5
b. Turn on the bit in BROKER_ORDER.ecnMap corresponding to the ECN’s MarketMaker.code
c. The bit for SelectNet is 14 (0 base, 0-15), this value is not returned by RequestMarketMakerDefinition ()
4. Place the order:
a. Set BROKER_ORDER mmXXX field to the code value of the MM/destination you wish to set as default for a particular market.
b. If you are selecting an ECN as one of your defaults, you must enable that ECN by turning on the BROKER_ORDER.ecnMap bit corresponding to the code value for that ECN.
Routing
to specific MMs/ECNs:
You can route your order to specific ECNs using the MarketMaker[4] field:
Note:
The ‘MM exclusion’ feature has not yet been implemented.
Order routing does not affect simulated trading.
For more information see the myTrack Trade Routing Tutorial (www.mytrack.com/routing.htm)
IMPORTANT:
Turn on ECN routing destination
Syntax:
ErrorCode = object.route.ECNTurnOn (ecnCode As
Byte)
Parameters:
ecnCode As Byte this value is obtained by calling
RequestMarketMakerDefinition, which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Turn off ECN routing destination
Syntax:
ErrorCode = object.route.ECNTurnOff (ecnCode As
Byte)
Parameters:
ecnCode As Byte this value is obtained by calling
RequestMarketMakerDefinition, which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Sets Market Maker for Nasdaq securities
Syntax:
ErrorCode = object.route.NasdaqSet (mmCode As
Byte)
Parameters:
mmCode As Byte this value is obtained by calling
RequestMarketMakerDefinition, which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Sets MM for listed securities
Syntax:
ErrorCode = object.route.ListedSet(mmCode As Byte)
Parameters:
mmCode As Byte this value is obtained by calling
RequestMarketMakerDefinition, which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Sets MM for options
Syntax:
ErrorCode = object.route.OptionSet (mmCode As
Byte)
Parameters:
mmCode As Byte this value is obtained by calling
RequestMarketMakerDefinition which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Sets MM for OTC securities
Syntax:
ErrorCode = object.route.OTCSet(mmCode As Byte)
Parameters:
mmCode As Byte this value is obtained by calling
RequestMarketMakerDefinition below which returns the msgMarketMaker.code
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Returns the available MMs for requested market or ECN destinations
Syntax:
ErrorCode = object.RequestMarketMakerDefinition(rqn As
Integer, flag As mtMarketMakerRequest)
Parameters:
Rqn As Integer
Flag As mtMarketMakerRequest
mmrNasdaq
= 1
mmrOTC_BB = 2
mmrListed = 3
mmrOptions = 4
mmrECNs = 5
End Enum
control responds with one or more GotMarketMakers events
GotMarketMakers(irqn, flag as mtMarketMakerRequest, mmm as
msgMarketMaker)
error As Byte
flag As mtMarketMakerRequest see definition above
eod As
Byte end of data: 1=more to
come 2=this is the last entry
code As
Byte binary value, is used in the …Set
functions above as
the mmCode to specify the MM
or in ECNTurnOn / …Off function to select an ECN
Name As String
fee As
Integer 10th of cent i.e.
7 = $.007, will only be sent for ECN's
End
Type
NOTE:
The msgMarkerMaker.code for SelectNet is 15
------------------------------------------------------------------------------------------------------------
Copies the routing class from object.route to toRoute
Syntax:
object.route.Copy (toRoute As Routing)
Parameters:
toRoute As Routing
Note:
There is no response to this function
------------------------------------------------------------------------------------------------------------
Deprecated. Use BrokerEnterNewOrder
------------------------------------------------------------------------------------------------------------
Deprecated.
------------------------------------------------------------------------------------------------------------
Cancels an order.
Syntax:
ErrCode = object.BrokerRequestCancelOrder (rqn, acctID, orderID)
Parameters:
rqn as integer request # - returned in response
acctID as string acctID used to place order you want to
cancel
orderID as string) id of order you want to cancel
See Order Entry Response for response details:
MtLine is returned for many requests.
Error As Byte
flag As Byte 0 = more to come, 1 = last line
numBytes As Integer number of bytes in line
text As String Text of line
End Type
------------------------------------------------------------------------------------------------------------
month As Integer
day As Integer
year As Integer
------------------------------------------------------------------------------------------------------------
error As Byte
flag As Byte 0= more to come, 1 = last page
numBytes As Integer number of bytes in page
lines(24) As String up to 24 lines of 80 characters
End type
------------------------------------------------------------------------------------------------------------
hour As Integer
min As Integer
sec As Integer
End type
------------------------------------------------------------------------------------------------------------
Enumerates the various types of financial instruments
For Non-Brokerage functions
mtStockType : stock
mtIndexType : market index i.e. INDU SPX …
mtOptionType : option i.e. ibm lc
mtRgnStockType : stock trading on a regional market
mtMktStatType : market statistic
mtFutureType : commodities etc.
mtMutFundType : mutual Fund
ACKD_BY_BKR 1
EXECUTED_BY_BKR 2
CANCELLED_BY_USER 3
REJECTED_BY_BKR 4
CANCELLED_BY_BKR 5
CREDIT_CASH 6
DEBIT_CASH 7
REJECTED_BY_TDC 8
CANCEL_ACKD_BY_TDC 10
CANCEL_ACKD_BY_BKR 11
CANCEL_REJECTED_BY_BKR 12
NOTHING_DONE 13
CREDIT_MMKT 14
DEBIT_MMKT 15
ACAT_IN 16
ACAT_OUT 17
TRADE_REVERSED 18
REVERSE 19
Enumerates the various types of financial instruments
For Brokerage functions
mtBrokerStock : stock
mtBrokerOption : option
mtBrokerBond : bonds
mtBrokerMutFund : mutual funds
mtBrokerMoneyMarket: money markets
mtBrokerInstInfo : information
mtBrokerInstFuture : commodities etc.
mtMutFundType : mutual Fund
returned on function call OR as "error" in the data messages
will be returned on a function call
mtErrNoError = 0 no error
mtErrWSA = -1 error on WSAStartup
mtErrNoQ = -2 could not init queues
mtErrNoMalloc = -3 could not malloc queue elements
mtErrNoSocket = -4 could not get a socket
mtErrNoFindIPaddr = -5 cannot find sdk.tdc.com ip address
mtErrNoConnect = -6 could not connect to mytrack
mtErrInputThread = -7 could not start input thread
mtErrOutputThread = -8 could not start output thread
mtErrTimerThread = -9 could not start timer thread
mtErrInitNotCalled = -10 you did not call mtInit
mtErrNotConnected = -11 you are not connected to a myTrack server
mtErrNotLoggedOn = -12 must logon before issuing data requests
mtErrAlreadyLoggedOn = -13 you are already logged on
mtErrArgLength = -14 # of bytes of an argument is invalid
mtErrNoOutputQLinks = -15 could not send a msg - ran out of queue links
mtErrOutMsgTooLarge = -16 TDC problem - contact Support
mtErrInMsgTooLarge = -17 TDC problem - contact Support
mtErrDisconnect = -18 connection was disconnected
mtErrNoHBFromServer = -19 no heart beat from server
mtErrInvalidArgument = -20 passed to the api routine
mtErrInvalidAcctID = -21 passed to a brokerage api routine
mtErrDeinitCalled = -22 cannot call any api function
mtErrLggingStarted = -23
mtErrInvalidProductName = -24 use different product name in logon request
mtErrAtemptingToConnect = -51 OCX is trying to connect
mtErrOCXFailure = -52 OCX triggered an ON error statement
mtErrUndefined = -770 undefined error
will be returned as "error" in the data messages
mtsErrNoError = 0 ok
mtsErrNoRoom = 1 no more room for connection
this error will be sent back
upon the tcp/ip connection.
even before you send the
request to connect
mtsErrUnknownConnection = 2 unknown connection
mtsErrTooManyConnections = 3 too many connections already
opened, presently will accept up to 4
connections from the same ip address
mtsErrNOHeartbeat = 4 no heartbeat received - disconnecting mtsErrInvalidAcct = 5 invalid account-password
mtsErrNoSuchTicker = 7 ticker not on database
mtsErrNotLogon = 8 you did not logon
mtsErrLogonAlready = 9 you logged on already
mtsErrTooManyRequests = 10 too many requests outstanding
mtsErrDbNotAvailable = 11 database requested is temporarily not
available if condition persists - call tdc operations
mtsErrNoActivity = 12 no activity in a while - connection will be
closed, reconnect when you need more data.
mtsErrDbError = 13 database error with your request,
database is probably ok
mtsErrNoData = 14 no data available for the ticker requested
mtsErrNoPriorRequest = 15 no prior request
mtsErrInvalidRequest = 16 invalid request (check your parameters)
mtsErrUnknownRequest = 17 no such request (invalid messageCode)
mtsErrTooManyLines = 18 # of lines of data exceeds system max
mtsErrUnknownRQN = 19 unknown request # (unknown rqn)
mtsErrInvalidRQN = 20 rqn of 0 is invalid
mtsErrTooManyConcurent = 21 too many concurrent requests
mtsErrInvalidVersion = 22 your version # is no longer supported
mtsErrWarehouseNotAvailable = 23 data warehouse system not available
mtsErrTDSNotAvailable = 25 tds data base not available
mtsErrWarehouseGet = 26 data request for key specified not found
mtsErrWarehouse = 27 data warehouse error on access to data base
mtsErrWarehousePut = 28 data warehouse error on put to data base
mtsErrProfile = 30 profile data base error
mtsErrNoOptions = 31 security has no options
mtsErrNoFutures = 32 security has no futures
mtsErrNoComposite = 33 security has no composite markets
mtsErrNoOtcBb = 34 security not on otc bb
mtsErrNoTrade = 35 could not forward trade request to db server
mtsErrFile = 39 file does not exist
mtsErrNoSdkFeature = 42 SDK feature not enabled
mtsErrNoSdkRegistration = 43 you did not register for the SDK
End Enum
-------------------------------------------------------------------------------
mtTradeType = 0 trade
mtQuoteType = 1 quote
End Enum
-------------------------------------------------------------------------------
mtDaily = 1
mtWeekly = 2
mtMonthly = 3
End Enum
-------------------------------------------------------------------------------
mtStart = 1
mtStop = 2
End Enum
-------------------------------------------------------------------------------
Used in msgQuote, msgFutureData, msgOptionData
U= AEX P= PACIFIC
E= ALBERTA X= PHILADELPHIA
A= AMEX W= SWEDEN
B= BOSTON J= TOKYO
H= CBOE T= TORONTO
C= CINCINNATI V= VANCOUVER
R= FRANKFURT Z= ZURICH
L= LONDON @= TRACK DATA
M= MIDWEST 1= MEFF RV
O= MONTREAL 3= XETRA
S= NASDAQ 8= OTC BULLETIN BOARD
N= NEW YORK D= Pink Sheets
K= OSAKA
I= SMALL CAPS
*********************************************************************
Used in msgBackground
EX_CBOE = 0
,EX_AMEX = 1
,EX_PACIFIC = 2
,EX_PHILADELPHIA = 3
,EX_NEW_YORK = 4
,EX_BOSTON = 5
,EX_TRACK_DATA = 6
,EX_MIDWEST = 7
,EX_NASDAQ = 8
,EX_TORONTO = 9
,EX_LONDON_AUTO_OPT = 10
,EX_CINCINNATI = 11
,EX_INSTINET = 12
,EX_OPRA = 13
,EX_MONTREAL = 14
,EX_VANCOUVER = 15
,EX_ALBERTA = 16
,EX_LONDON = 17
,EX_SWISS_SE = 18
,EX_SWEDISH_EXCHANGE = 19
,EX_OML_SWEDEN = 20
,EX_SEAQ_INTL = 21
,EX_EOE = 22
,EX_FRANKFURT = 23
,EX_DTB = 24
,EX_PARIS_SE = 25
,EX_FRANCE = 26
,EX_TOKYO = 27
,EX_OSAKA = 28
,EX_IBIS = 29
,EX_AMSTERDAM = 30
,EX_HILLS_TRADERS = 31
,EX_RESERVED = 32
,EX_CBT = 33
,EX_CME = 34
,EX_MATIF = 35
,EX_COMEX = 36
,EX_SIMEX = 37
,EX_TIFFE = 38
,EX_KCBT = 39
,EX_MGE = 40
,EX_MCE = 41
,EX_LIFFE = 42
,EX_KRFUT = 43
,EX_MONEP = 44
,EX_SOFFEX = 45
,EX_WCE = 46
,EX_FOX = 47
,EX_LTOM = 48
,EX_LON_METAL = 49
,EX_INTL_PETROL = 50
,EX_NYMEX = 51
,EX_MADRID = 52
,EX_MILAN = 53
,EX_MEXICO = 54
,EX_BROKER_BROKER = 55
,EX_JASDAQ = 56
,EX_CSCE_NYFE = 57
,EX_OTC_NON_NASDAQ = 58
,EX_OTC_BULLETIN_BOARD = 59
,EX_HONG_KONG = 60
,EX_MEFF = 61
*********************************************************************
Note: The notation (Volume,Last,High,Low) indicates which fields are
affected.
United States :
@ - NYSE: 'Stopped Stock' (as defined in NYSE Rule 116.40)
-- OR -- Agency Cross Trade (as defined in NYSE Rule 72
paragraph b).
NASDAQ: Regular sale - (high/low/last/volume)
A - Acquisition. The trade was part of an Exchange acquisition.
(Volume,Last,High,Low)
B - NASDAQ : Bunch. This trade report reflects multiple trades
by a single trader within a short (Typically 60 second) period.
(Volume,Last,High,Low)
NON-NASDAQ : Stock was traded in association with another
instrument.
(Volume,Last,High,Low)
C - Cash Sale. This trade was a special, cash based transaction.
Delivery and payment for the transaction are due on the same day
as the transaction.
(Volume)
D - Distribution. The trade was part of a large distribution.
Typically a large block, the indicator is used so that traders
know that it was not a large buyer/seller doing a trade.Thus
this block is not apt to affect the market price.
(Volume,Last,High,Low)
E - NYSE- Identifies trades executed as part of NYSE Direct+,
which is NYSE's high-speed, automated execution facility.
(Volume,Last,High,Low)
F - Burst Basket Execution. A burst basket execution signifies
a trade wherein the equity specialists, acting in the aggregate
as a market maker, purchase or sell the component stocks
required for execution of a specific basket.
(Volume,Last,High,Low)
G - NASDAQ : Group. This trade report is the same as a 'B'
(Bunch) except that it is being reported out of sequence.
(Volume,High,Low)
NON-NASDAQ : Opening/Reopening trade detail. This indicates
that the trade is just for informational purposes.
This trade was previously reported with other 'G' trades
as a single opening trade.
I.E. A series of 'G' trades are the details of what
trades actually made up the opening trade.
NOTE: Due to overwhelming customer requests, and
market approval,TDC (and most other vendors) ignore this
message completely. We do not show these anywhere.
(Updates nothing)
H - Interday trade detail. Same as opening detail 'G' above, except
this details an aggregate trade other than the opening trade.
Same notes apply as with 'G'.
I - Basket Index on Close Transaction. This signifies a trade
involving paired orders, the execution of which is based on the
closing value of the index. These trades will be reported after
the close when the index closing value is determined.
(Volume)
J - Rule 127 (NYSE). The trade was outside the current quote
and was:
a) Over 10,000 shares, and/or
b) Was over $200,000
(Volume,Last,High,Low)
K - Rule 155 (AMEX). This trade occurred under the regulations
specified by AMEX rule 155 for special trades (Large dollar
values and/or out of market). Also known as a 'Cleanup trade'.
(Volume,Last,High,Low)
L - Sold Last. This is a late report of a Regular trade although
the trade did occur in sequence.
(Volume,Last,High,Low)
N - Next Day. This trade specifies delivery between one and four
days after the transaction date.
(Volume)
O - Opened. This is a late report of the opening trade.
(Volume,High,Low)
P - NASD - Prior reference price. (Volume,High,Low)
R - Seller. This trade specifies delivery conditions for a future
date (Beyond Next Day ('N')).
(Volume)
S - Split Trade. This trade was part of a larger trade which was
split across multiple exchanges. It should be treated as a
Regular sale. However, it is unclear if this condition applies
any longer.
(Volume,Last,High,Low)
T - NASDAQ : Form 'T' trade. This is a trade, which occurred
after the NASD system close. These trades are reported
on a 'Form-T' and are reported electronically as a group
some time after the close.
(Volume,High,Low)
NON-NASDAQ : Custom Basket Cross. This signifies a
trade of (a) two paired split (where customer requires only a
portion of the standardized basket) orders in which the market
maker or member organization facilitates both sides of the
remaining portion of the baskets, or (b) a combination
of a split basket and an entire basket where the market
maker facilitates the remaining shares of the split basket only.
(Volume)
W - NASD- Average Price Trade - (Volume)
Z - Sold. This is a late, out of sequence, report of
a Regular sale.
(Volume,High,Low)
Canadian :
The following codes define the 'Marker' codes on equity trades
as reported via the Toronto Stock Exchange.
A - Delayed Sale (Trade that was not entered at Trade Time)
B - Delayed Delivery (A Transaction in which delivery of the
security will be delayed beyond the normal settlement
period. These Trades are included in the volume, value
and number of transactions totals but is not included in
open, high, low, last sale and closing price.)
C - CATS Stock (Identifies a stock that trades on the
Computer Assisted Trading System)
D - Cash Trade (A trade that is settled the next day. Cash trades
are included in the Volume value, and transaction total but
does not affect open,high,low,last sale, and closing price.
E - Non boardlot (odd lot) Trade (Quantity of shares is not
sufficient to comprise a boardlot.)
F - Mandatory Cash (All Trades for a specific reason in a stock
must be settled in cash. In this case trades will set open, high,
low, last and price are included in volume, value and
transaction totals.)
H - Split Stock ( This indicator is used ONLY on the first day
of trading after the stock splits.)
I - Sets Last Price
J - Sets Open Price
K - Sets Last Price (CATS)
L - Sets Open Price (CATS)
M - Special Terms Trading (All trades executed and settled in other
that the regular manner. These trades will affect the
open, high, low, last price. They are also included in volume,
value and transaction totals.
N - Non-voting Shares
O - ISIP Eligible (A stock that is traded through an Indexed
Security Investment Plan and thus sheltered from capital
gains taxes.)
Q - VCT Stock
R - Restricted Voting shares (Voting is restricted to a
specified portion of the shares held.)
T - Sets Last Price (VCT)
U - Trading in U.S. Dollars
V - Subordinate Voting Shares (Shares belonging to the class
containing the fewest votes per share.)
W - Sets Open Price (VCT)
X - Cease Trading Order (Imposed by the Ontario Securities
Commission due to non-compliance of the company to OSC
regulations or other requirements.)
Y - Morre Eligible Issue (Identifies a security that can be
traded on the morre system, an automated order routing
and trading system.)
Z - Non reporting issuer (Company is not required to file
corporate information with the OSC.)
LONDON Trade Indicators:
F - Automated Input Facility
A - Automatic Trade
(Volume,Last,High,Low)
B - Broker to Broker
(Volume, Last)
C - Bargain Condition
(Volume, Last)
Y - Contra Trade
D - Delayed Trade
(Volume, Last, High, Low)
K - Block Trade
(Volume, Last)
L - Late Trade
(Volume, Last)
'c' - Late Trade Correction
M - Market Maker to Market Maker
(Volume, Last)
N - Non- Protected Portfolio
(Volume, Last)
'n' - Not to Mark
'r' - Non risk Trade
(Volume, Last)
p - Protected Portfolio
(Volume, Last)
'p' - Protection is applied
(Volume, Last)
Z - Worked Principal Portfolio Notification
O - Overnight Trade
R - Riskless Principle at Different Prices
(Volume, Last)
'o' - Result of Options
(Volume)
't' - Risk Trade
(Volume, Last)
S - Stock swap
'k' - Single Protected Transaction
(Volume, Last)
's' - Test Security
V - Converted Price
(Volume, last)
Q - Volume Weighted Average Price
(Volume, Last)
'w' - Worked Principle Notification
(Volume, Last)
W - Worked Principle Trade
X - Cross at Same Time
Options:
A Cancel Trade
B Out of Sequence (Late Report)
C Cancel Last
D Late (In Sequence)
E Cancel Opening
F Open (Late, out of sequence)
G Cancel only trade. This was the only trade of the day for this contract, and is now to be canceled.
H Open. (Late, in sequence). This is a late report of the opening trade, but it is in the correct sequence.
I Electronic trade. Trade was executed electronically. Processed as a normal trade.
J Reopen. Trade is a reopening of an option contract, which has previously been halted. Processed. As a normal trade
K Adjustment. Trade is an option contract for which the terms have been adjusted to reflect a stock dividend, stock split, or similar event. Processed as a normal trade.
L Spread. Trade represents a trade in two options in the same options class (a buy and sell in the same class). Processed as a normal trade.
M Straddle. Trade represents a trade in two options in the same option class (a buy and a sell in the same class). Processed as a normal trade.
N Stopped. Trade is the execution of a sale at a price agreed upon by the floor personnel involved, where a condition of the trade is that it is reported following a non-stopped trade of the same series at the same price.
O Cancel stopped transaction.
P Buy Write. Transaction represent the option portion of a buy/write (buy stock, sell call options). Processed as a normal trade.
*********************************************************************
The top line list monthly values for the last twelve months. The next three lines the high, low, and closing price for the same twelve months.
In addition to the monthly volatilities, eight more volatilities are shown in the line below the monthly prices. The first six values (reading left to right) are historical values of volatility. These historical values represent the following time periods: 30 days (1mo), 90 days (3 mo.), 180 days (6 MO), 365 days (12mo), and for the current year to date and for the current month to date. The high and low prices for these periods are shown below the volatilities.
The last two volatility values are the implied and today’s volatilities. The implied volatility is deprived from the security’s options. The value shown is a weighted average of the individual options implied volatilities.
Today’s volatility is based on the price fluctuation of the stock for today.
The last item shown on this line, shares out. (K), is the number of shares outstanding in thousands.
*********************************************************************
Market Pulse data is available for the following categories.
pageNum category
100 NYSE stocks
200 AMEX stocks
300 NASD stocks
1100 Toronto
1200 Montreal
1300 Vancouver
2100 UK
6100 OTCBB
400 equity options
500 index options
600 Averages
700 Statistics
800 Index Futures
900 Currencies
To get a list of the available pages for any category and their codes, enter the pageNum of that category.
To request a particular page for a market, add the code for that page to the category code. So NYSE Most Active can be gotten by asking for NYSE (100) plus most active (1), which gives us 101. Similarly NASD (300) most down (3) is 303.
You can enter .1 after any page # to see yesterday’s data. (e.g. 101.1)
You can enter .2 after any page # to see after-hours data. (e.g. 101.2)
The response is formatted in ASCII characters and aligned columns - each line may be up to 160 chars.
*********************************************************************
These are the fields returned for each of the
mtBrokerTableSourceType:
Fields may be expanded.
Check the actual fields in the headingLine message.
Account Info
User Name
First Name
Last Name
Middle Initial
Address
City
State
Zip
Country
Home Phone
Bus Phone
Fax
Number Trades this Month
Com. Trades Last Month
Clearing Broker
Show Position
Account
Buying Power
Marginable Market Value
Market Value
Cash
Account Value
Realized P&L
Unrealized P&L
Checking Availability
% Equity
Status
Date
Time
Action
Qty
Symbol
Type
Price
Filled
Order Id
Description
Cond
Durat
Stop
Routed
acct id
OType
TQty
FQty
acct id
Market
Tag
Alias
Avg Price
Symbol
Quantity
Cur Price
Cur Value
Avg Price
Cost
Real P&L
UnReal P&L
Total P&L
Description
Symbol
Date
acct id
acct id
M
Alias
Symbol
P&L
acct id
Symbol
Alias
Date
Time
Symbol
Action
Quantity
Price
Comm
SEC fee
ECN fee
Total
Order Id
Description
acct id
MMid
acct
key
Alias
Date
Amount
Description
Acct
Alias
*********************************************************************
***********
***********
·
BrokerRequestCancelOrder
·
Documentation
enhancements:
o Order ack/exe message handling
o Broker Rejection Codes
·
The following
bugs fixed:
o Bid
/ Ask size for Globex futures
o Program ‘freeze’ on Order errors
***********
***********
·
New brokerage
responses
·
Added Split
factors to msgHistory
Changed Responses:
|
Request |
New
Event (…new message): |
Old
Event (…old message): |
|
GotBrokerTable(…msgBrokerTable) |
GotBrokerAccountSummary
(…msgAccountSummary) |
|
|
GotBrokerTable(…msgBrokerTable) |
GotBrokerAcctPosition(…msgAcctPosition) |
|
|
GotBrokerTable(…msgBrokerTable) |
GotBrokerOrders(…msgAcctOrders) |
|
|
GotBrokerTable(…msgBrokerTable) |
GotBrokerTransaction(…msgAcctTransData) |
|
|
GotBrokerTable(…msgBrokerTable) GotBrokerMessage(… msgBrokerMessage) |
GotBrokerOrderAck(…msgOrderAcknowledge) GotBrokerOrderExec(…msgOrderExecuted) |
**************
**************
bidSize As Long
askSize As Long
now are also valid for options
bidSize As Long
askSize As Long
Support for
Reserve Book orders
reserveBook As Byte set this to 1 if it's a reserve book order
reserveBookQty As Long what to show for a reseved book order
hiddenOrder As Byte determines if this order is hidden or shown on the book
' 0=no 1=yes to all 2=to all except subscribers
Support for
Pegged and Trailing stop orders
Enum mtOrderTypes
PEGGED_ORDER = 7
peggedType As Byte 1=peg the bid 2=peg the ask
discretionAmt As Single used for pegging order type
flags As Integer see mtOrderFlagEnum bit fields
Enum mtOrderFlagEnum
mtOrderFlagOnBook = 2 ' leave order on the book
End Enum
**************
**************
changed SDK port #
added Function BrokerRequestAllocation
added Function RequestTickData
added Function getVersion()
RequestQuote returns additional fields:
tickValue
stock fields
timeOfQuote
afterMktVolume
vwap
newsVendor
option fields
contractSize
Function RequestTicks
Triggers new events:
added Event GotMsgFromTrack
**************
**************
allow routing to Boston Phil. etc.
**************
**************
fixed bug with composite data retrieval
**************
**************
moved development from Windows NT to Windows XP
**************
**************
internal fixes
fixed routing bug for BOSX etc.
**************
**************
internal fixes
**************
**************
internal fixes
FIXED RequestHistory (EURUSD)