QuoteTracker HTTP Protocol Specs

QuoteTracker contains a Web server inside it that responds to a certain set of commands so that external programs can extract information from it. The server is bound to address 127.0.0.1 only – this way any information that is received from QuoteTracker does not fall under the "redistribution" heading – and 2GK avoids legal troubles from data providers or from the exchanges.

You must first enable the HTTP Server in QuoteTracker. The setting is on the Preferences screen, MISC tab.

By default, QuoteTracker’s Web server monitors port 16239 – you can change that on the Preferences/Misc screen as well.

The calling format is:
http://127.0.0.1:PortNum/Req?FunctionName(Param1,Param2,Param2,etc)
(where PortNum is the port number (default 16239 – see above), and the function names and parameters are described below.
 
Each call will return a text file. The 1st line in the text file that is returned is the status line – it starts with either OK or Error and may contain the error message or additional information. The lines that follow the 1st one are described below for each one of the functions:


EnumPorts
Description: Returns all portfolios - ID and Name. Currently selected portfolio on the main screen will be first in the list (2.4.9A and above)
Returns:
PortID,Port NamePortID,Port Name...


EnumPortSymbols(PortID)
Description: Returns symbols in the portfolio that is specified. In ver. 2.4.9A and above, CURRENT can be used as a PortID to represent the current portfolio
Returns:
Ticker,Ticker,Ticker,Ticker,Ticker,...


EnumSymbols()
Description:
Returns all symbols for which QT has data. In Ver. 2.4.9C and above, you can also pass ACTIVE as a parameter to return only symbols in one or more portfolios or Watchlist

Returns:
Ticker,Ticker,Ticker,Ticker,Ticker,...


EnumIndices
Description:
Returns all Index symbols for which QT has data
Returns:
Ticker,Ticker,Ticker,Ticker,Ticker,...


EnumEquities
Description:
Returns all Equity symbols for which QT has data
Returns:
Ticker,Ticker,Ticker,Ticker,Ticker,...


GetLastQuote(Ticker,Ticker,Ticker....)
or
GetLastQuote(*)
Description: Returns "last quote" info for the specified tickers. Special Parameters:
* - returns quotes on all stocks in the system
CURRENT - (ver 2.4.9C and above) Returns quotes on all symbols in the current portfolio on the main QT screen.
ACTIVE - (ver 2.4.9C and above) Returns quotes on symbols in all portfolios (but not stuff that may be in the database, but has been removed from portfolios
Returns
Ticker,Date,Time,Last,Bid,Ask,Change,Tick,Volume,High,Low,BidSize,AskSize,LastVolume,AvgTrade,NumTrades,Open,52WeekLow,52WeekHigh
Ticker,Date,Time,Last,Bid,Ask,Change,Tick,Volume,High,Low,BidSize,AskSize,LastVolume,AvgTrade,NumTrades,Open,52WeekLow,52WeekHigh
...

Example:
http://127.0.0.1:16239/req?getLastQuote(CMGI,DELL)
Return:
OK
CMGI,04/14/2000,21:59:32,52.062,52.5,53,-14.1875,-,18376400,74.5,50,-1,-1,-1,-1,-1,
DELL,04/14/2000,21:59:32,47.625,47,47,-4.0625,-,36014700,51.25,47,-1,-1,-1,-1,-1,
...


GetTimeSales(Ticker,FromTime,ToTime)
Description: Returns "time and sales" info for the specified ticker from FromTime to ToTime (if FromTime=0 - then from earliest, if ToTime=0 then to latest)
Returns
Date,Time,Last,Ask,Bid,Volume
Date,Time,Last,Ask,Bid,Volume

NOTE: The DATE is in MM/DD/YYYY format

Example:
http://127.0.0.1:16239/req?GetTimeSales(DELL,09:45:00,09:47:00)
Return:
OK
04/14/2000,09:45:02,50,50.125,50.062,4300
04/14/2000,09:45:04,50,50.125,50,9300
04/14/2000,09:45:08,50.062,50.062,50.062,9200
04/14/2000,09:45:10,50,50.062,50.062,4600
04/14/2000,09:45:13,50,50.062,50.062,12000
04/14/2000,09:45:15,50.062,50.062,50,1500
04/14/2000,09:45:19,50.062,50.062,50,900
...


AddStocksToPort(PortID,Symbol,Symbol,...)
Description: Adds specified symbols to the end of the specified portfolio. PortID is the ID of the portfolio, or CURRENT for currently shown portfolio, or NEW:Portfolio+Name for a new portfolio.
NOTE: QuoteTracker will NOT check for duplicates during this call. You must do that yourself

Example:
http://127.0.0.1:16239/req?AddStocksToPort(CURRENT,MSFT,INTC)
Return:
OK portfolio updated
...


AddDetailedStocksToPort(PortID,Symbol,Num_Shares,Base_Price,Commission,Symbol,Num_Shares,Base_Price,Commission,...)
Description: Adds specified symbols to the end of the specified portfolio with specified parameters. PortID is the ID of the portfolio, or CURRENT for currently shown portfolio, or NEW:Portfolio+Name for a new portfolio.
NOTE: QuoteTracker will NOT check for duplicates during this call. You must do that yourself

Example:
http://127.0.0.1:16239/req?AddDetailedStocksToPort(CURRENT,MSFT,100,10.5,9.95)
Return:
OK portfolio updated
...


RemoveStocksFromPort(PortID,Symbol,Symbol,...)
Description: Removes specified symbols from the specified portfolio. PortID is the ID of the portfolio, or CURRENT for currently shown portfolio.

Example:
http://127.0.0.1:16239/req?RemoveStocksFromPort(CURRENT,MSFT,INTC)
Return:
OK portfolio updated
...


GetVersion()
Description: Returns the current QuoteTracker version.
NOTE: Ver 2.4.9C and above

Example:
http://127.0.0.1:16239/req?GetVersion()
Return:
OK
2.493
...


GetAdData()
Description: Returns The actual ad click percentage and the minimum ad click percentage needed for QTServer to operate. If the user is registered or other circumstances are present where this restriction is not relevant, zero will be returned for the minimum percentage
Returns
Actual %,Minimum %