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

 

Overview... 8

New Broker message types (rev. 4.00) 8

Control. 8

Installation.. 9

Demo programs: 9

Getting Started.. 9

general support. 9

General Features.. 11

Function getVersion.. 11

Function Init. 11

Function DeInit. 12

Function Connect. 12

Event GotDisconnect. 12

Event GotError.. 13

Class msgError. 13

Function RequestLogon.. 13

Event GotLogonResponse. 13

Class msgLogon. 13

Function Requestlogoff. 14

Event GotLogoffResponse. 14

Function getStats. 14

Type mtStats. 14

Function logStart. 15

Enum mtLogLevel 15

Function logEnd.. 15

Function RequestQuote. 15

Event GotQuote. 16

Type msgQuote. 16

Function RequestCompositeData.. 17

Event GotCompositeData. 18

Function RequestBackground.. 18

Event GotBackground. 18

Type msgBackground. 18

Function RequestTicks. 19

Event GotTick. 19

Type msgTick. 19

Event GotMiscUpdate. 20

Type msgMiscUpdate. 20

Event GotNewsUpdate. 20

Function RequestTickHistory.. 21

Event GotTickHistory. 21

Type msgTickHistory. 21

Function RequestTickHistoryTime. 22

Function RequestTodaysLog (aka: Time & Sales) 22

Enum mtPageFlag. 22

Event GotTodaysLog. 22

Function RequestYesterdaysLog.. 23

Event GotYesterdaysLog. 23

Function RequestHistory.. 23

Event GotHistory. 24

Type msgHistory. 24

Class historyItem.. 24

Function RequestOptionData.. 25

Event GotOptionData. 25

Type msgOptionData. 25

Function RequestOptionLinks. 26

Event GotOptionLinks. 27

Type msgOptionLinks. 27

Function RequestFutureData.. 27

Event GotFutureData. 27

Type msgFutureData. 27

Function RequestVolatility.. 28

Event GotVolatility. 28

Function RequestNasdaqLevelII 29

Event GotNasdaqLevelII 29

Type msgNasdaqLevelII 29

Enum mtNasdaqTrend. 30

Function RequestSymbolLookup. 30

Event GotSymbolLookup. 31

Type msgSymbolLookup. 31

Function RequestNewsHeadlines. 31

Event GotNewsHeadline. 31

Type msgNewsHeadline. 31

Function RequestTickData.. 32

Event gotTickData. 32

Type msgTickData. 32

Function RequestTkrHeadlines. 33

Event GotTkrHeadline. 33

Type msgNewsHeadline. 33

Function RequestYesterdaysNews. 33

Function RequestNewsStory.. 34

Event GotNewsStory. 34

Type msgNewsStory. 34

Function RequestHistHeadlines. 34

Event GotHistHeadlines. 35

Function RequestHistStory.. 35

Event GotHistStory. 35

Function RequestNewsRoundup. 35

Enum mtTodayYesterday. 36

Function RequestNewsVendors. 36

Event GotNewsVendor. 36

Type msgNewsVendor. 36

Function RequestNewsByVendor.. 36

Event GotNewsByVendor. 37

Third Party Functions.. 37

Function RequestThirdPartyBarra.. 37

Event GotThirdPartyBarra. 37

Function RequestThirdPartyEdgarOnline. 37

Event GotThirdPartyEdgarOnline. 38

Type msgEdgarOnline. 38

Function RequestThirdPartyHemmingtonScott. 38

Event GotThirdPartyHemmingtonScott 38

Function RequestThirdPartyMarketGuide. 38

Event GotThirdParty MarketGuide. 39

Function RequestThirdPartyMarketPulse. 39

Event GotThirdPartyMarketPulse. 39

Function RequestThirdPartyMediaGeneral. 39

Event GotThirdMediaGeneral 40

Function RequestThirdPartySimplyStocks. 40

Event GotThirdPartySimplyStocks. 40

Function RequestThirdPartyVickers. 40

Event GotThirdPartyVickers. 41

Function RequestThirdPartyZacksEarnings. 41

Event GotThirdPartyZacksEarnings. 41

Function RequestNetEarnings. 41

Event GotNetEarnings. 41

Data Warehouse Functions. 42

RequestDataSave. 42

RequestDataRetrieve. 42

RequestDataDelete. 42

