This chapter focuses on the creation of the SHOW/WHEN statement.
The SHOW/WHEN query allows a user to query what happens to the market when certain conditions are present. Or stated another way, the SHOW/WHEN query is constructed as a compound sentence which, in general terms states "XMIM, show me what happens to my specified data series whenever a defined condition (or conditions) are true." This type of query requires the user to specify both the market of interest and the condition or time period for which the user would like to see the market displayed. The 'market of interest' is created by defining what it is the user wants to "SHOW". This may be accomplished by either making certain menu selections using the SHOW pane of the Query Builder or by typing in the SHOW criteria directly into the Edit pane. Likewise, the condition or time period for which the user expects to see the market displayed is created by using the WHEN pane of the Query Builder or by typing in the WHEN criteria directly into the Edit pane.
The format the SHOW/WHEN query language will appear in the Edit pane, after having been typed directly into the Edit pane or after being constructed using the Query Builder, is as follows:
SHOW
My Defined Marekts (Referred to as the "Attribute")
WHEN
Defined Conditions are trueThe followings shows an example:
SHOW
1: percent_move from today to 1 day later of DJIA
WHEN
DJIA is up more than 50 The SHOW portion of this particular query involves an XMIM study, price movement of the Dow Jones Industrial Average (close-on-close) on days WHEN the DJIA closed up more than 50 points from the previous day's close. There may be several different 'attributes', or markets of interest, that a user would want to SHOW in a query for certain defined conditions (in the above query perhaps the user might also like to see what effect the move in DJIA would have on interest rates). XMIM automatically assigns a numerical label to each attribute, so as to avoid confusion when the answers to a query are displayed. For the example above this label appears as 1:.
Let's first take a closer look at constructing the SHOW attribute. Then, we'll discuss the WHEN condition in more detail thereafter.
What is an attribute? In the context of the XMIM language, an attribute is a complete description of a time series - an array of numbers, organized in chronological order, usually with a regular frequency. Attributes may be represented by a single time series, such as the closing price of the Dow Jones Industrial Average (or Close of DJIA in the XMIM language); or, can represented by multiples time series, such as the High of DJIA - Low of DJIA (daily range of the Dow Jones Industrial Average). Attributes can be combined using simple arithmetic operations like addition, and division, or complex functions such as correlation. Simply stated, an attribute is any expression that, when interpreted, represents a series of values arranged chronologically into an array or matrix. Some examples of attributes or time series expressions include:
High of JY (the High Price of Yen Futures contract)
Low of US (the Low Price for 30 year US Treasury Bond Futures contract)
Open of DJIA (Closing Price of the Dow Jones Industrial Average)
Close of IBM (Closing Price for IBM stock)
Bar of CL (the Open, High, Low and Close of the Crude Oil Futures contract)
50 day highest of High of S_1995H (the 50 day highest price for the Soybean March 1995 Futures contract)
10 day average of 15 minute Close of US (the 10 day average of the 15 minute Close of the 30 year US Treasury Bond Futures contract)
Volume of SP (daily volume for the S&P Futures contract)
Open Interest of DM (the daily Open Interest for the Deutsche Mark Futures contract)
PRIME (the US Prime Rate)
CPI 1 quarter ago (the Consumer Price Index (revised) 1 quarter ago)
Longitude of JUPITER (Longitude for Jupiter)
The symbol and column selection fields of the Query Builder window is the heart of building an attribute expression and will be focused on in some detail in the sections to follow. This area is where you select the source data from the symbols available in the XMIM historical database. All the other buttons contained within the Query Builder window allow you modify your selected time series, but the underlying time series lies at the core of the attributes.
Data, from which an attribute (symbol +column) may be constructed,
is stored in a structure called a Relation. A
relation is represented in XMIM by a unique identifier called a symbol.
For example, CPQ represents Compaq stock and
US represents the U.S. 30-year Treasury Bond Futures
contract. Relations are organized in the database in hierarchical or
tree fashion by certain major market categories. The major categories in
the XMIM system are located under the 'Root' directory as: Agriculture,
Astronomy, CUSIP, Dates, Economic Indicators, Energy, Equities, Fixed
Income, Foreign Exchange, Futures, Indices, Monetary Indicators, etc.
Underneath each major category are sub-categories, which further
classify the data. For example, under the Futures category, there are
several sub-categories such as Currencies, Grains, Energy, Financial,
etc. Stocks (or Equities) are organized into sub-categories
alphabetically by their ticker symbol. Monetary Indicators are broken
out into categories by country.
To get a better idea of this concept, we will employ the Query Builder to review. The Query Builder is accessible from the Query Builder tab from the Main window.
Each button on this Query Builder window represents different building blocks for attributes. The only field which XMIM requires to be 'defined' or menu choices to be selected for, is the Symbol field. As suggested earlier, relations can be considered a collection of time series relating to a particular symbol. For example, a relation involving IBM may have several items of information available about the stock each day - price, volume, earnings per share, etc. The first step in defining the attribute or market of interest is to define the symbol.
There are three ways to select a symbol using the Query Builder:
typing the symbol into the Symbol field and selecting the Enter key from the keyboard;
selecting the Search Database
icon ![]()
and use the Tree
View to locate your symbol; or
selecting the Search Database
icon ![]()
and use the Search feature to search for the
symbol.
When you have properly selected a symbol using any of the foregoing methods, the symbol will appear in the Symbol field. Beneath the symbol will appear the full description of the symbol, so that you can confirm that your choice was the correct one. If a description does not automatically appear, then the system did not recognize your entry - the symbol you typed does not exist in the database.
Each symbol is logically organized by its associated major market
category and may be found by making directory and sub-directory
selections until your symbol of choice appears. Your final selection may
be made by selecting your symbol of choice and then by selecting the
Add Attribute to Query ![]()
button in the SHOW statement portion of the Query Builder window.
XMIM offers an extremely flexible means of data searching. To
open the Search Database window
select the Search Database
![]()
button located in the Symbol field. Using the functionality in the
Tree View and Search tabs, you can tailor the level of
refinement in your searching according to the symbol name and/or
description in several different ways.
In the Tree View tab, drill down through the data listings by selecting the plus or minus signs to expand/collapse the folder and symbol icons. Select a column for the symbol by either double-clicking the column or highlight the column, right-click and choose Select. Select OK to return to the Query Builder window and note that the Symbol and Column fields are now populated in the SHOW statement.
When a symbol is selected the path in the database to the symbol displays at the bottom of the window. |
Another selection method is to highlight the column, right-click and choose Select and Close from the list. This will add the symbol and column to the Symbol and Column fields and will close the Search Database window.
You may use these selection methods on the symbol name instead of the column and the default column will be used. |
You may save your favorite Tree View displays in a Favorites list by highlighting a folder in the Tree View tab, right mouse click and select Add to Favorites. In the Search Database window, you will see a new tab named Favorites. Select the Favorites tab. In the bottom left is the path structure to the folder as it would appear in the Tree View. In the bottom right is the number of children that a folder contains when the folder is selected.
Note that a folder must first be opened and accessed before the children count will display. |
To remove a favorite from the list, highlight a folder, right-click and select Remove.
If all the folders are removed then the Favorites tab is removed from the Search Database window.
To organize your favorites, right mouse click and choose New Category while in the Favorites tab. Highlight the New Category folder then double click or choose Rename from the right-click menu and type in a new name for the folder. Select folders either in the Tree View tab or folders in the Favorites tab, right-click and choose Move to Favorites and choose where to move them to from the list.
You can search for a symbol in the database using the
functionality in the Search tab.
Select the Search Options

