Professional Documents
Culture Documents
i
TABLE OF CONTENTS
(continued)
Page
ii
MarketView Web Services API 2.0
1 Introduction
MarketView provides customers with access to many data sets, including detailed
historical price data. The system makes available an Application Program Interface (API)
as detailed in this document.
1.1 Scope
This document provides methods definition, sample code, and all technical details
necessary for customers to develop applications that interface with the MarketView ASP
system.
2 System Overview
MarketView Web Services provides easy access to GlobalView’s Spot, Intraday, and
Historical Prices data sources, as well as Price Corrections and News, all delivered
through Web Services factoring. This gives you access to GlobalView’s realtime and
historical data from your custom applications.
• Easy access to spot, intraday, and historical price datasets, through an easy-to-
use web-centric API.
• Conditional filters permit easy filtering for the desired data.
• Instrument metadata.
• Corrections from the exchange/data provider.
• News.
• Set up intra-company data feeds for prices and news; the same data is available
for use by your MarketView clients.
• Monitor data imports for number of quotes poked; insertion errors.
Because all calls are expressed in standard Web Services Definition Language
(WSDL),you do not need proprietary software (neither DLLs nor JARs,) to access
MarketView data.
API User
XML
http://mvwebapi.gvsi.com/services/mt
Internet
External
GlobalView Network
The API is a set of SOAP/XML-based web services, exposed externally via a (HTTP) web
page. API users can request data by making SOAP requests.
POST /services/mt
Host: mvwebapi.gvsi.com
Content-Type: application/soap+XML; charset="utf-8"
Content-Length: ....
<env:Envelope XMLns:env="http://
www.w3.org/2003/05/soap-envelope" >
<env:Header>...
Data (XML):
<daily-
price><date>2005-04-
01...</daily-price>
All of the API methods are wrapped in a web services protocol within which a separate
policy handles exceptions relating to:
• User authentication,
• SOAP/XML message validation,
• Method “signature” validation,
• System availability,
• User (data entitlements) permissioning.
The response XML includes price data, a code and description to provide feedback to the
caller. Responses are as detailed as possible, providing feedback on an instrument-by-
instrument basis whenever possible. When a global error occurs, such as credential failure
or server error, a global response is returned. It should be noted also, a permission error
may be sent for one instrument if the user is a valid API user but not entitled to the
instrument requested.
MarketView software prevents concurrent use of software by the same user credentials.
MarketView Web Services preserves this limitation – it will “log off” users using the same
user account, from either MarketView or MarketView Web Services. It is to your
advantage therefore to procure separate accounts between your MarketView and
MarketView Web Services clients.
The Request String is a parameter that is present in the majority of MarketView Web
Service’s API function calls. The contents of the string follow XML conventions, according
to the schema described in API_REQUEST.xsd. This allows you great flexibility in terms of
specifying which field(s) you want to query, for which instrument(s), given which
condition(s). Here is a breakdown the component sections of a sample Request String,
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID=”/CLV6” /> 1
<INSTRUMENT INSTRUMENT_ID=”/CLQ6” />
...
</INSTRUMENTS>
<INSTRUMENT_SEARCHES>
<INSTRUMENT_SEARCH INSTRUMENT_ID=”/CL*” />
2
...
</INSTRUMENT_SEARCHES>
<CONDITIONS
START_DATE=”2006-06-01T12:00:00Z” 3
END_DATE=”2006-07-01T12:00:00Z”
AGGREGATE_TYPE=”F”
/>
<TAGS>
<TAG TAG_NAME=”INSTRUMENT_ID” />
<TAG TAG_NAME=”CLOSE” />
<TAG TAG_NAME=”HIGH” /> 4
<TAG TAG_NAME=”TRADE_DATETIME” />
</TAGS>
</API_REQUEST>
Notes:
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID=”/CLV6” />
<INSTRUMENT INSTRUMENT_ID=”/CLQ6” />
...
</INSTRUMENTS>
<INSTRUMENT_SEARCHES>
<INSTRUMENT_SEARCH INSTRUMENT_ID=”/CL*” />
...
</INSTRUMENT_SEARCHES>
<CONDITIONS
START_DATE=”2006-06-01T12:00:00Z”
END_DATE=”2006-07-01T12:00:00Z”
AGGREGATE_TYPE=”F”
/>
... Looking at the above request, you’ll see that we allow you specify a list of instruments by
their specific INSTRUMENT_IDs, but also allow you to simultaneously specify instruments
by wildcard masks. That collection of instruments are filtered through the CONDITIONS,
each of whom must be met.
Describing this through the metaphor of a SQL-language database, you can specify
queries like,
SELECT tag(s)
FROM GVSI_INFRASTRUCTURE
WHERE
(
( INSTRUMENT_ID = ‘id0’
OR INSTRUMENT_ID = ‘id1’
OR ...
OR INSTRUMENT_ID = ‘idx’)
OR
( INSTRUMENT_ID LIKE ‘pattern0’
OR INSTRUMENT_ID LIKE ‘pattern1’
OR ...
OR INSTRUMENT_ID LIKE ‘patternx’)
)
AND tag1 = ‘condition1’
AND tag2 = ‘condition2’
AND ...
AND tagx = ‘conditionx’;
Although describable in terms of a SQL database, keep in mind that our infrastructure is
tuned to be a ticker plant, not a general-purpose database. Specifically,
• Conditions can only be tested for equality.
• All conditions specified must be met for a record to match.
• We do however offer facilities for date range queries, using START_DATE and
END_DATE tags.
While you can use MarketView Web Services for data-mining queries, its underlying
infrastructure runs most efficiently when given specific queries.
MarketView Web Services API functions universally return a string value. That string is
formatted in XML, according to the schema laid out in API_RESPONSE.xsd. Again, there
are several sections of the response string; here is a breakdown of them,
Notes:
3. Each individual quote in turm is embedded within the tag, <INSTRUMENT>. The
individual fields are treated as attributes of the INSTRUMENT tag.
Within both the Request and Response strings, all attributes are expressed as string
values – e.g., they are wrapped in double-quotation marks (“”.)
1. Note that all arguments embedded in the Request String are handled as strings –
e.g., they are wrapped in double-quotation marks (“). A numeric value, therefore,
is expressed as VALUE=”5”, not VALUE=5.
2. All datetime fields are shown in ISO 8601 format. This means, expressed with the
format yyyy-mm-dd, followed by the letter ‘T’, then hh:mm:ss for the time
portion. The timezone immediately follows; expressed as an hour and minute
offset from UTC, with the format, ±hhmm . The abbreviation ‘Z’ may replace the
hour and minute offset, and denotes ‘+0000’.
• For example, Americas/Chicago (a.k.a., Central Standard Time, or CST)
would be denoted as “-0600”, as there are 6 hours difference between it
and the UTC. (Although, note that Daylight Savings Time affects the
offset from UTC.)
• Asia/Singapore (SGT) is expressed as “+0800”.
We’ve found that the best way to illustrate the conversation is to use a proxy that captures
and logs the packets. An example of such a proxy is tcpmon, which is part of the Apache
Foundation’s Axis 1 source distribution. Proxies such as tcpmon are very helpful for when
the dynamics of a conversation between the client are server are not understood.
HTTP/1.1 200 OK
X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-3.2.7 (build: ←
CVSTag=JBoss_3_2_7 date=200501280217)
Content-Type: text/xml;charset=utf-8 1
Date: Wed, 01 Nov 2006 20:59:20 GMT
Server: Apache-Coyote/1.1
Connection: close
While understanding what the “raw” XML looks like is helpful, by no means do we
recommend that your application creates or parses messages at this low level. Use a Web
Services library that supports the SOAP/XML protocol. The Apache Foundation’s
(http://www.apache.org) Axis 1 can be used for your client applications. Microsoft’s Visual
Studio (2003 and above) also comes with the .Net Web Services API. Other toolkits exist,
targeting different development languages and environments.
While we don’t advocate any toolkit over the other, we’re most familiar with The Apache
Foundation’s Axis 1, in terms of being able to offer suggestions/support.
From time to time, the exchange or data vendor may issue corrections to symbol quotes.
Often, the price is corrected, although other fields in the price quote could be corrected.
We handle corrections by,
• Updating the primary data stores, so you’ll receive the corrected field(s) if you
execute a query.
• Updating a correction data store, that keeps the trade date corrected, as well as
the date the correction was issued.
• As ISO symbols are different from other symbols, we keep their corrections in a
different data store than other symbols’ corrections.
http://mvwebapi.gvsi.com/services/mt
When dealing with future contracts, you have to be aware that contracts (frequently)
expire on a monthly basis. This necessitates that you know the exchanges’ symbology,
expiration dates, and be prepared to change your queries several times during the month.
To address this inconvenience, MarketView Web Services supports rolling symbol aliases.
To illustrate, let’s look at NYMEX Crude Light Future contracts, whose root symbol is
“/CL”. You could reference a specific contract by specifying its single-letter month
code/single-digit year code (as in /CLF07 for the January 2007 daily session contract,) but
specifying (and editing) the specific contracts you need is onerous and prone to mistakes.
Chances are your business analysts did not specifically want the January ’07 contract,
they wanted the front month’s contract. It just so happens that at a given time of the year,
the front month contract is the January ’07 contract. (But, later in the year, it will be the
February ’07 contract.)
We address this problem for you by providing rolling symbol aliases. These are
INSTRUMENT_IDs that contains the sequence “[num]” (squared brackets with a single-
digit.) The digit refers to how many months out from the current month’s Future Contract
you want to select. For example, assume it is January, and you want the contract that is
two months out. That would be the March contract. So, you should query for /CL[2]. If you
want the front month’s contract, that would be /CL[0]. The symbols are the concatenated
by using the root symbol (i.e, /CL) and square brackets with the month offset between.
For NYMEX, a “G” is added before the root symbol to avoid symbol conflicts.
The flipside, given that you ask for a symbol by its rolling symbol alias, how do you know
that /CL[0] refers to /CLF07? The “Actual” contract’s symbol has been mapped to the
UNDERLIER tag, which MarketView Web Services can return for you in your requests.
Continuous Symbology
A continuous symbol is one that is perpetual and builds a time-series based entirely on the front-month,
or any offset month, using the expiration dates of individual futures contracts to determine which data to
use for a given date in the time-series. These symbols use angle brackets (i.e., <>) with the month offset
in between to reference the month. For instance, front-month continuous for NYMEX Pit Session
Natural Gas is referenced by using the symbol “/NG<0>”, second-month is “/NG<1>” and so on. As with
alias symbols, to reference the Globex Session, put a “G” in front of the commodity code, “/GNG<0>”,
“/GNG<1>”, etc.
Your company might have proxies set up, to enable HTTP access through your firewall.
Some proxies may require user name and password to “leave the building.” Being able to
access the MarketView Web Services’ web site through your web browser is not absolute
proof that your proxy does not require authentication; the browser may already be set up
by your IT staff.
Such issues are generally between your IT staff and yourself; we’re not in a position where
we can provide much help. Although we’ll note that the underlying HTTP protocol layer in
your SOAP/XML toolkit should have support for setting up authentication for any proxies
your firm may have, see it’s documentation for details. Axis’ tcpmon is an excellent tool to
determine how your corporate proxy works: it is “too simple”(or unencumbered) to have
your authentication pre-configured, such as your web browser would be. Place it in-
between your client and the corporate proxy.
In Section 2.6, you saw that we return as the first line of the Response String a line that
looks like,
This is one place in the Response String where an error condition may be expressed to
you. The CODE attribute having any non-zero value is indicative of an error; the DETAILS
attempts to describe the error.If an error is reported here, then the request itself could not
be processed – e.g., you may have passed incorrect credentials.
The other sort of error that can be reported are errors at the per sub-request level. For
example, you queried for a number of symbols, but one of the symbols does not exist. You
would then see a response like,
(The error in the above example frequently happens because the symbol you are querying
for does not exist. A convenient way to check the validity of the
The API_REPONSE line will display values for CODE and DETAILS even if there is no
errors; the intra-response lines will display ERROR_CODE and ERROR_DESCRIPTION
only if there is an error. Regardless of where the error appears in the response, it follows
this error code mapping,
Code Description
0 Success
-10 General Error
-20 Authentication Error (invalid user name/password)
-30 Invalid Parameters in the web server request
-31 Invalid Instrument Attributes in the web server request
-32 Invalid Conditions Attributes in the web server request
-40 Instrument missing from response
7 Price and correction requests are limited to 10,000 instruments. Reduce
the number of instruments requested or narrow the instrument search
wildcard parameters.
8 Requested more than 50,000 price or correction price data elements.
Reduce the calendar range, the number of instruments requested, or
narrow the instrument search wildcard parameters.
120 You are not permissioned for the requested instrument(s). This can be
because a) you truly are not permissioned, or b) because the symbol is
misspelt, and there is no exchange associated with the symbol you asked
for.
130 A database error occurred.
136 The server is unable to retrieve the desired data because there it is unable
to locate a database for the requested data.
138 No instruments matched the query search pattern. Modify the search
parameter.
9001 Corrections are not available for the requested instrument.
MarketView Web Services API can be broken down into five categories of method calls.
These are,
• MetaData Retrieval
• Real & Historical Price Retrieval
• Data Quality
• Data Import/Upload
• “Utility” methods
This section provides a reference of those methods.
MetaData may be thought of as data concerning an instrument or instruments that are not
germaine to the realtime price or historical price data. Examples include, exchange where
traded, company name, currency, underlier security, etc. As this data is very static, we
often employ different infrastructure to store it than for historical or realtime prices. While
you generally can also receive metadata information from the price API methods,
understand that there’s an overhead of “joining” the query between two data stores.
3.1.1 getInstrumentList
Returns a list of instruments for the given exchange code, for which the user has query
permissions. The user can only specify one exchange code per invocation. The user can
get a list of “permissioned” exchange codes by issuing the “getExchangeList” method.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request String, formatted as per the schema at
API_REQUEST.xsd. This request must contain a
<CONDITIONS> clause specifying one (and only one)
EXCHANGE_CODE.
Condition Tags:
Name Description Required
EXCHANGE_CODE Must be specified. This is due to Yes
the high number of instruments that
may be returned (both in terms of
response time, and the length of the
returned string)
SECURITY_TYPE “F” for Futures; “FO” for Futures No
Options
UNDERLIER The underlying symbol. Either this or Yes, conditionally, refer to
OPTION_ROOT must appear. Description.
Default Tags:
Name
INSTRUMENT_ID, SYMBOL_DESCRIPTION, CURRENCY, SECURITY_TYPE,
LOT_UNITS, EXPIRATION_DATE, EXCHANGE_CODE, CONVERSION_FACTOR,
SESSION, PUT_CALL, UNDERLIER
User-Specifiable Tags:
Name Description
N/A N/A
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
<API_REQUEST>
<CONDITIONS EXCHANGE_CODE="PLG" />
</API_REQUEST>
<API_REQUEST>
<CONDITIONS EXCHANGE_CODE="NYM" OPTION_ROOT=”/CL” SESSION=”2” SECURITY_TYPE=”F” />
</API_REQUEST>
3.1.2 getInstrumentRootList
Returns a list of root instruments and associated metadata for which the user has
permissions to query/view data. There is no RequestXML parameter.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
Condition Tags:
Name Description
N/A There is no RequestXML parameter
Default Tags:
Name
INSTRUMENT_ROOT_NAME, INSTRUMENT_DESCRIPTION, CURRENCY,
SECURITY_TYPE, LOT_UNITS, EXPIRATION_DATE, EXCHANGE_CODE,
CONVERSION_FACTOR, SESSION, OPTION_ROOT
User-Specifiable Tags:
Name Description
N/A
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
N/A
3.1.3 getInstrumentMetaData
Returns metadata associated with a given symbol. NOTE: due to infrastructure limitations,
this method services only one Instrument per invocation.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request String, formatted as per the schema at
API_REQUEST.xsd. The request must contain a
<INSTRUMENTS> clause, containing one (and only one)
INSTRUMENT_ID.
Condition Tags:
Name Description
N/A N/A
Default Tags:
Name
INSTRUMENT_ID, SYMBOL_DESCRIPTION, CURRENCY, SECURITY_TYPE,
LOT_UNITS, EXPIRATION_DATE, EXCHANGE_CODE, CONVERSION_FACTOR,
SESSION, PUT_CALL, UNDERLIER
User-Specifiable Tags:
Name Description Required
INSTRUMENT_ID The security’s instrument Yes
identifier. If <TAGS> are
specified, this field must
appear in the request.
SYMBOL_DESCRIPTION The description of the tree Yes
node or individual symbol.
EXCHANGE_CODE The code that is used to Yes
group the symbol or tree
node for data access rights
per user.
EXCHANGE_CODE The code that is used to No
group the symbol or tree
node for data access rights
per user.
CURRENCY Code to represent quoted No
currency, if applicable.
Most symbol records will
have this field, node
records will not.
LOT_UNITS Code to represent quoted No
units of measure, if
applicable. Most symbol
records will have this field,
node records will not.
CONVERSION_FACTOR Value to represent a No
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
<API_REQUEST>
<!-- You can only specify one instrument per request -->
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/NGZ06" />
</INSTRUMENTS>
</API_REQUEST>
3.1.4 getCurrencyList
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
Condition Tags:
Name Description
N/A N/A
User-Specifiable Tags:
Name Description
N/A N/A
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available currency. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
N/A
3.1.5 getExchangeList
Returns a list of exchanges available in the infrastructure, and their associated metadata.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
Condition Tags:
Name Description
N/A N/A
User-Specifiable Tags:
Name Description
N/A N/A
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available exchange. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
N/A
3.1.6 getUserDefinedInstrumentList
Returns a list of user-defined instruments. These are known as “User Defined Formulas” in
the MarketView client, and allow the user to map a formula to an instrument symbol. The
“instruments” returned by this call in turn can be used in subsequent methods in
MarketView Web Services. The process of defining these instruments are outside the
scope of Web Services; use the MarketView GUI application to create/edit your user
defined instruments.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
Condition Tags:
Name Description
N/A N/A
User-Specifiable Tags:
Name Description
N/A N/A
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available exchange. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
N/A
3.1.7 getOptionRootInstruments
Returns a list of instruments associated with a root or an underlier symbol. This is useful if
you would like a list of current future contracts associated with Natural Gas, or options of
an underlying instrument. The CONDITIONS clause must appear in the request. Note: to
ensure responses with complete symbol lists, when requesting options, use the
“UNDERLIER” condition with a specific futures contract due to the 5000 symbol limit in a
singe request. For futures, you can use the “OPTION_ROOT” condition because the
returned list is hundreds of symbols (contracts) at the most. A user can use the response
from a futures chain request using “OPTION_ROOT” to get a list of non-expired
“UNDERLIER” symbols to issue option requests with.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML, with a requisite CONDITIONS clause.
Condition Tags:
Name Description
OPTION_ROOT The root symbol for option or futures contracts Either this or
UNDERLIER must appear.
UNDERLIER The underlying symbol. Either this or OPTION_ROOT must
appear.
SECURITY_TYPE “F” for Futures; “FO” for Options
SESSION Session the instrument trades on (“1”=Globex “2”=Day)
User-Specifiable Tags:
Name Description
N/A N/A
Default Tags:
Name
INSTRUMENT_ID, DISPLAY_CONTRACT_EXPIRATION_DATE,
SYMBOL_DESCRIPTION, EXCHANGE_CODE, CURRENCY, SECURITY_TYPE,
PUT_CALL, LOT_UNITS, CONVERSION_FACTOR, EXPIRATION_DATE,
UNDERLIER
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available exchange. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
<API_REQUEST>
<CONDITIONS
OPTION_ROOT="/CL"
SECURITY_TYPE="F"
SESSION="2" />
</API_REQUEST>
3.1.8 getVersion
Returns the version of MarketView Web Services. This method exists to facilitate customer
support issues. It is the exception to the rule, as it returns ithe version identifier in the
DETAILS attribute of the API_RESPONSE.
Arguments:
Type Name Description
N/A
Condition Tags:
Name Description
N/A
User-Specifiable Tags:
Name Description
N/A N/A
Default Tags:
Name
N/A
Response:
Type Description
String XML structured to contain a response for the request. The
API_RESPONSE’s error description field contains the version identifier.
Request XML
N/A
Response XML
3.1.9 getSymbolTree
Returns Symbol Explorer Tree navigation records. This method is used to build a user
application symbol explorer where symbols available in the GlobalView Software system
are grouped into logical categories.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request must contain a single
condition SYMBOL_TREE_PARENT_ID:
Condition Tags:
Name Description Required
SYMBOL_TREE_PARENT_ID A integer that is associated with Yes
a branch in the symbol tree. For
the “root” level of the tree use
“1”, for subsequent requests,
use the desired symbol tree id
from result set of a
getSymbolTree method request.
PERMISSIONED_ONLY “1” to retrieve only items from No
the symbol tree which the
requesting User has access
rights for.; “0” for all items in the
symbol tree regardless if the
User has access rights to a
specific data set. If condition
isn’t specified, it will default to
“1”.
User-Specifiable Tags:
Name Description Required
SYMBOL_TREE_ID The symbol tree integer that Yes
represents a level of the
navigation. This integer
can subsequently be used
by another getSymbolTree
method call to navigate the
tree down the desired node.
SYMBOL_DESCRIPTION The description of the tree Yes
Default Tags:
Name
SYMBOL_TREE_ID, SYMBOL_DESCRIPTION, INSTRUMENT_ID,
EXCHANGE_CODE, CURRENCY, LOT_UNITS, CONVERSION_FACTOR,
EXPIRATION_DATE, SECURITY_TYPE
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
<API_REQUEST>
<CONDITIONS SYMBOL_TREE_PARENT_ID="1" />
</API_REQUEST>
<API_REQUEST>
<CONDITIONS SYMBOL_TREE_PARENT_ID="27097" />
<CONDITIONS PERMISSIONED_ONLY="1" />
</API_REQUEST>
Example Request XML: Symbol Records returned from Symbol Tree Node
<API_REQUEST>
<CONDITIONS SYMBOL_TREE_PARENT_ID="27097" />
<CONDITIONS PERMISSIONED_ONLY="1" />
</API_REQUEST>
MarketView Web Services provides realtime pricing data in Intraday and Daily strips. We
also keep LiveQuote (latest) data, and Historical Trades (ticks) data stores. In addition, we
also keep corrections issued by the exchange.
ISO data is fairly different from other securities, keeping disparate information such as
usage hour and date, voltage et al. As such, we keep them in separate datastores, in daily
and hourly ISO strips. We also keep ISO corrections.
Rounding out our offerings is News. As in MarketView, you can receive a collection of
news headlines, headlines with the story body, or headlines with a URL that a HTML
browser can load & display.
3.2.1 getDailyPrices
Returns daily strip prices from the intraday datastore, for a user-defined set of instruments,
covering a user-defined period of time. The user may specify which Tags (a.k.a., fields)
they want to have returned, or rely on the default set of Tags.
Arguments:
Type Name Description
String User API user identifier
String UserPassword API user password (case-sensitive)
String requestXML Request XML. Any number of instruments can be
requested as shown below.
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS> clause; instead appears
in <INSTRUMENTS> (specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
START_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
END_DATE must be specified as well. Between the two fields,
creates a date-within-range query.
END_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
START_DATE must be specified as well, Between the two fields,
creates a date-within-range query.
DAYS_BACK Expressed as an integer. Synonymous with the START_DATE/
END_DATE pair, with the proviso that END_DATE is the current
date.
RECORDS_BACK Expressed as an integer. System returns requested amount of
records provided a valid instrument has been requested and that
instrument has enough records to meet the full amount
requested.
AGGREGATE_TYPE Used for ISO data. 1 for PEAK, 2 for OFFPEAK, 0 (default) for
On-peak & Off-Peak combined.
User-Specifiable Tags:
Name Description
INSTRUMENT_ID The security’s instrument identifier. If
<TAGS> are specified, this field must
appear in the request.
HIGH This session’s highest transaction
value
LOW This session’s lowest transaction
value
TRADE_DATETIME Date and Time of the last reported
Trade, in ISO format
OPEN This session's opening price
VOLUME Today's total trading volume
OPEN_INTEREST Open interest
CLOSE Settlement price. The official closing
price of a commodity
MID_POINT Midpoint
SYMBOL_DESCRIPTION Symbol description
Default Tags:
Name
INSTRUMENT_ID, TRADE_DATETIME, OPEN, HIGH, LOW, CLOSE,
OPEN_INTEREST, VOLUME, UNDERLIER
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/CLZ06"/>
</INSTRUMENTS>
<CONDITIONS RECORDS_BACK=”5” />
</API_REQUEST>
3.2.2 getTradePrices
Returns the Trade (a.k.a., Tick or Historical) prices for a user-defined set of
instruments, covering a user-defined period of time. The user may specify which Tags
(a.k.a., fields) they want to have returned, or rely on the default set of Tags. There is a
limit on tick data. Some instruments can trade hundreds of thousands of times per day
each creating a new record. Transferring this much data in a single request can be
stressful on the server application as well as the client side application. There is a limit
of 500,000 records max for any trade data request. An important note is the minute
referenced in the END_DATE is inclusive. This means ifor the example above, trades
will be returned through “2013-08-14 00:00:59”.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request may contain a single
conditions clause identifying either a number of calendar
days back or a Date/time range.
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS> clause; instead
appears in <INSTRUMENTS> (specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
START_DATE A date in the format, ‘YYYY-MM-DD HH:MM:SS’. If specified,
then END_DATE must be specified as well. Between the two
fields, creates a date-within-range query.
END_DATE A date in the format, ‘YYYY-MM-DD HH:MM:SS’. If specified,
then START_DATE must be specified as well, Between the two
fields, creates a date-within-range query.
DAYS_BACK Expressed as an integer. Synonymous with the START_DATE/
END_DATE pair, with the proviso that END_DATE is the current
date.
User-Specifiable Tags:
Name Description
INSTRUMENT_ID The security’s instrument identifier. If
<TAGS> are specified, this field must
appear in the request.
LAST Trade price or value
TRADE_DATETIME Date and Time of the last reported
trade
TRADE_VOLUME Transactional volume of the last trade
price reported in TRDPRC_1
Default Tags:
Name
INSTRUMENT_ID, LAST, TRADE_DATETIME, TRADE_VOLUME, UNDERLIER
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument. If a global error occurs, such as authentication, the
API_RESPONSE will only contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/GCL<0>" />
</INSTRUMENTS>
<CONDITIONS START_DATE="2013-08-13 23:45:00" END_DATE="2013-08-14 00:00:00" />
</API_REQUEST>
3.2.3 getLiveQuotePrices
Returns Livequote prices for a set of instruments, covering a user-defined period of time.
The user may specify which Tags (a.k.a., fields) they want to have returned, or rely on the
default set of Tags.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request most contain a single
conditions clause identifying either a number of calendar
days back or a START_DATE and END_DATE:
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS> clause; instead
appears in <INSTRUMENTS> (specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
OPTION_ROOT Root for a Future or Forward type instrument. Used for Future
Chain requests
SECURITY_TYPE “F” for Futures, “FO” for Futures Options, “SP” for Spot, “S” for
Stock.
SESSION Trading Session used for Futures Chain requests, as follows:
NYMEX Pit = “2”
NYMEX Globex = “1”
All ICE = “2”
CBOT Pit = “2”
CBOT Globex = “1”
Others = “2”
UNDERLIER Used for futures options. A fully qualified futures contract (i.e.,
“/CLF14”.
User-Specifiable Tags:
Name Description
INSTRUMENT_ID The security’s instrument identifier. If
<TAGS> are specified, this field must
appear in the request.
LAST Last trade price or value (most
recent)
NET_CHANGE Net change from previous close
HIGH This session's highest transaction
value
LOW This session's lowest transaction
value
TRADE_DATETIME Date and Time of the last reported
trade
TRADE_DATE Date portion of TRADE_DATETIME
OPEN This session's opening price
BID Latest bid price
ASK Latest ask price
Name Description
BID_SIZE The quantity bid at the latest bid price
ASK_SIZE The quantity offered at the latest ask
price
TOTAL_VOLUME Today's total trading volume
Default Tags:
Name
INSTRUMENT_ID, LAST, NET_CHANGE, HIGH, LOW, TRADE_DATETIME,
OPEN, BID, ASK, BID_SIZE, ASK_SIZE, COMPANY_NAME,
CONVERSION_FACTOR, LOT_UNITS,
DISPLAY_CONTRACT_EXPIRATION_DATE, EXCHANGE_CODE,
OPTION_ROOT, PUT_CALL, EXPIRATION_DATE, UNDERLIER, CURRENCY,
SECURITY_TYPE, PREV_SETTLE_DATE, PREV_SETTLE, SETTLE_DATE,
SETTLE
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/CLZ09" />
<INSTRUMENT INSTRUMENT_ID="/NGZ09"/>
</INSTRUMENTS>
</API_REQUEST>
<API_REQUEST>
<CONDITIONS OPTION_ROOT="/CL" SECURITY_TYPE="F" SESSION="2" />
</API_REQUEST>
3.2.4 getIntradayPrices
Returns intraday prices for a set of instruments, covering a user-defined period of time. The
user may specify which Tags (a.k.a., fields) they want to have returned, or rely on the
default set of Tags.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request most contain a single
conditions clause identifying either a number of calendar
days back or a START_DATE and END_DATE. Any
number of instruments can be requested as shown below:
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS> clause; instead
appears in <INSTRUMENTS> (specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
AGGREGATE_TYPE 1 for peak; 2 for off-peak; 0 for all
BAR_INTERVAL Desired stripping, in minutes. Available are 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 90, 120, 150, 180,
210, 240.
START_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
END_DATE must be specified as well. Between the two fields,
creates a date-within-range query.
END_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
START_DATE must be specified as well, Between the two
fields, creates a date-within-range query.
DAYS_BACK Expressed as an integer. Synonymous with the START_DATE/
END_DATE pair, with the proviso that END_DATE is the current
date.
AGGREGATE_TYPE Used for ISO data. 1 for PEAK, 2 for OFFPEAK, 0 (default) for
On-peak & Off-Peak combined.
User-Specifiable Tags:
Name Description
INSTRUMENT_ID The security’s instrument identifier. If
<TAGS> are specified, this field must
appear in the request.
LAST Last trade price or value
HIGH This session’s highest transaction
value
LOW This session’s lowest transaction
value
TRADE_DATETIME Date and Time of the last reported
trade
TRADE_DATE Date portion of TRADE_DATETIME
Name Description
OPEN This session’s opening price
Default Tags:
Name
INSTRUMENT_ID, TRADE_DATETIME, OPEN, HIGH, LOW, LAST
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If a
global error occurs, such as authentication, the API_RESPONSE will only
contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/CLT06" />
</INSTRUMENTS>
<CONDITIONS DAYS_BACK="2" BAR_INTERVAL=”5” />
</API_REQUEST>
3.2.5 getNews
Returns News articles. Articles either have their own body (e.g., the story,) or have a
reference to a web URL, to be used by a web browser. The user may specify which Tags
(a.k.a., fields) they want to have returned, or rely on the default set of Tags.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request most contain a single
conditions clause identifying either a number of calendar
days back or a START_DATE and END_DATE.
Condition Tags:
Name Description
NEWS_SOURCE ID Code for News Source. Must appear
NEWS_DEPTH Not a condition per se, but controls the number of headlines
returned by query. Defaults to 300.
START_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
END_DATE must be specified as well. Between the two fields,
creates a date-within-range query.
END_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
START_DATE must be specified as well, Between the two
fields, creates a date-within-range query.
DAYS_BACK Expressed as an integer. Synonymous with the START_DATE/
END_DATE pair, with the proviso that END_DATE is the current
date.
RECORDS_BACK Synomyn for DAYS_BACK
Other Tags Any of the User-Specifiable tags may appear as a CONDITION
tag, with the exception of NEWS_DATE and NEWS_TIME (Use
NEWS_DATETIME instead.)
User-Specifiable Tags:
Name Description
NEWS_DATETIME News Story DateTime
NEWS_DATE Date portion of NEWS_DATETIME
NEWS_TIME Time portion of NEWS_DATETIME
NEWS_HEADLINE Headline Text
NEWS_BODY Story Text
NEWS_STORY_NUMBER News Story ID Number
NEWS_SOURCE ID Code for News Source
NEWS_PAGE The News Page Number
NEWS_CATEGORIES News Category
NEWS_SYMBOL Instrument/Symbol associated with
Story
NEWS_KEYWORDS Keywords in the headlines
NEWS_SERVER_DATE Server News Story Date
NEWS_SERVER_TIME Server News Story Time
NEWS_HREF URL/URI pointing to the story on the
Web (used in conjunction with web
browser component.)
Default Tags:
Name
NEWS_DATETIME, NEWS_HEADLINE, NEWS_BODY,
NEWS_STORY_NUMBER, NEWS_SOURCE, NEWS_PAGE,
NEWS_CATEGORIES, NEWS_SYMBOL, NEWS_KEYWORDS,
NEWS_SERVER_DATE, NEWS_SERVER_TIME, NEWS_HREF
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
<API_REQUEST>
<CONDITIONS NEWS_SOURCE="PGA" NEWS_PAGE="5" NEWS_DEPTH="5" />
<TAGS>
<TAG TAG_NAME="NEWS_HEADLINE" />
<TAG TAG_NAME="NEWS_BODY" />
<TAG TAG_NAME="NEWS_CATEGORIES" />
<TAG TAG_NAME="NEWS_SOURCE" />
<TAG TAG_NAME="NEWS_DATETIME" />
<TAG TAG_NAME="NEWS_PAGE" />
</TAGS>
</API_REQUEST>
3.2.6 getPriceCorrections
Returns price corrections for normal (non-ISO) instruments. The user may specify which
Tags (a.k.a., fields) they want to have returned, or rely on the default set of Tags. NOTE:
due to infrastructure limitations, this method services only one Instrument per invocation.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request most contain a single
conditions clause identifying either a number of calendar
days back or a START_DATE and END_DATE.
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS> clause; instead
appears in <INSTRUMENTS> (specific instrument_id’s)
or <INSTRUMENT_SEARCHES> (wildcards)
START_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
END_DATE must be specified as well. Between the two
fields, creates a date-within-range query.
END_DATE A date in the format, ‘YYYY-MM-DD’. If specified, then
START_DATE must be specified as well, Between the
two fields, creates a date-within-range query.
DAYS_BACK Expressed as an integer. Synonymous with the
START_DATE/ END_DATE pair, with the proviso that
END_DATE is the current date.
RECORDS_BACK Synomyn for DAYS_BACK
Other Tags Any of the User-Specifiable tags may appear as a
CONDITION tag, with the exception of NEWS_DATE
and NEWS_TIME (Use NEWS_DATETIME instead.)
User-Specifiable Tags:
Name Description
INSTRUMENT_ID Instrument ID. Must appear
CORRECTION_DATETIME Date and time on which the correction
was made.
TRADE_DATETIME Date and time of the trade
Default Tags:
Name
INSTRUMENT_ID, CORRECTION_DATETIME, TRADE_DATETIME
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="#PHAJL00" />
</INSTRUMENTS>
<CONDITIONS START_DATE="2008-10-06" END_DATE="2008-10-06" />
</API_REQUEST>
3.2.7 getForwardCurve
Returns the “forward curve” for a requested date. This is for any “Future” or “Forward” type
of Instrument.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request most contain a single
conditions clause identifying either a number of calendar
days back or a START_DATE and END_DATE.
Condition Tags:
Name Description
CURVE_ROOT A valid INSTRUMENT_ROOT_NAME returned in a
getInstrumentRootList request.
CURVE_DATE A date in the format, ‘YYYY-MM-DD’. This is the date to
retrieve the forward curve, if no curve is available for the
date provided, the response will return “N/A” for all of the
response tags
Default Tags:
Name
INSTRUMENT_ID, TRADE_DATETIME, CLOSE
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
The response includes 3 fields (INSTRUMENT_ID, TRADE_DATETIME,
CLOSE). INSTRUMENT_ID is the actual symbol based off the
CURVE_ROOT requested, CLOSE is the settling value for the requested
CURVE_DATE and TRADE_DATETIME is the “Delivery Date” for the
“Future or Forward” contract.
<API_REQUEST>
<CONDITIONS CURVE_ROOT="/RB" END_DATE="2014-03-19" />
</API_REQUEST>
MarketView Web Services provides functions that allow you to inspect data quality in the Intraday,
LiveQuote, Daily, Trades, ISO-Hourly and ISO-Daily data stores. These allow you to check,
• Is there a quote available for the given day
• Does the quote lie within a certain threshold of previous quotes in the system
o Expressible as a fixed amount
o Expressible as a percentage
o The positive threshold (amount the quote goes up) can be explicitly expressed
o The negative threshold (amount the quote goes down) can be explicitly expressed
o You can set the sampling size of previous quotes – e.g., read and average the
lastmost ‘x’ quotes, then compare that value to the threshold values.
o The field being compared in the quote is user-definable. So, you could compare the
CLOSE, LAST, or VOLUME.
3.3.1 Are{dataSet}PricesAvailable
MarketView Web Services determines whether a quote for today is available, and returns
that information to you through the tag QUOTE_AVAILABLE. If the quote is available, this
tag has the value of “AVAILABLE”; else “NOT AVAILABLE”.
Note that the definition of “today” is a little nebulous: MarketView’s infrastructure stores all
date/times in Greenwich Mean Time, and does not necessarily “know” then the day ends
at the Exchange where the Instrument is quoted from. Therefore, it is up to you to specify
the Exchange’s timezone (through the TIMEZONE tag.) If no timezone is specified,
MarketView Web Services assumes “America/Chicago”.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request should contain a
<CONDITIONS> clause identifying the TIMEZONE for
which to run the query.
Condition Tags:
Name Description
Default Tags:
Name
Whatever the default tags are for the given method, plus INSTRUMENT_ID,
TRADE_DATETIME, QUOTE_AVAILABLE
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
<API_REQUEST>
<INSTRUMENTS>
<INSTRUMENT INSTRUMENT_ID="/CLZ06" />
</INSTRUMENTS>
<CONDITIONS TIMEZONE="America/New York" />
</API_REQUEST>
3.3.2 are{dataSet}PricesInAbsoluteThreshold
For example, you might wish to be notified if the last price of an instrument increases or
decreases by more than $5 of the average last, established by sampling ‘x’ previous price
quotes. These methods allow you to determine that.
In order to use these methods properly, you first need to indicate which tag you want
MarketView Web Services to analyze. This is set with the THRESHOLD_FIELD tag in the
CONDITIONS clause; by default, the tag “CLOSE” is inspected. Other reasonable tags
might be LAST, or VOLUME. (Obviously, tags analyzed must be numeric)
Next, you need to set the SAMPLE_SIZE tag in the CONDITIONS clause. Doing so
establishes the number of records MarketView Web Services should look at when
establishing what the average value of the THRESHOLD_FIELD is. By default, the
SAMPLE_SIZE is set to 1 (which means, the previous quote in the system is used to
establish the average – an average, sampling one record.)
Next you need to set the CHECK_SIZE tag in the CONDITIONS clause. This indicates
how many quotes, following the SAMPLE_SIZE, you would like to analyze for being within
threshold values. The default value for CHECK_SIZE is 1. (What this means is, if both
SAMPLE_SIZE and CHECK_SIZE are set to 1, the last two quotes are read – the
second-to-last to establish the average, the last to analyze for thresholds.)
Finally, you must set the thresholds to compare against. You have two ways to do this,
• If the range you want to check for is the same amount (e.g., the threshold is ± a
value, like ±2), assign THRESHOLD_AMOUNT tag in the CONDITIONS clause.
• If you would like individual control of the ceiling the quote can increase by, set the
POSITIVE_THRESHOLD_AMOUNT tag in the CONDITIONS clause. For the
floor, set the NEGATIVE_THRESHOLD_AMOUNT tag. (If you specify positive
threshold, you must also specify negative threshold.) Both amounts should be
positive.
MarketView Web Services will run a query for you, adding a tag named
THRESHOLD_REPORT, that reports whether the tag specified is within or outside the
specified threshold.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request must contain a
<CONDITIONS> clause with the THRESHOLD_AMOUNT
or the POSITIVE_THRESHOLD_AMOUNT --
NEGATIVE_THRESHOLD_AMOUNT pair (both must
appear)
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS>
clause; instead appears in <INSTRUMENTS>
(specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
SAMPLE_SIZE Specifies the number of records to read from
the datastore to establish the average. Defaults
to 1.
CHECK_SIZE Specifies the number of records to read from
the datastore to for analysis against the
average. Defaults to 1.
THRESHOLD_FIELD The tag in the quote(s) to compare. Defaults to
CLOSE; must be a numeric field.
THRESHOLD_AMOUNT The threshold amount to compare against.
Shortcut for specifying
POSITIVE_THRESHOLD_AMOUNT and
NEGATIVE_THRESHOLD_AMOUNT with the
same value.
POSITIVE_THRESHOLD_AMOUNT The threshold value for positive value change
that the quote value cannot exceed. A positive
value.
NEGATIVE_THRESHOLD_AMOUNT The threshold value for negative value change
that the quote value cannot exceed. A positive
value.
Default Tags:
Name
Whatever the default tags are for the given method, plus INSTRUMENT_ID,
TRADE_DATETIME, the tag specified by THRESHOLD_FIELD, and
THRESHOLD_REPORT.
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
3.3.3 are{dataSet}PricesInPercentileThreshold
For example, you might wish to be notified if the last price of an instrument increases or
decreases by more than 5% of the average last, established by sampling ‘x’ previous
price quotes. These methods allow you to determine that.
In order to use these methods properly, you first need to indicate which tag you want
MarketView Web Services to analyze. This is set with the THRESHOLD_FIELD tag in the
CONDITIONS clause; by default, the tag “CLOSE” is inspected. Other reasonable tags
might be LAST, or VOLUME. (Obviously, tags analyzed must be numeric)
Next, you need to set the SAMPLE_SIZE tag in the CONDITIONS clause. Doing so
establishes the number of records MarketView Web Services should look at when
establishing what the average value of the THRESHOLD_FIELD is. By default, the
SAMPLE_SIZE is set to 1 (which means, the previous quote in the system is used to
establish the average – an average, sampling one record.)
Next you need to set the CHECK_SIZE tag in the CONDITIONS clause. This indicates
how many quotes, following the SAMPLE_SIZE, you would like to analyze for being within
threshold values. The default value for CHECK_SIZE is 1. (What this means is, if both
SAMPLE_SIZE and CHECK_SIZE are set to 1, the last two quotes are read – the
second-to-last to establish the average, the last to analyze for thresholds.)
Finally, you must set the thresholds to compare against. You have two ways to do this,
• If the range you want to check for is the same amount (e.g., the threshold is ± a
value, like ±2), assign THRESHOLD_AMOUNT tag in the CONDITIONS clause.
If you would like to check against 5%, THRESHOLD_AMOUNT should be set to
5. MarketView Web Services will divide your entries by 100. Which means,
fractional amounts in your arguments are considered to be fractions of a percent.
• If you would like individual control of the ceiling the quote can increase by, set the
POSITIVE_THRESHOLD_AMOUNT tag in the CONDITIONS clause. For the
floor, set the NEGATIVE_THRESHOLD_AMOUNT tag. (If you specify positive
threshold, you must also specify negative threshold.) Both amounts should be
positive. If you’d like to check against 5%, pass “5” as the argument; MarketView
Web Services will divide your arguments by 100. Which means, fractional
amounts in your arguments are considered to be fractions of a percent.
MarketView Web Services will run a query for you, adding a tag named
THRESHOLD_REPORT, that reports whether the tag specified is within or outside the
specified threshold.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String requestXML Request XML. The request must contain a
<CONDITIONS> clause with the THRESHOLD_AMOUNT
or the POSITIVE_THRESHOLD_AMOUNT --
NEGATIVE_THRESHOLD_AMOUNT pair (both must
appear)
Condition Tags:
Name Description
INSTRUMENT_ID Does not appear in the <CONDITIONS>
clause; instead appears in <INSTRUMENTS>
(specific instrument_id’s) or
<INSTRUMENT_SEARCHES> (wildcards)
SAMPLE_SIZE Specifies the number of records to read from
the datastore to establish the average. Defaults
to 1.
CHECK_SIZE Specifies the number of records to read from
the datastore to for analysis against the
average. Defaults to 1.
THRESHOLD_FIELD The tag in the quote(s) to compare. Defaults to
CLOSE; must be a numeric field.
THRESHOLD_AMOUNT The threshold amount to compare against.
Shortcut for specifying
POSITIVE_THRESHOLD_AMOUNT and
NEGATIVE_THRESHOLD_AMOUNT with the
same value. MarketView Web Services will
divide your argument by 100, so if you want 5%,
pass “5”.
POSITIVE_THRESHOLD_AMOUNT The threshold value for positive value change
that the quote value cannot exceed. A positive
value.
NEGATIVE_THRESHOLD_AMOUNT The threshold value for negative value change
that the quote value cannot exceed. A positive
value.
Default Tags:
Name
Whatever the default tags are for the given method, plus INSTRUMENT_ID,
TRADE_DATETIME, the tag specified by THRESHOLD_FIELD, and
THRESHOLD_REPORT.
Response:
Type Description
String XML structured to contain a response for the request. It will identify each
available instrument which has price corrections for the period specified. If
a global error occurs, such as authentication, the API_RESPONSE will
only contain an error code and error description.
MarketView Web Services provides data import facilities, that allows you to upload price
quotes, corrections and news stories into the GlobalView infrastructure. This is very useful
if you have information that you want to be available on a real-time basis to other
members of your company through our infrastructure and client application suite.
Instrument Prices
• importInstrumentPrice
• importInstrumentPriceCorrection
• importInstrumentMetaData
News Articles
• importNews
MarketView Web Services’ Import Data methods require that you provide the name of the
application. That value is user-defined, and it allows you to fine-tune the granularity of the
runtime statistics we gather for you. Import Statistics keeps track of the number of success
and failures to import data, broken down by userName and application. If you partition
the application name passed by the type of data being imported (or the machine doing
the importing,) this can help you track down Production issues.
No restrictions are placed on application values you can use, nor do you have to do
anything special to register a legal value – merely pass an application to one of the API
calls – if it did not exist beforehand, it will be created.
3.4.1 importInstrumentPrice
Allows the user to import a price for an instrument. This price is inserted into two data
stores: LiveQuote and Trade/Historical. For the Trade/Historical data store, we use the
trade datetime and the close tags. For LiveQuote we use the trade datetime, open,
high, low, volume, open interest and last tags. (Last and close tags would contain the
same value.)
MarketView Web Services allows one price quote to be published per method invocation.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String Application User-defined name of the importing application process.
String requestXML Request XML.
Required Tags:
Name Description
INSTRUMENT_ID Identifier for the given instrument.
EXCHANGE_CODE Exchange identifier for the instrument.
TRADE_DATETIME Date/Time of the price quote
CLOSE Price communicated to the Trade/Historical data store
LAST Price communicated to the LiveQuote data store
Optional Tags:
Name Description
HIGH Session’s High price
LOW Session’s Low price
OPEN Session’s opening price
VOLUME Volume
OPEN_INTEREST Open Interest
Response:
Type Description
String XML structured to contain a response for the request. API_RESPONSE
will only contain an error code and error description.
<API_REQUEST>
<DAILY_PRICE
INSTRUMENT_ID="#TESTSYM1"
EXCHANGE_CODE="TEST"
TRADE_DATETIME="2006-06-07T14:00:00Z"
HIGH="100.0"
LOW="65.0"
OPEN="67.0"
VOLUME="45000"
OPEN_INTEREST="1200"
CLOSE="72.0"
LAST="72.0"
/>
</API_REQUEST>
3.4.2 importInstrumentMetaData
Allows the user to import metadata concerning a given instrument. Instrument metadata
includes fields such as description, currency, lot units, etc., and these are values that
generally do not change.
MarketView Web Services allows one instrument’s metadata to be published per method
invocation.
Arguments:
Type Name Description
String User API user identifier
String userPassword API user password (case-sensitive)
String Application User-defined name of the importing application process.
String requestXML Request XML.
Required Tags:
Name Description
INSTRUMENT_ID Identifier for the given symbol.
EXCHANGE_CODE Exchange identifier for the symbol.
Optional Tags:
Name Description
SYMBOL_DESCRIPTION Symbol description
CURRENCY Currency
LOT_UNITS Lot Units. E.g., gallons,barrows, etc.
MARKET Market (used in symbol search)
REGION Region (used in symbol search)
LOCATION Location (used in symbol search)
CONVERSION_FACTOR Lot unit conversion factor
EXPIRATION_DATE Expiration Date
Response:
Type Description
String XML structured to contain a response for the request. API_RESPONSE
will only contain an error code and error description.
<API_REQUEST>
<INSTRUMENT_METADATA
INSTRUMENT_ID="#TESTSYM2"
EXCHANGE_CODE="TEST"
SYMBOL_DESCRIPTION="Test December Contract"
CURRENCY="USD"
LOT_UNITS="BBL"
MARKET="Gulf Coast 1% Oil"
REGION="United States"
LOCATION="QUAKERTOWN"
CONVERSION_FACTOR="100.0"
EXPIRATION_DATE="2006-12-01"
/>
</API_REQUEST>
Besides the obvious difference (GUI versus Web Services), the major difference is in how the
products obtain information from GlobalView’s infrastructure. The MarketView GUI application
obtains price quotes through a publish/subscribe paradigm, versus request/reply used in
MarketView Web Services. The major difference between the two is the handling of complex
requests: longer-running requests are subject to timeout constraints in a request/reply.
Should this become an issue (e.g., you want to request 10 years’ of Trade data,) it is probably a
better thing by far to have this request run for you by GlobalView as a one-time export. Contact
us for details.
http://mvwebapi.gvsi.com/services/mt
We also have “development” servers, against which you should develop your client software.
The reason for this is quality-of-service – we’ll advise you as the name of servers assigned to
you.
Email: DL_DataConnection_API_Support@gvsi.com
Phone:
Appendix
Security Types
Security
Type Security Type Code
F Futures
FO Futures Option
SP Spot
S Stock
ID Index
A Future Alias
C Future Continuous
FX Foreign Exchange
IS ISO Data
SF Spot Forward
Exchange Traded
ET Fund
getInstrumentRootList
This query has no input parameters. The result gives you the futures root records the requesting
login id is permissioned for.
A small sample of the results is as follows:
getInstrumentList
You can use the results of this query to feed the getInstrumentList method and query each
OPTION_ROOT/SESSION/EXCHANGE_CODE/SECURITY_TYPE combination to get all the
instruments for each futures root.
For example, here is the query for getInstrumentList to get the instruments of one of the futures
roots above:
<API_REQUEST>
<CONDITIONS EXCHANGE_CODE="NYM" />
<CONDITIONS SECURITY_TYPE="F" />
<CONDITIONS INSTRUMENT_ID="/CL[A-Z][0-9][0-9]" />
<CONDITIONS OPTION_ROOT="/CL" />
<CONDITIONS SESSION="2" />
</API_REQUEST>
Notice, you can get the EXCHANGE_CODE, SECURITY_TYPE, OPTION_ROOT & SESSION
from the getInstrumentRootList method above. The INSTRUMENT_ID is provided to make sure
you retried 2-digit year instruments in the request. It is built by using the OPTION_ROOT plus a
pattern "[A-Z]" for a month code and 2 patterns of "[0-9]" for the 2-digit year. This is to avoid
getting 1-digit year symbols in your response. 1-digit year symbols exist in the system for
backward compatibility.
This will give you results like the following
If you want to limit the response for the chain for non-expired instruments, you can add the
following condition:
<CONDITIONS EXPIRATION_DATE="2013-08-12" />
th
This limits the results to any instrument with an expiration date greater than or equal to August 12
2013.
To get a list of Continuous or Alias symbols you can use the getInstrumentList method as follows:
Aliases:
<API_REQUEST>
<CONDITIONS EXCHANGE_CODE="NYM" />
<CONDITIONS SECURITY_TYPE="A" />
<CONDITIONS INSTRUMENT_ID="/CL[*]" />
</API_REQUEST>
For Alias, use the result in the INSTRUMENT_ROOT_NAME tag from the getInstrumentRootList
method above.
Continuous:
<API_REQUEST>
<CONDITIONS EXCHANGE_CODE="NYMG" />
<CONDITIONS SECURITY_TYPE="C" />
<CONDITIONS INSTRUMENT_ID="/GCL<*>" />
</API_REQUEST>
For Continuous, use the result in the INSTRUMENT_ROOT_NAME tag from the
getInstrumentRootList method above.