Event GotDataWarehouse. 43

Type msgDataWarehouse. 43

Brokerage Functions.. 43

Function BrokerContestSet. 43

Function BrokerRequestAcctIds. 44

Event GotBrokerAcctIds. 44

Type msgBrokerAcctIds. 44

Event GotBrokerTable                    (New 4.00) 44

Class msgBrokerTable. 45

Enum mtBrokerLineType. 45

Enum mtBrokerTableSourceType. 45

Event GotBrokerMessage                    (New 4.00) 45

class msgBrokerMessage. 46

Enum mtBrokerColor. 46

Function BrokerRequestAcctInfo.. 46

Function BrokerRequestAcctSummary.. 47

Function BrokerRequestAcctPositions. 47

Function BrokerRequestAllocation.. 48

Function BrokerRequestTransactionData.. 49

Function BrokerRequestOrders. 50

Function BrokerEnterNewOrder.. 51

Class orderEntry. 51

Order Entry Response: 52

Enter Order Notes: 54

Event GotBrokerError. 55

Class msgBrokerError. 55

Function BrokerEnterConditionalOrder.. 55

Enum mtOsoOcoTrade. 55

Function BrokerEnterMutualFundOrder                    (NEW 4.00) 56

Enum mtMutFundAction. 56

Enum mtMutFundInstruction. 56

Enum mtMutFundBalance. 56

Function BrokerEnterOptionSpreadOrder                    (NEW 4.00) 56

Routing Class. 57

Function ECNTurnOn.. 58

Function ECNTurnOff. 58

Function NasdaqSet. 59

Function ListedSet. 59

Function OptionSet. 59

Function OTCSet. 60

Function RequestMarketMakerDefinition.. 60

Enum mtMarketMakerRequest 60

Event GotMarketMakers. 60

Type msgMarketMaker. 61

Function Copy.. 61

Function BrokerEnterOrder                    (deprecated) 61

Function BrokerCancelOrder                     (deprecated) 61

Function BrokerRequestCancelOrder.. 61

Misc. Classes & Types.. 63

Type mtLine. 63

Class mtDate. 63

Type mtPage. 63

Type mtTime. 63

Misc. Enums.. 64

Enum mtInstType. 64

Enum mtTransactionTypes. 64

Enum mtBrokerInstType             (NEW) 64

Enum mtErrorCode. 65

Client side error codes. 65

Server side error codes. 65

Enum mtTickType. 67

Enum mtPeriodicityEnum... 67

Enum mtStartStopEnum... 67

Appendix.. 68

Exchange Codes: 68

Market Codes. 68

Stock Sale Condition Indicators: 70

Volatility Display.. 75

Market pulse. 75

BrokerMsgTable field details.. 76

mtbAccountInfo. 76

MtbAccountSummary. 77

MtbAllOrders. 77

MtbOpenOrders. 77

MtbClosedOrders. 77

MtbOtherOrders. 77

MtbAllPositions. 77

MtbOpenPositions. 77

MtbClosedPositions. 78

MtbSecurityTransactions. 78

MtbOtherTransactions. 78

Revision History.. 79

Version 2.48. 79

Version 4.00. 79

Version 4.17. 79

The following fields of Type msgQuote. 80

Added the following fields to Type msgOptionData. 80

Class orderEntry. 80

Version 4.20. 80

 


Overview

 

New Broker message types (rev. 4.00)

This release incorporates Track Data’s new broker message format.

 

New message types:

msgBrokerTable

msgBrokerMessage

 

New message types will be sent for: See the individual requests for details.

BrokerRequestOrders()

BrokerRequestAccountInfo()

BrokerRequestAcctSummary()

BrokerRequestAcctPositions()

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

Control

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)

 

Installation

            The installation package installs the following file:

           

                        mtocx.ocx       installed in the “system” directory

 

Demo programs:

Download the demo code/applications at: http://www.pactconsulting.com/mytracksdk/general/resources.html

Getting Started

            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.

 

general support

 

 ‘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

 

 

 

Programming tips:

           

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

 

 

General Features

 

------------------------------------------------------------------------------------------------------------

Function getVersion     

Returns version #

 

Public Function GetVersion() As String

Syntax:

version = object.GetVersion ()

 

------------------------------------------------------------------------------------------------------------

Function Init  

Initialize this Control

 