button to choose how you want to perform a
search. A search may performed on the symbol name or on the
description assigned to the symbol.

The Favorites tab does not display until a favorite is created. See the section called “Favorites” for more information. |
If you already know your symbol name, select Symbols from the list to search by symbol
name. Type in the symbol name in the search field then select the
Start Search 
button. Select the desired symbol result from
the list then choose a column from the list.
Alternatively, you may search by description by selecting Descriptions from the list and typing in a short description of your symbol (i.e., Type in Dell Computer to locate the Symbol DELL). If you are unsure of the exact wording of the description you may employ a wild card key "*" in your search (i.e., Type in Dell* to bring up all descriptions that begin with Dell).
The search results are listed by symbol, path and description. To add the selection to the Symbol field in the SHOW pane, either double click the symbol name (the default column will be used) or select the symbol then right mouse click and choose Select or Select and Close to add and then close the Search Database window.
Mapping a Result in the Tree View
To have a particular result mapped in the Tree View, select the desired result, right-click and select Locate in Tree. The Tree View displays with the path to the symbol.
To narrow the results of a search, choose from one of the pre-defined narrowed lists (All Equity Tickers, AMEX Tickers, NASDAQ Tickers, NYSE Tickers, Energy Symbols) or use the Custom Narrow selection to browse the hierarchy, then select the category you want to refine.
The following example searches for an instance of “Henry Hub” as a spot price off the Platts publication, and uses the Custom Narrow feature to browse the hierarchy and only search in the Energy>NaturalGas folder.
Enter henry hub in the Search field.
Select the Search Options button and choose Descriptions and Custom Narrow from the pop-up menu.
In the Custom Narrow list, open the Energy folder, and then open the NaturalGas folder. Make sure the NaturalGas folder is highlighted.
Select the Start Search

