Absolute Value – the absolute value is the numerical value without considering whether the number is positive or negative. The syntax is ABS [data]. If you wanted to study the volatility of the changes in data without regard to whether the changes were positive or negative, then ABS CHANGE [data] will produce the desired result.
Activatedata – Syntax is ACTIVATEDATA ['path']. It will activate the designated dataset whose complete address is given by the path, but will not open it. Thereafter you can use the dataset throughout fdc by simply typing its name (without the path)
Activatedir – Syntax is ACTIVATEDIR ['path']. It will activate all datasets in the folder whose path is specified. If you enter ACTIVATEDIR '' you will be able to search for the desired directory.
What
does “Adaptive” Mean? – Essentially
it means that a parameter of the function (that is a number used by the function)
can vary with time. Let us give a real example:
Suppose you are performing an operation on a data series, such as taking a
moving average of the data. Normally you would specify the time period over
which you would be performing this operation, as for example a 10-day moving
average or a 20-month moving median, etc. The time period (i.e. 10 days or
20 months) is your variable.
Now suppose that what you are doing demands performing
this operation over different time periods under different circumstances.
In other words, you need to vay that is the number of days over which you
take the moving average. Most software operations are set up to deal with
user-defined parameters that do not change. So what you need is software that
can perform such operations with non-constant or adaptive input. In theory
this should not be a big deal. But it is, because most software cannot deal
with such a request.
Let's go back to the example of a 10-day moving average. Instead of specifying
10 MOVAVE BONDS you will replace the 10 with another dataset (say, [data2]), whose dates correspond to the Bond dataset,
and whose entries are integers, specifying how many days to use in the moving
average, on each date.. Operationally you would then request [data2] MOVAVE BONDS Thus, on each date, FDC would look
to the value in [data2] MOVAVE BONDS to perform the appropriate moving average
on Bonds.
For another example, suppose you are trading the Treasury
Note futures contract and need to adjust your smoothing of the data by some
measure of how excited the market is. You have decided that the Open Interest
divided by the Daily Volume is a good measure of that excitement. So you create
a dataset by dividing the Open Interest by the Volume (and maybe add a minimum
constant), and use that dataset to operate the moving average, or other data
smoother. Thus, when there is high Volume relative to the Open Interest, the
data smoother will shorten-up. Conversely should the market activity slow
down, the smoother will look at the price data over a longer period of time.
Ahead – the opposite of Back. This function moves a Dataset ahead in time. The syntax is [data] AHEAD N (where N is a positive integer). Should you be studying whether one Dataset will either lead or lag another, you will need to first compare them. For example, economists consider the stock market a leading indicator that leads the economy by six months.
[economic data] WITH (STOCKS AHEAD 6) will put the
two items in the same Dataset with a common date. You could test the correlation
between the indicators and stocks and learn whether the two data series were
better correlated with say a 4 or a 6-month lead. GOLD WITH (SILVER AHEAD 5) is the same as [data] SILVER WITH (GOLD BACK 5) , except the date
displayed will always be that of the first Dataset mentioned.
N
may also be a dataset, which means that the function can be adaptive; that
is it can have a different integer on each date. Should N
be a one-column dataset, AHEAD will move the data for each date ahead the
number of periods specified by N
for that date. Should N
be a dataset of several columns, it will operate on the other dataset according
to the standard rules for matrix operations.
It is possible for N
to be a negative integer. In such a case, [data] AHEAD
-2 is equivalent to [data] BACK 2.
Also, if N
is not an integer, it will be replaced by the closest integer. These rules
hold so that one can freely use the output of another function as N,
a process that is often necessary when computing adaptive indicators.
Alldates
– as in “find all dates between date1 and date2”. Syntax is ALLDATES [date1]
[date2] . Alternatively,
the function can be used in the form
[dataset]
ALLDATES [date1]
[date2] . In this form all dates during the time period covered
by [dataset]
are added to the dataset, with blank data used on any extra dates.
This function can be of tremendous
help in data cleaning since you can easily identify when data is absent, that
is you can then identify the “holes” in your Dataset.
Allwkdates – functions identically as ALLDATES, but produces or inserts only the week dates (market trading days).
And – one of the logical functions of FDC, similar to OR and NOT, which examines two logical series and expresses a value of 1 (meaning that both logical series were true) or 0 if neither or both were false. For example:
((HI BONDS) = (CL BONDS)) AND ((DW BONDS)
NE FRIDAY)
will yield a 1 when BONDS closes on its high on any day other than Friday. Also,
BONDS WHEN (((HI BONDS) = (CL BONDS))
AND ((DW BONDS) NE FRIDAY))
will display the entries of the Dataset BONDS when those conditions occurred.
Arccosine
– a trigonometric function equal to the inverse of the cosine. The syntax is ARCCOS
[data]. Should you wish the hyperbolic arccosine, the
syntax is ARCCOSH [data]
Arcsine – the inverse of the sine. Syntax is ARCSIN [data]. Hyperbolic arcsine is ARCSINH [data].
Arctangent – in inverse of the tangent. Syntax is ARCTAN [data]. Hyperbolic arctangent is ARCTANH [data].
Attach – Syntax is [ordinal dataset1] ATTACH [ordinal dataset2]. Combines two ordinal datasets, one after the other, and renumbers.
Attachall – Syntax is ATTACHALL [ordinal dataset1] [ordinal dataset2] ... [ordinal datasetn]. Combines any number of ordinal datasets, one after the other, and renumbers.
Back –the opposite of AHEAD. This function moves a Dataset back in time. The syntax is [DATA] BACK N (where N is a positive integer). SILVER WITH (GOLD BACK 5) is the same as GOLD WITH (SILVER AHEAD 5), except the date displayed will always be that of the first Dataset mentioned.
N
may also be a dataset, which means that the function can be adaptive; that
is it can have a different integer on each date. Should N
be a one-column dataset, BACK
will move the data for each date back the number of periods specified by N
for that date. Should N
be a dataset of several columns, it will operate on the other dataset according
to the standard rules for matrix operations in this section.
It is possible for N
to be a negative integer. In such a case, DATA]
BACK -2 is equivalent to DATA]
AHEAD 2 . Also, if N
is not an integer, it will be replaced by the closest integer. These rules
hold so that one can freely use the output of another function as N,
a process that is often necessary when computing adaptive indicators.
Bars–Applies to a daily FDC dataset that has times in the first column, and turns that dataset into bar data.
Bin –Organize
the data into this many bins (or buckets, tranches or pigeonholes), and value
each as described. The syntax is [sequence
of numbers] BIN [data] such as 3
5 7 10 BIN VOLUME msft. In this
example, there are four numbers in the left argument. That means that the
entire dataset will be divided up into four equal bins based on the range of the data
in the dataset. Then each entry will be given the value you have assigned
to that bin. For example, let’s assume there are 100 days of data
in your dataset VOLUME
msft, which consists of the daily
volume of shares traded for that stock. The BIN function examines the volume figures in the dataset,
dividing the data range (high volume minus low volume) into quartiles.
Those figures in the lowest quartile get assigned a value of 3, the next highest
getting assigned a 5, the next highest a 7, and the highest quartile a 10.
The output dataset contains only dates and the values 3, 5, 7 and 10. This
function can be used, for example, to turn the values of an indicator into
integers for an adaptive moving average.
Note that in the above example the function divides the range of the data
into equal segments, not the number of actual entries. If the data were distributed
uniformly over the range, you would expect each bin to contain 25 entries.
However it is more likely that the data will be distributed normally over
the range (like a bell-shaped curve), in which case more data would fall into
the middle bins than either the highest or lowest bin.
The left argument can be tailored as you wish. A request
such as 0
0 0 0 3 BIN TEMP 1 will divide the
data into 5 equal tranches, all of which will get a zero value, except those
in the highest quintile, which will be valued as 3. Thus this function provides
you with a method of discretely weighting data.
As with
the weighted functions, BIN
does not follow the standard rules for matrix operations, but applies the
left arguments to each data item of each column. Columns may have different
ranges, and the range of each column is used in the computations for that
column.
Break - The syntax is [logical dataset] CHANGE [dataset]. The two datasets have identical sets of dates. The second dataset is broken into pieces beginning at each 1 (TRUE) in the first dataset. All the pieces display.
Change
– The current data entry minus the previous data entry. In stock market terms, today’s price minus yesterday’s price.
The syntax is simply CHANGE [data].
This function operates identically to [data] MINUS ([data] BACK 1). You can optionally
provide a left argument and use the function in the form
N CHANGE [data]. The result is (for each date) today's entry minus
the corresponding entry N days ago.
Channel – The syntax 20 CHANNEL [data] identifies a trend and creates a channel around the trend. The upper value of the channel will be 20 points above the trend, and the lower value will be 20 points below the trend. That is, the channel will have a width of twice the N value expressed.
Chdir – Change the current active directory. Syntax is chdir string, where string is the address of the new directory.
Cleaning of data – see the examples given in ALLDATES and “horizontal functions”.
Clear – In the command window, drop down the edit function and you may clear a line, or lines.
Clipboard– This function takes any ASCII
data that has been copied to the system clipboard, and then translates it
into fdc form and returns the corresponding dataset. It can also be invoked
by presing the clipboard icon
.
The clipboard function can be combined with other functions to make useful
macros.
Example: The command line [data1] GETS CLIPBOARD MERGE [data1] (where [data1] is a stored dataset) waits for you to copy data to the clipboard and press the clipboard icon. It then merges that data with [data1]. (adding any new data and overriding any data you wish to change). The result is then stored in place of the original [data1]. Effectively you have used the clipboard to overwrite and/or update the original dataset.
Close – Syntax is CLOSE [data], or CL [data]. In market terminology the close is the last price of the day. In various futures markets it will also be called the settlement value. As the closing price is the value by which margins are determined, much research shows it to be the most significant value of a given day. If your Dataset has 4 columns of data, FDC will automatically assume the closing price will be the fourth column, as it is common usage to list the prices in the order of open, high, low and close. Thus in a 4-column Dataset, CLOSE BONDS is synonymous with BONDS COLUMN 4. Likewise, in a 3-column Dataset, it is conventional to assume the third column to be the close. Therefore, in a 3-column Dataset, CL EURO is synonymous with EURO COL 3, or EURO COLS 3.
Cmd – Issue a dos command from the command window - Syntax is cmd [string], where string is the complete DOS command.
Cmdplay – Load in a command set and run it. - Syntax is cmdplay [name], where name is the name of a command set in the main FDC directory, or the complete path of a command set.
Cmdplaylist – Load in a list of command set names, and load and run these command sets in succession. - Syntax is cmdplaylist [name], where name is the name of a list in the lists subdirectory of the main FDC directory, or the complete path of a list.
Column – Should you wish to specify data that appears in your Dataset in a particular column, you may ask for it with [data] COLUMN 4. You may also ask for multiple columns with SNP COLUMNS 2 3 4, noting that there are spaces between the numbers. To abbreviate, you may choose to use the equivalents COL or COLS. Also see “Dropping columns”. If you use a dataset on the right, it allows you to select different columns each day. The dataset on the right should contain, for each day, the numbers of the columns to be selected, in the order desired.
Common – Functions like WITH, but instead of combining all columns of the left Dataset
with all columns of the right Dataset, COMMON combines the Datasets only on dates that both sets have
in common. Syntax is [data A] COMMON [data B].
Consecutive – The function CONSEC applies to
any logical series, and produces a numerical output. If the series to which it is applied is false
on a given day, then CONSEC
returns 0. If it is true, but
was false on the previous day, then CONSEC returns a 1. If the result is true for the third straight
day, CONSEC returns a 3, and so on. This is similar to the behavior of the functions
UPRUN and DOWNRUN. In fact, the
command UPRUN (CL GOLD) is completely equivalent
to the command CONSEC ((CHANGE GOLD) > 0).
Correlation – The syntax is [dataA] COR [dataB] . There are several ways to correlate datasets. The total correlation of one dataset to another is done by COR (or TOTCOR). You can perform a cumulative correlation by requesting CUMCOR. And you can do correlations on moving sections of data with MOVCOR. In the latter case the syntax is 25 A MOVCOR B, where 25 represents the number of periods being studied, and A and B represent the datasets being correlated.
Covariance – The syntax is [dataA] COV [dataB] . There are several ways to calculate covariance of datasets. The total covariance of one dataset with another is done by COV (or TOTCOV). You can perform a cumulative covariance by requesting CUMCOV. And you can do covariances on moving sections of data with MOVCOV. In the latter case the syntax is 25 A MOVCOR B, where 25 represents the number of periods being studied, and A and B represent the datasets being correlated.
Cosine – a trigonometric function. The syntax is COS [data]. Should you wish the hyperbolic cosine, the syntax is COSH [data].
Count – Used within a loop playing in a command set. If the dummy variable is #1, for example (1 can be replaced by 2, 3, 4, 5, 6, 7, 8, or 9), then COUNT 1 will give the current value of that variable at any time, that is the count of the loop indexed by #1.
Creation of new Datasets – If you are looking to create a new dataset, then either type CLIPBOARD in the command line, or click on the Clipboard icon. Should you wish to create a new dataset from another dataset, then use the GETS function.
Crossup or Crossdown – These are very useful shortcut functions that identify specifically the event of one Dataset going from negative to positive (crossup) with regard to its relationship to another Dataset. The syntax is [data A] CROSSUP [data B], and the output will be a logical series (true/false or 1/0), with a value of 1 on any day a crossup occurs, and a value of 0 on other days. For example, normally the 3-month treasury bill yields less than the 10-year treasury note. In a tight credit market, however, the markets move to an inverted yield curve, with the bill yielding more than the note. Should you wish to identify the event of the inversion, request BILLS CROSSUP NOTES. Note that this request will produce only the crossovers. To identify the entire period of inversion, simply request BILLS > NOTES, or BILLS GT NOTES.
Cumulative functions – You may wish to perform certain operations on data from the beginning of data collection. In all of the functions the syntax is CUMfunction [data]. For example, you may want to know the highest value the data has ever achieved to date. In that case you would simply request CUMMAX [data]. There will be an entry for each date. If the data has four columns, then the output will likewise have four columns, with the cumulative maximum displayed for each date and each column.
CUMCOR
displays the cumulative correlations between datasets A
and B. The
syntax is [dataA] CUMCOR
[dataB].
CUMCOV
displays the cumulative covariances between datasets A
and B. The
syntax is [dataA] CUMCOV
[dataB].
CUMMIN works similarly.
CUMMATCH
(see MATCH)
CUMMEAN
and CUMAVE
are equivalents for the cumulative average.
CUMMED
computes the middle value or median.
CUMPROD
displays the cumulative product.
CUMQUANTILE computes a cumulative
quantile. A k% quantile is a number such that k% of the target numbers are
below it and 100-k% are above. It is a generalization of median, in that the
median is the 50 quantile. The syntax is Q
CUMQUANTILE [dataset],
where Q is the quantile.
CUMSTDV
computes the cumulative standard deviation.
CUMSUM
computes, for a given date, the cumulative sum of entries from the beginning
of the data up to that date.
CUMAND
and CUMOR
take the sum of the logical series AND and OR. Think
of them as “CUMSUM AND” and “CUMSUM OR”.
CUMVAR
computes the cumulative variance of a dataset.
Cycles – Cycles are an integral part of time series analysis. We have prepared a cycles demo dedicated specifically to cyclic analysis, and encourage reviewing it. The syntax is, N CYCLERUN [data], where N is the number of cycles you wish to examine. The point here is that you want to examine meaningful cycles, and not force the function to identify random noise as cyclic behavior. When you use the function an FDC note will identify for you the critical information such as periodicity and the percentage of behavior explained by each cycle.
Should you wish to force a particular cycle on you data, request N CYCLE [data], where N represents the cycle length (periodicity). The output will be the best possible n-period cycle.
Data - To quickly discover which Datasets you have stored, just go to your drop down File menu, and select Data Wizard. It will show you a list of activated Datasets. You may then select them and press the Open Data Set button. The Datasets will open, and a record of them will be recorded in the current command window. Alternatively,
Datasets – FDC works on Datasets, which usually
means dated series of numbers. Please
see the Datasets section of the User’s Guide.
Data cleaning – see the examples given in ALLDATES and “horizontal functions”.
Date, Dates – If you request DATE [data] you will receive output identical to the dates for each entry. That can be particularly useful as part of a pattern selection process, or to quickly identify events. For example, DATE SNP WHEN ((HI SNP) = (CL SNP)) will identify the date when the S&P closed on its high. Dates will be in the format YYMMDD.
Date removal – See SEQUENCE to remove dates
and have the data listed sequentially or as ordinals.
If
you are missing a date (i.e.
you have a hole in your data set), you may wish to fill it with the
DATEINTERP function, which will interpolate missing
dates and their interpolated values. The syntax is DATEINTERP [data].
Should you only wish to supply missing weekdates (i.e.
the days markets are open), then use the WKDATEINTERP
function, which operates similarly to DATEINTERP,
but supplies only the missing weekdates.
In either case, be cautious of what you request, or you may get more
than you bargained for. Our suggestion
is to limit the interpolation functions by date as in: DATEINTERP BONDS
FROM 990101 TO 990601.
Day, Day of the Week, Day of the Year –
DAY EURO or DAYS EURO will provide you with the day of the month for each entry in that Dataset. If for example there is any data for July 18th, 2001, the request will give you a single column of data in which the entry for July 18th 2001, will be 18.
DAYOFWK EURO or DW EURO will identify for you the day of the week in numerical form. Should you not remember that Monday is 1, then the FDC note will give you that information.
DAYOFYR EURO or DY EURO will identify for you the day of the year in numerical form.
Daysbetween– DAYSBETWEEN date1 date2 will return the number of calendar days between the specified dates, not including the last date. It returns a single constant. If you have a dataset, data, with two columns, each of which holds dates, then the command DAYSBETWEEN [data] returns a dataset showing the number of days between those pair of dates on each day. For example, if data has the following 5 entries:
Column 1 |
Column 2 |
|
| 20070101 | 20040101 |
20040305 |
| 20070102 | 20050812 |
20060901 |
| 20070103 | 20030910 |
20050208 |
| 20070104 | 20060205 |
20061230 |
| 20070105 | 20070202 |
20070521 |
The the output of DAYSBETWEEN [data] will be
Column 1 |
|
| 20070101 | 64 |
| 20070102 | 385 |
| 20070103 | 517 |
| 20070104 | 328 |
| 20070105 | 108 |
(See also wkdaysbetween)
Dayssince– DAYSSINCE date will return the number of calendar days between the specified date and today's date, inclusive. It returns a single constant. (See also wkdayssince)
Deferred functions – certain functions are delayed, pending more information. One example is CATALOG, which causes the command line to pause execution until the appropriate data or dataset is entered. Another deferred function is PARABOLIC. When this function is present (one or more times) in a command line, execution pauses until a parabolic prediction is generated. If this is done and if the user then chooses to save all or part of the resulting data, then that data is substituted for the word PARABOLIC and execution continues.
Delay – Delay execution (of a command set) a certain number of seconds, minutes, or hrs.(See Time delays)
Another example is PARABOLIC. When this function is present (one or more times) in a command line, execution pauses until a parabolic prediction is generated. If this is done and if the user then chooses to save all or part of the resulting data, then that data is substituted for the word PARABOLIC and execution continues.
Delete – Used within a command set running automatically. It deletes a previously computed dataset (displayed or hidden) from the playlist, closes its window, and deletes it altogether if it is temporary. (See also LASTITEMNAME and DELETEFROMDISK).
Deletefromdisk – – DELETEFROMDISK 'datasetname' (includequotes on name and make it a complete path to the stored dataset) will permanently delete the data from the disk (use carefully). Also see the function LOCATION.
Diff - Used only with lists, this function produces a list containing all items in the left list but not the second. Syntax is [left] DIFF [right] where the left and right arguments are each either names of lists in the List subfolder of the main FDC folder, with quotes around the name, or actual lists, usually produced by other list manipulating functions.
Divide – Equivalents are DIVIDE, DIV or / . The syntax is A DIV B and can be interpreted in English as “A divided by B.” A and B can be data sets or numerical values. If either A or B are Datasets, be mindful that the Datasets are matrices, and the normal mathematical rules for matrix operations apply: One against many, many against one, and equals against equals. If you are not familiar with such mathematical rules, please review the description of mathematical functions in the Basic Tour of FDC commands in the User’s Guide.
Occasionally you may wish to perform a division and need the output to be integers. In that case, use the integer divide function INTDIV. The output of 7 INTDIV 3 is 2.
Downday, Downrun – DOWNDAY [data] will give you values of 1 when the change is negative from the previous entry, and values of 0 when it is not. DOWNRUN [data] will give you a 0 when the value is greater or equal to the previous data, but positive values for each consecutive down value. The first down data entry will earn a value of 1, with the next value (if down) earning a 2, etc. The opposites are UPDAY and UPRUN.
Dnldprimate –Facility to batch download a list of datasets from Primate.
Dropfirst, Droplast – As in, “drop the first part of the Dataset”. Let’s suppose that you want to ignore some data entries at the beginning of a Dataset: The request [data] DROPFIRST 100 will remove the first 100 entries. The function DROPLAST works similarly.
Dropping columns – Equivalent to “not columns”. Suppose you have a 4-column Dataset and you wish to drop one of the columns. For example, the DJIA has columns identified as the open, high, low and close. If you just want the high, low and close, then request DJIA DROPCOLS 1. Should you have a 10-column Dataset, and wish to drop columns 3, 4 and 9, then request [data] DROPCOLS 3 4 9 (note the spaces between the numbers). The opposite of DROPCOLS is COLS. Note that requesting DJIA COLS 2 3 4 will produce identical output as DJIA DROPCOLS 1. You can use column labels (in quotes) in place of numbers on the right side.
During – As in “give me the
dataset XYZ during the month of June.” You
can also use the alias IN. The syntax is [data] DURING
date1 date2 …. The
dates can be years, months or days. Note
that you may also request something like MARCHOIL DURING MAYOIL,
where MAYOIL is a regular dataset.
In the latter example you will get the data series MARCHOIL when and only when there are entries in the MAYOIL dataset, without necessarily
knowing in advance what those entries were. The function ON works similarly. Note also that you can use the FROM and TO functions to also select
data by date.
Equals – equivalents are EQ and “ = “. This is a logical function, which like other logical functions produces a value of 1 when true and a value of 0 when false. Its best use is in combination with other functions to describe patterns. For example,
SNP WHEN ((HI SNP) = (CL SNP)) will provide the entries of the S&P Dataset when the S&P closed on its high.
Exponents - The function EXP takes the natural exponent of each data entry. The function EXP10 raises 10 to the power given by each data entry.
Exponential moving averages – The syntax is N EXPAVE [data]. We have written this function to be smart enough to know what you are thinking. Should you give N a value between 0 and 1 (for example, .7 EXPAVE BONDS) you will receive an exponential moving average for Bonds in which each entry is created by averaging 70% of the previous days calculation with 30% of the current days. Because of the recursive nature of the calculation of exponential averages, the entire body of previous data is essentially used to determine each new value. Thus the expression x-day exponential moving average” is a misnomer. However, although it is a misnomer, we recognize that many in the industry use the days method of describing exponential smoothing. Accordingly, should you give N a value greater than 1 (for example, 12 EXPAVE BONDS) FDC will assume that you mean 12 days, and make the appropriate calculation.
We have provided a table of N values that will enable you to calculate the x-day exponential moving average mentioned in various formulae. That table can be found in the Exponential Smoothing Supplement. If you are not familiar with exponential averages, please review the description of them in the Basic Tour of FDC commands in the User's Guide.
As with the moving functions, the left argument can be a dataset, which will have the result of making the EXPAVE function adaptive. However, you are cautioned to be consistent: the values for N in that left argument dataset should either all be below 1 or above 1. Also, be mindful of the standard rules for matrix operations in this section.
Exporting data – you can copy data from any displayed “.fdc” Dataset and paste to Excel® or to a word processing program. You can also convert any saved “.fdc” Dataset to ASCII form. To do this use the Convert tool (the Ruler icon) on any command window, and follow the simple instructions.
Extendalldates, Extendallwkdates – Syntax: EXTENDALLWKDATES [data] . These functions align everything correctly in time, supplying all missing dates (on which there is no data), such that you can see exactly what is missing in the dataset. By using the EXTENDALLWKDATES function on a dataset, the output will identify all weekday entries on which there is data missing. The data might be legitimately missing, such as on a holiday, or it might be a hole in your data that needs input. EXTENDALLDATES inserts all dates, even the weekends. In effect this is the same functionality as that of ALLDATES and ALLWKDATES, used with left argument. However, the the present functions apply to an entire dataset, as opposed to applying only to the data during a fixed period of time.
Extending calculations – any data that has a mathematical formula can be extended. This means that trends, channels, cycles, among others can all be extended into the future. With the EXTEND function you are now in the business of forecasting. This is not crystal ball forecasting, but extension of data based on mathematical formulas that you have assumed properly describe past data. There’s a lot of wiggle room in that statement, and you should be most cautious about what you extend. The syntax is [data] EXTEND N, where N is the number of periods you are extending into the future. On your Dataset (and graphs) the dates describing the extension will be numbered as #1, #2, #3 . . . We have prepared an extend demo dedicated to this important function.
Fdcdata – fdcdata 'path' will open the file designated by the complete path as a temporary dataset. This is the correct command to use if the result is to be included in a larger and more complex command line.
First – As in, “first part of the Dataset”. Let’s suppose that you only want to look at the first part of a Dataset. Instead of requesting [data] FROM 990101 TO 990601 you may simply want to request the first 100 days: [data] FIRST 100. The function LAST works similarly.
Flip – Used only on lists. The syntax is FLIP [list] , where list is the name of a list in the list subfolder of the FDC folder, surrounded by quotes, or is an actual list, produced by other functions that operate on lists.
Friday – It is possible in your research that days of the week are important. FDC gives you the ability to describe the days by name. The command ((HI BONDS) = (CL BONDS)) AND ((DW BONDS) EQ FRIDAY) will yield a 1 (true) when BONDS closes on its high on a Friday. Also note that in the Weekly functions (e.g., WKAVE, WKMAX, etc.) the date displayed will be the Friday date, unless there is no data for Friday. In the case where there is no Friday data (i.e. a holiday), then FDC will use the next earlier date on which there is data.
From – As in, “from this date” or “from date A to date B”. This date delimiter can either be used alone (e.g., STOCKS FROM 990101), or in tandem with the TO function (e.g., BONDS FROM 990101 TO 990601). If you do not limit the ending date by using TO, then FDC will assume that your request is for the Dataset through to its completion.
Gets – for the creation (and saving) of new Datasets from the Command line. The GETS function is an “on-the-fly Save As”. The syntax is [new Dataset] GETS [your definition]. Note that your definition can be as complex or as simple as you desire. The Dataset produced by the commands in [your definition] is then saved in the default data folder under the new Dataset name. Be aware that if there is already a Dataset by that name stored there, it will be overwritten. The main use of this function is in a command line, where it can be part of an automatically executed set of command lines. The function GETS does not display the dataset being saved, but this can be done by using a related function SHOWGETS.
In the course of normal operations, FDC creates new temporary Datasets each time you perform an operation. They are named TEMP1, TEMP2, TEMP3, etc. Temporary Datasets are in the volatile memory and continue to exist until you either close out of FDC, close the command window that created them, or close the Datasets themselves.
If you enter RESET in a command line, the next temporary Dataset produced will be called TEMP1, and numbering will then increase from 1. One reason for the reset capability is that you may in the course of your research get a large number of temporary Datasets.
When you use the GETS function, the result of the computation is not displayed, it is just stored. Should you wish to make one of the volatile temporary Datasets (say TEMPn) permanent, you can enter [new Dataset] GETS TEMPn. You can also simply use the SAVE command on the Dataset window.
Getdata – The command line function that duplicates the function of the data wizard. Use the data wizard, and it will automatically place the equivalent 'getdata' expression on the command line for you.
Greater than, Greater than or equal to - GT and GE , or you may use their mathematical symbols “>” and “>=”. These are logical functions, which like other logical functions produces a value of 1 when true and a value of 0 when false. The best use is in combination with other functions to describe patterns. For example,
DATE TBILLS WHEN (TBILLS GE NOTES)
will provide the entries of the TBILLS Dataset when the Tbill yield is higher than the Note yield (i.e., when the yield curve is inverted).
Groups of data – the “Group” functions. Should you wish to group your data into bundles of n days, use the Group functions. For example, should you wish to look at “10-day auto sales”, FDC will start at the beginning of your Dataset, and select the first 10-day period and date it with the 10th date. Then it will do the same for the 11th through 20th entries, and date the output with the 20th date. The Weekly, Monthly and Yearly functions group by date. The Group functions look at the data in sequential bundles from the beginning of your selected Dataset. The syntax is N GROUPfunction [data], where N is the number of raw entries being selected for the bundle or group. You may use a dataset in place of N. In this case it should be an ordinal dataset with one column, consisting of integers adding up to the number of rows in data. This allows groupings of variable size.
GROUPAVE computes a group average
or mean
GROUPBARS makes bar chart data by computing the group open, maximum, minimum, and close, then arranging labels and charting.
If no open is available, it computes the synthetic bar chart data without opens.
GROUPCLOSE computes a group 'close' by choosing the last entry in each group.
GROUPMAX computes the group
maximum.
GROUPMIN computes the group
minimum.
GROUPOPEN computes a group 'open' by choosing the first entry in each group.
GROUPPROD computes the group
product.
GROUPSUM computes the group
sum.
Hide – Syntax is HIDE [computation resulting in a dataset]. Example:
HIDE 3 MOVAVE ((HIGH IBM) + (LOW IBM))/2
The resulting computation is performed, and stored under whatever name is appropriate (often 'Tempk', for some integer k), but it is not displayed. This is illustrated by the fact that the stored name, appearing as a label on the command line, is in gray, not brown. If you place the cursor on the corresponding command line after execution, the F11 key will toggle back and forth between displayed mode and hidden mode. If the default display option (set with the 'options' menu) is 'HIDE', then all computed datasets are hidden, and it is not necessary to use the command HIDE in a computation. If the display option is 'SHOW', meaning display all computed datasets as usual in their own windows, the command HIDE' on a command line will override the default.
Hiding datasets is useful to suppress the display of a confusingly large number of windows. It also speeds up the computations by a factor of 10 or more. In addition, the windows graphics memory is fixed in size (not related to the amount of ram you have), and if it fills, then an appropriate error will be generated and you will not be able to display anymore graphics windows until some are closed. This the hidden option is the only way to do a larege number of successive computations with large datasets (particularly with the automatic play button).
High – Syntax is HIGH [data], or HI [data]. It performs similarly to CLOSE, OPEN and LOW. In market terminology the high is the highest price of the day. If your Dataset has 4 columns of data, FDC will automatically assume the high price will be the second column, as it is common usage to list the prices in the order of open, high, low and close. Thus in a 4-column Dataset, HIGH BONDS is synonymous with BONDS COLUMN 2. Likewise, in a 3-column Dataset, it is conventional to assume the first column to be the high. Therefore, in a 3-column Dataset, HI EURO is synonymous with EURO COL 1, or EURO COLS 1. If you are looking for the cumulative high, refer to CUMMAX in the cumulative functions. If you are looking for the “all-time high”, refer to TOTMAX in the “TOT” functions.
Horizontal functions – In a time series, the typical operation is performed vertically. However there can be occasion to operate horizontally across the data columns, sometimes just as a shortcut. The Horizontal functions enable such operation. HAVE averages the columns. HAVE [data] would certainly be a shortcut compared to
(([data] COL 1) + ([data] COL 2) + ([data]
COL 3)) DIV 3
HDIFF would give you the difference
between the first and second column. Use only on datasets with exactly two
columns.
HMAX would give you the highest
value horizontally
HMEDIAN would give you, on each date, the median of the horizontal values.
HMIN works similarly.
HSUM computes, for a given
date, the sum of entries across the columns.
HPROD displays the horizontal
product.
One of the first steps that any data researcher should perform is a test of the validity of the data. In short, is the data “clean?” In determining such, a typical operation is to see if there are any prices higher than the high, or lower than the low. The following entry will easily do just that:
[data] WHEN ((HMAX [data]) GT (HI [data]))
OR ((HMIN [data]) LT (LO [data]))
HSORTCOLNUMS sorts each row in either ascending or descending order, ignoring blanks, and returns the column numbers of the sorted items. Syntax is [string] HSORTCOLNUMS [data], where string is either 'up' or 'down'
Should you frequently import unreliable data, it would be most advisable to make a macro out of this operation and others. Other functions, such as ALLDATES can also be effectively used to clean data.
Hyperbolic functions – Syntax is SINH [data]. These functions are:
SINH - hyperbolic sine
COSH - hyperbolic cosine
TANH - hyperbolic tangent
ARCSINH - hyperbolic arcsine
ARCCOSH - hyperbolic arccosine
ARCTANH - hyperbolic arctangent
In – a selective date function. Syntax is [data] IN 1999. Returns that part of the data (if any) that lies in the year specified. See also During.
Insert – The purpose of this function is to edit individual entries in an FDC dataset under program control. For example, you may have a dataset representing 10 years
of daily data on 500 stocks, and you may have discovered that on a certain date, the entry in column 265 is wrong. You can open the dataset and edit the entry by hand, but
this can take a long time to do for such a large matrix. Also, you may want to correct a certain entry in many datasets that have a data supplier error on the same date.
In cases like this, insert allows you to make the changes under program control, and even in a list based loop.
The syntax is '[string1'] ['string2'] INSERT [data], where string1 is a list of locations seperated by semicolons, and string2 contains the corresponding replacement data, also separated by semicolons. Locations can be of the form 22_35 meaning row 21 and column 35, or 20070101_35 specifying a date and a column. If any replacement dataq item is left out, the position is filled with a blank.
Examples: '2_3;12_9' '23.1;12.34' INSERT [data] will place the number 23.1 in the second row and third column of dataset, and the number 12.34 in the 12th row and 9th column.
A similar result using dates might be '20070101_3;20070110_9' '23.1;12.34' INSERT[data].
Integer – the integer division function. Syntax is N1 INTDIV N2, where N1 and N2 can be either numbers or datasets. In this operation, the largest whole number is returned after N1 is divided by N2. For example, the result of 7 INTDIV 3 is 2.
Interpolation of data. - A Dataset may have certain dates on which some of the columns have data and some columns are missing data. On such dates we will say that the data has “holes” in it. These may be intrinsic to the data or may have resulted from combining Datasets that have different sets of dates. In either case, if there is no easy way to replace the missing data, FDC can interpolate between the last real data point in the column where the hole appears and the next real data point. It will fill the holes either by linear interpolation, or by extending the leftmost value ('linear' interpolation or 'stepwise' interpolation). INTERP fills in missing data into dates that are already part of the Dataset. If you started out with a Dataset of 100 days, you will end up with a Dataset of the same length. Syntax is type INTERP [data], where type is either 'linear' or 'step' (include the quotes).
There is a similar function INTERP0, with exactly the same syntax, that replaces 0's with interpolated data rather than replacing blanks. This is less useful, but sometimes comes in handy when data from data suppliers has a few unwanted 0s.
This should not be confused with the function DATEINTERP. The function DATEINTERP finds the first and last date of a Dataset, determines all intermediate dates on which there is no data, and fills in these dates with synthetic data determined as in INTERP. DATEINTERP fills in missing dates and creates interpolated data for those missing dates. That is, your initial Dataset could have been 100 days, but DATEINTERP will fill in the missing dates and data, possibly resulting in a Dataset of a greater length. It also uses either type of interpolation described above. Syntax is type DATEINTERP [data].
A similar function, with identical syntax is WKD