Syntax:

errCode = object.Init()

 

Note:

1.      must be called before everything else

2.      There is no response to this function

------------------------------------------------------------------------------------------------------------

Function DeInit

            De-initializes the control

 

Syntax:

errCode = object. DeInit()

Note:

There is no response to this function

           

 

------------------------------------------------------------------------------------------------------------

 

 

Function Connect

            Connect to MyTrack™ host

 

Syntax:

errCode = object.Connect()

Note:

There is no response to this function

           

 

------------------------------------------------------------------------------------------------------------

 

Event GotDisconnect

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

 

------------------------------------------------------------------------------------------------------------

 

Event GotError

            got error message from host

 

GotError(rqn as integer, msg As msgError)      

 

Class msgError       

error condition reported by host

 

Properties:

 

error As mtErrorCode                            see server side errors

------------------------------------------------------------------------------------------------------------

Event GotMsgFromTrack

            Got unsolicited message from Track Data

 

GotMsgFromTrack (rqn as integer, msg As msgFromTrack)        

 

Type msgFromTrack

    text        As String

    flag        As String       ' =more text to follow, 2=this is the last line

End Type

------------------------------------------------------------------------------------------------------------

Function RequestLogon         

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

 

Event GotLogonResponse             

            GotLogonResponse(rqn as integer, msg As msgLogon)

 

Class 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

------------------------------------------------------------------------------------------------------------

Function Requestlogoff

Request logoff from(tm) MyTrack™ host.

 

Syntax:

errCode = object.RequestLogon(rqn)

 

Parameters:

rqn As Integer                          request # - returned in response

           

Control responds with GotLogoffResponse Event

 

Event GotLogoffResponse             

            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

 

------------------------------------------------------------------------------------------------------------

Function getStats

Retrieves internal statistics

 

Syntax:

ErrCode = object.GetStats (stats)

 

Parameters:

stats As mtStats                      statistics returned here

           

 

Type mtStats 

 

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

 

------------------------------------------------------------------------------------------------------------

Function logStart

            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.

Enum mtLogLevel

            llFatal = 1                               highest level

            llFailure = 2

            llError = 3

              llMessage = 4

            llInfo = 5                                  lowest

End Enum

 

 

Function logEnd

            Ends logging

 

            Syntax:

                        ErrorCode = object.logEnd()

Note:

            There is no response to this function

 

 

------------------------------------------------------------------------------------------------------------

Function RequestQuote

 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.

 

Event GotQuote

            GotQuote(rqn as integer, msg As msgQuote)     

 

Type 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

------------------------------------------------------------------------------------------------------------

Function RequestCompositeData

            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.

           

Event GotCompositeData

            GotCompositeData(rqn As Integer, msg As Type msgQuote)

 

            See definition of Type msgQuote,

                       

------------------------------------------------------------------------------------------------------------

Function RequestBackground

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.

 

 

Event GotBackground       

            GotBackground(rqn as integer, msg As msgBackground)      

 

 

Type 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

 

------------------------------------------------------------------------------------------------------------

 

 

Function RequestTicks

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.

 

Event GotTick                     

GotTick(rqn as integer, msg As msgTick)        

 

Type 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

 

Event GotMiscUpdate

GotMiscUpdate(rqn As Integer, msg As msgMiscUpdate)

 

Type msgMiscUpdate 

                CompositeVolume            As Long

               vwapRaw                         As long             Volume weighted average price

                                                                                    convert using Block Factor

End Type

 

Event GotNewsUpdate

            GotNewsUpdate(rqn As Integer, msg As msgNewsUpdate)

Type 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

------------------------------------------------------------------------------------------------------------

Function RequestTickHistory

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

 

 

Event GotTickHistory

GotTickHistory (rqn As Integer, msg As msgTickHistory)

 

Type 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

------------------------------------------------------------------------------------------------------------

Function RequestTickHistoryTime  

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

------------------------------------------------------------------------------------------------------------

Function RequestTodaysLog (aka: Time & Sales)

            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

 

Enum mtPageFlag

               FirstPage = 0

              PageDown = 1

               PageUp = 2

End Enum

 

Event GotTodaysLog

            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”

 

------------------------------------------------------------------------------------------------------------

 

Function RequestYesterdaysLog

            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

 

Event GotYesterdaysLog

            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

 

           