button (or press Enter on your keyboard) to start the
search.
Scroll down the list of results and select the appropriate symbol. Double-click on a column to add the symbol and column information to the Symbol and Column fields in the SHOW pane. For more information on how to select and add results see "Adding Results".
To open the Search Options, select the Search Options 
button from the search field. The last entry
in the pop-up list is Search
Options.
The following search options and rules may be applied when searching by description or by symbol:
| Option | Function |
|---|---|
Case Sensitive | The search will only match the supplied case. |
Include Symbols | The symbol is included in the criteria. |
Include Categories | The category description is included in the criteria. |
Show Path in Table | The path to the symbol is included in the results. |
The following search criteria may be used:
| Criteria | Function |
|---|---|
Asterisk “*” | The asterisk is a wildcard. Note that typing “Henry Hub*” without a wildcard at the beginning will return strings that begin with “Henry Hub” versus strings that include “Henry Hub”. |
Period “.” | Do not use as a wildcard; it will be interpreted as a period. |
Question mark “?” | The question mark is a wild card to change a single character. |
In the Search Database window there is an Online Search tab. Use the Online Search feature to search the LIM Database Catalog, a catalog that shows all the data offered by LIM. Select the Options button to refine your search. You can search by keywords, descriptions, relations, tickers or by the data path.
Each distinct time series that relate to a particular symbol are referred to as columns in XMIM. The most commonly used time series or columns that relate to symbols are price series. XMIM categorizes price into four different series: Open, High, Low, and Close. The Open is the price at which a symbol started trading, High and Low are the price extremes achieved during some period, and Close is the last price of the period. Price, however, is not the only series available in XMIM. A common non-price time series associated with market time series is Volume, which represents the number of shares or contracts that changed hands during a particular day.
If we can summarize this concept in terms that were previously introduced, a relation is a collection of time series or columns that relate to certain symbols. The name column was assigned to these time series because when displayed or printed, columns run down the page in columnar fashion in chronological order, earliest to latest.
Column information about a relation may be accessed by the following syntax:
<Column Name> of <Relation Symbol>
A few examples of XMIM language include:
Bar of IBM Close of US DistToEarth of SATURN
An expression that contains a relation (i.e., A specified symbol and a column name) is called a relcol in XMIM vernacular. It represents a single unique time series within the MIM database. A symbol, by itself can represent many data series. For example, the symbol IBM can have hundreds of columns associated with it- the price Bar (Open, High, Low and Close), Volume or fundamental data (earnings per share). These data series are stored in the database as columns associated with the IBM symbol. The same column names are used in many different relations. For example, the Close column is included in thousands of symbols within the database but there is only one series represented by the unique identifier Close of IBM.
As a time saver, each symbol has a default column assigned to it so that when you refer to the relation symbol by itself (i.e., IBM), it assumes you mean the default column. The default column is Close for most symbols in the database. Certain symbols, such as Monetary and Economic Indicators, have implicit columns or implied columns.
The default column behavior is to look for _Implicit_, then Close, then find the first column that has the correct units for the query.
Relations in the MIM database can have anywhere between zero (implied columns) to any number of columns in their collection. Most symbols have the Bar price columns (Open, High, Low, Close) and Volume. Futures relations typically have, in addition, Open Interest, Cash and the several Commitments of Traders columns.
When you select your relation symbol, XMIM automatically displays the column choices from the drop down list. If you don't select a column to associate with your symbol, the default column will be assumed. In the case of securities, the default column is Close.
Like symbols, columns can be typed into text-edit box located next to the Column field. With the exception of 'Bar' each column represents a single time series. Bar is a special type of column that is actually a set of columns comprised of Open, High, Low and Close.
You may save commonly used columns into a Column Hot List by selecting your column of choice in the Column window of the Query Builder and selecting the feature Add To Hot List. The stored column will then be available for quick access in the main window located under Column Hot List.
Once the relation symbol and the column have been specified and
you choose Add Attribute to Query
![]()
button in the Query
Builder window, the completed relation will appear in the
Edit pane.
Example:
SHOW
1: Close of IBM If you don't select the Add Attribute to
Query ![]()
button after selecting the symbol and column in
the Query Builder window, you may build
onto your relation using other functions available in the Query Builder window. These additional functions
add further adjectives to the attribute expression. The next section
will discuss in some detail the most commonly used add on functions that
we will refer to as studies.