------------------------------------------------------------------------------------------------------------

 

 

Function RequestHistory

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

 

Event GotHistory

            GotHistory(rqn as integer, msg As msgHistory)

 

Type 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

 

Class historyItem

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

 

------------------------------------------------------------------------------------------------------------

Function RequestOptionData

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.

 

 

Event GotOptionData

GotOptionData(rqn As Integer, msg As msgOptionData)

 

Type 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.

 

------------------------------------------------------------------------------------------------------------

Function RequestOptionLinks

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.

 

 

Event GotOptionLinks

GotOptionLinks(rqn As Integer, msg As msgOptionLinks)

 

Type msgOptionLinks

            error                 As mtErrorCode

num                  As Byte                 # of link tickers

ticker(20)             As String               array of tickers 

End Type

 

------------------------------------------------------------------------------------------------------------

Function RequestFutureData

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.

 

 

Event GotFutureData

GotFutureData(rqn As Integer, msg As msgFutureData)

 

Type 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

 

 

------------------------------------------------------------------------------------------------------------

Function RequestVolatility

            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

 

 

Event GotVolatility

            GotVolatility (rqn As Integer, msg As type mtPage)

 

            See definition of mtPage

           

For format of volatility display see appendix,

           

------------------------------------------------------------------------------------------------------------

Function RequestNasdaqLevelII

            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

 

Event GotNasdaqLevelII

            GotNasdaqLevelII(rqn As Integer, msg As msgNasdaqLevelII)

 

Type 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

 

Enum mtNasdaqTrend

            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

------------------------------------------------------------------------------------------------------------

 

Function RequestSymbolLookup

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.

 

 

Event GotSymbolLookup

GotSymbolLookup (rqn As Integer, msg As msgSymbolLookup)

Type 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.

------------------------------------------------------------------------------------------------------------

 

Function RequestNewsHeadlines

            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

Event GotNewsHeadline   

GotNewsHeadline(rqn as integer, msg As msgNewsHeadline)  

 

Type 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

------------------------------------------------------------------------------------------------------------ 

Function RequestTickData

      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).

 

Event gotTickData  

gotTickData (rqn as integer, msg As msgTickData)

 

Type 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

 

------------------------------------------------------------------------------------------------------------ 

Function RequestTkrHeadlines

            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.

 

Event GotTkrHeadline       

GotTkrHeadline(rqn as integer, msg As msgNewsHeadline)  

 

Type 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

 

------------------------------------------------------------------------------------------------------------ 

Function RequestYesterdaysNews

            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

 

------------------------------------------------------------------------------------------------------------ 

 

Function RequestNewsStory

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

 

 

Event GotNewsStory

GotNewsStory(rqn as integer, msg As msgNewsStory)        

 

Type 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

 

------------------------------------------------------------------------------------------------------------

 

Function RequestHistHeadlines

 

            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.

 

Event GotHistHeadlines

            GotHistHeadlines(rqn As Integer, msg As Type msgNewsHeadline)

            See definition of msgNewsHeadline

 

------------------------------------------------------------------------------------------------------------

 

Function RequestHistStory

            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

 

Event GotHistStory

            GotHistStory(rqn As Integer, msg As Type msgNewsStory)

            See definition of msgNewsStory

 

------------------------------------------------------------------------------------------------------------

Function RequestNewsRoundup

            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

 

Enum mtTodayYesterday

            Today = 1

               Yesterday = 2

End Enum

 

Note:

            Must be actively monitoring ticks (RequestTicks) to use NewsRoundup function

 

------------------------------------------------------------------------------------------------------------

Function RequestNewsVendors

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

 

Event GotNewsVendor

GotNewsVendor(rqn as integer, msg As msgNewsVendor) 

 

Type 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

 

------------------------------------------------------------------------------------------------------------

 

Function RequestNewsByVendor      

            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

 

Event GotNewsByVendor

            GotNewsByVendor (rqn As Integer, msg As Type msgNewsHeadline)

            See definition of msgNewsHeadline   

 

 

Third Party Functions

 

------------------------------------------------------------------------------------------------------------

Function RequestThirdPartyBarra

            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

 

Event GotThirdPartyBarra

            GotThirdPartyBarra(rqn As Integer, msg As Type mtLine)

 

See definition of mtLine

 

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyEdgarOnline

            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,

 

Event GotThirdPartyEdgarOnline

            GotThirdPartyEdgarOnline (rqn As Integer, msg As msgEdgarOnline)

 

Type 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

 

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyHemmingtonScott

            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

 

Event GotThirdPartyHemmingtonScott

GotThirdPartyHemmingtonScott (rqn As Integer, msg As Type mtLine)

 

See definition of mtLine

 

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyMarketGuide

            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

 

Event GotThirdParty MarketGuide

            GotThirdParty MarketGuide (rqn As Integer, msg As mtPage)

 

See definition of mtLine

 

 

------------------------------------------------------------------------------------------------------------

 

 

Function RequestThirdPartyMarketPulse

            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

 

Event GotThirdPartyMarketPulse

            GotThirdPartyMarketPulse (rqn As Integer, msg As Type mtLine)

 

See definition of mtLine

 

Note:

The host refreshes market pulse data every 15/20 minutes.

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyMediaGeneral

            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

 

Event GotThirdMediaGeneral

            GotThirdMediaGeneral (rqn As Integer, msg As Type mtLine)

 

See definition of mtLine

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartySimplyStocks

            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

 

Event GotThirdPartySimplyStocks

            GotThirdPartySimplyStocks (rqn As Integer, msg As Type mtLine)

 

See definition of mtLine

 

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyVickers

            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

 

Event GotThirdPartyVickers

            GotThirdPartyVickers (rqn As Integer, msg As Type mtLine)

 

            See definition of mtLine

------------------------------------------------------------------------------------------------------------

 

Function RequestThirdPartyZacksEarnings

            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

 

Event GotThirdPartyZacksEarnings

            GotThirdPartyZacksEarnings (rqn As Integer, msg As Type mtLine)

 

            See definition of mtLine

 

------------------------------------------------------------------------------------------------------------

 

Function RequestNetEarnings

            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

 

Event GotNetEarnings

            GotNetEarnings (rqn As Integer, msg As Type mtLine)

 

            See definition of mtLine

 

 

           

------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------

 

Data Warehouse Functions

            Enables storing and retrieving data via myTrack servers

 

            !!! Important !!!

Do not use the data warehouse functions if you also use the myTrack program.

 

RequestDataSave

            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

 

RequestDataRetrieve

            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

 

RequestDataDelete

            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

 

Event GotDataWarehouse

            GotDataWarehouse(rqn As Integer, msg As msgDataWarehouse)

 

Type 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

************************************************************************

 

------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------

 

Brokerage Functions

 

NOTE:

Before calling any brokerage functions:

 

After market hours orders will be acknowledged by TDC only, not by Broker.

 

------------------------------------------------------------------------------------------------------------

 

Function BrokerContestSet

            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

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestAcctIds

            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

 

Event GotBrokerAcctIds

GotBrokerAcctIds (rqn As Integer, msg as msgBrokerAcctIds)

 

Type 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.

 

------------------------------------------------------------------------------------------------------------

Event GotBrokerTable       (New 4.00)

GotBrokerTable (rqn As Integer, msg As msgBrokerTable)

 

Class 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

 

Enum mtBrokerLineType

headingLine = 72              ' H

bodyLine = 66                    ' B

endLine = 69                     ' E

appendLine = 65                ' A

removeLine = 82    ' R

updateLine = 85     ' U

 

Enum mtBrokerTableSourceType

 

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:

BrokerRequestAccountOrders()

BrokerRequestAccountInfo()

BrokerRequestAcctSummary()

BrokerRequestAcctPositions()

BrokerRequestTransactionData()

 

Unsolicited GotBrokerTable events will be fired to update the position, order and transaction information.

 

------------------------------------------------------------------------------------------------------------

Event GotBrokerMessage (New 4.00)

GotBrokerMessage (rqn As Integer, msg As msgBrokerMessage)

 

class msgBrokerMessage

            text messages from brokerage system

 

Public colorCode            As mtBrokerColor

Public text                   As String

 

Enum mtBrokerColor

 

COLOR_BLACK = 1       

COLOR_BLUE  = 2       

COLOR_GREEN = 4       

COLOR_RED = 3       

COLOR_YELLOW = 5       

 

-----------------------------------------------------------------------------------------

 

Function BrokerRequestAcctInfo

            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

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestAcctSummary

            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

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestAcctPositions

            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.

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestAllocation

            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

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestTransactionData

            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

 

------------------------------------------------------------------------------------------------------------

Function BrokerRequestOrders

            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.

 

------------------------------------------------------------------------------------------------------------

Function BrokerEnterNewOrder

            Enters a broker order

            See notes below

 

            Response is one or more of the following events:

GotBrokerTable

GotBrokerMessage

GotBrokerError

 

                                    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

Class orderEntry

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

 

Order Entry Response:

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.

 

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.

 

Enter Order Notes:

 

·        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.

 

------------------------------------------------------------------------------------------------------------

 

Event GotBrokerError

            Signals a rejected order.

 

GotBrokerError (rqn As Integer, msg As msgBrokerError)

 

The rqn will match the rqn of the BrokerEnterNewOrder() function call.

 

Class msgBrokerError

Public errorText        As String            rejection details

End

 

------------------------------------------------------------------------------------------------------------

 

Function BrokerEnterConditionalOrder

            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

 

            Enum mtOsoOcoTrade

                        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

           

------------------------------------------------------------------------------------------------------------

 

Function BrokerEnterMutualFundOrder     (NEW 4.00)

            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

 

Enum mtMutFundAction

    BUY

    SELL

    XCHANGE                            ‘use to buy ‘buySymbol’ and sell ‘sellSymbol’

End Enum

 

Enum mtMutFundInstruction

    REINVEST_ALL                     'reinvest dividends & capital gains

    PAY_DIVIDENDS            'pay dividends & reinvest cap.gains

    PAY_ALL                              'pay out dividends & capital gains

End Enum

 

Enum mtMutFundBalance

    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

 

------------------------------------------------------------------------------------------------------------

 

Function BrokerEnterOptionSpreadOrder  (NEW 4.00)

            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

 

------------------------------------------------------------------------------------------------------------

 

Routing Class

            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:

  1. Enable the bit for SelectNet in the BROKER_ORDER.ecnMap (bit 14, 0 base). SelectNet will be used to route to the asstd ECN destinations.
  2. Set the  MarketMaker[4] field to the 4 char MM/ECN id (ex: ISLD, BRUT…)

 

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:

 

 

Function ECNTurnOn

            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

                       

------------------------------------------------------------------------------------------------------------

Function ECNTurnOff

            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

------------------------------------------------------------------------------------------------------------

Function NasdaqSet     

            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

           

------------------------------------------------------------------------------------------------------------

Function ListedSet

            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

 

------------------------------------------------------------------------------------------------------------

Function OptionSet

            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

           

------------------------------------------------------------------------------------------------------------

Function OTCSet

            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

------------------------------------------------------------------------------------------------------------

Function RequestMarketMakerDefinition  

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
                                           

Enum mtMarketMakerRequest

mmrNasdaq = 1
mmrOTC_BB = 2
mmrListed = 3
mmrOptions = 4
mmrECNs = 5

End Enum

 

control responds with one or more GotMarketMakers events

 

Event GotMarketMakers

GotMarketMakers(irqn, flag as mtMarketMakerRequest, mmm as

msgMarketMaker)

 

Type 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

------------------------------------------------------------------------------------------------------------

           

Function Copy

            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     

------------------------------------------------------------------------------------------------------------

 

Function BrokerEnterOrder            (deprecated)

            Deprecated. Use BrokerEnterNewOrder

 

 

------------------------------------------------------------------------------------------------------------

 

Function BrokerCancelOrder             (deprecated)

            Deprecated.

Use  BrokerRequestCancelOrder

 

 

------------------------------------------------------------------------------------------------------------

 

Function BrokerRequestCancelOrder

            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:

 

 

 

 

 


Misc. Classes & Types

 

Type mtLine

            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

 

------------------------------------------------------------------------------------------------------------

Class mtDate

    month   As Integer

    day                 As Integer

    year                As Integer

------------------------------------------------------------------------------------------------------------

 

Type mtPage

            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

 

------------------------------------------------------------------------------------------------------------

 

Type mtTime

    hour                As Integer

    min                 As Integer

    sec                 As Integer

End type

------------------------------------------------------------------------------------------------------------


Misc. Enums

Enum mtInstType             

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

Enum mtTransactionTypes

   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

Enum mtBrokerInstType             (NEW)

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

 

                

Enum mtErrorCode

returned on function call OR as "error" in the data messages 

 

Client side error codes

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

     

Server side error codes

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

 

-------------------------------------------------------------------------------

 

Enum mtTickType   

    mtTradeType = 0                 trade

    mtQuoteType = 1                quote

End Enum

 

-------------------------------------------------------------------------------

Enum mtPeriodicityEnum

    mtDaily = 1

    mtWeekly = 2

    mtMonthly = 3

End Enum

 

-------------------------------------------------------------------------------

Enum mtStartStopEnum

    mtStart = 1

    mtStop = 2

End Enum

 

-------------------------------------------------------------------------------

 

 


Appendix

 

Exchange Codes:

            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

 

*********************************************************************

Market Codes

            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 

 

*********************************************************************


Stock Sale Condition Indicators:

 

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.

 

*********************************************************************

Volatility Display

 

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

 

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.

 

 

*********************************************************************

 

BrokerMsgTable field details

 

These are the fields returned for each of the mtBrokerTableSourceType:

Fields may be expanded.

Check the actual fields in the headingLine message.

 

mtbAccountInfo

Account Info

User Name

First Name

Last Name

Middle Initial

Address

City

State

Zip

Country

Home Phone

Bus Phone

Fax

Email

Number Trades this Month

Com. Trades Last Month

Clearing Broker

Show Position

 

MtbAccountSummary 

Account

Buying Power

Marginable Market Value

Market Value

Cash

Account Value

Realized P&L

Unrealized P&L

Checking Availability

% Equity

 

MtbAllOrders

MtbOpenOrders

MtbClosedOrders

MtbOtherOrders

            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

 

MtbAllPositions

MtbOpenPositions

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

 

MtbClosedPositions

Symbol

P&L

acct id

Symbol

Alias

 

MtbSecurityTransactions

Date

Time

Symbol

Action

Quantity

Price

Comm

SEC fee

ECN fee

Total

Order Id

Description

acct id

MMid

acct

key

Alias

 

MtbOtherTransactions

            Date

            Amount

            Description

            Acct

            Alias

 

*********************************************************************

 

Revision History

 

***********

Version 2.48

***********

 

·         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

 

***********

Version 4.00

***********

·         New brokerage responses

o       msgBrokerMessage

o       msgBrokerTable

·         Mutual Fund orders

·         Option Spread orders

·         Added Split factors to msgHistory

 

Changed Responses:

 

Request

New Event (…new message):

Old Event (…old message):

BrokerRequestAcctSummary

GotBrokerTable(…msgBrokerTable)

GotBrokerAccountSummary (…msgAccountSummary)

BrokerRequestAcctPositions

GotBrokerTable(…msgBrokerTable)

GotBrokerAcctPosition(…msgAcctPosition)

BrokerRequestOrders

GotBrokerTable(…msgBrokerTable)

GotBrokerOrders(…msgAcctOrders)

BrokerRequestTransactionData

GotBrokerTable(…msgBrokerTable)

GotBrokerTransaction(…msgAcctTransData)

Order Entry & cancel Response

GotBrokerTable(…msgBrokerTable)

GotBrokerMessage(… msgBrokerMessage)

GotBrokerOrderAck(…msgOrderAcknowledge)

GotBrokerOrderExec(…msgOrderExecuted)

 

**************

Version 4.17

**************

 

The following fields of Type msgQuote

bidSize            As Long

askSize            As Long

               now are also valid for options

 

 

Added the following fields to Type msgOptionData

bidSize            As Long

askSize            As Long

 

Class orderEntry

 

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

 

 

 

**************

Version 4.20

**************

 

            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:

Event GotMiscUpdate

Event GotNewsUpdate

 

added Event GotMsgFromTrack

 

 

**************

Version 4.21

**************

 

            allow routing to Boston Phil. etc.

 

**************

Version 4.22

**************

 

            fixed bug with composite data retrieval

 

**************

Version 4.23

**************

 

            moved development from Windows NT to Windows XP

 

**************

Version 4.31

**************

 

internal fixes

fixed routing bug for BOSX etc.

 

 

**************

Version 4.33

**************

 

internal fixes

 

**************

Version 4.34

**************

 

internal fixes

FIXED RequestHistory (EURUSD)