Normal types of **technical indicators**, such as
for example **moving averages**, are functions of past
prices or returns that are supposed to have **predictive power**
for the **future price action**. For example, an **exponentially
weighted moving average (EWMA)** of **returns**
can be used as a predictor of **future returns**, which
assumes a certain **(stationary) correlation** between past and future
returns. According to **Harvey**, the **EWMA** is
the **optimal Linear Prediction filter** for a time
series of returns with a certain** correlation**
structure.
The exponentially decaying coefficients of the **EWMA**
are the **filter coefficients** for this simple **
LP filter**. But more generally the **EWMA** has
traditionally been used as an approximate **forecast function**
in many scenarios, such as **financial time series**,
where the exact **statistical model** of the **
stochastic time series** is not known.

There are many different types of **Linear Prediction
filter** that can be computed now that we have powerful
desktop computers. These filters replace most of the simple **
technical indicators** used in the past, before desktop
computers were ubiquitous. But the principle is the same. They all
consist of **functions of past returns (or prices)**
that are designed to **predict future returns**. They
may do this directly, or in the form of indicated **buy/sell
signals**. The simple **technical indicators**,
as described for example in the classic text by Edwards & Magee, no
doubt worked fairly well back in the '30s and '40s when the markets
were much smaller, with fewer players, and hence much less **
efficient**. Now markets are much more **efficient**
and those simple indicators are not so effective. They are still
used to analyze the market, but the **buy/sell signals**
they give may not be very profitable. Now these indicators have been
replaced by **program trading** algorithms using
(presumably) sophisticated **Linear Prediction filters**.
But note that the **Efficient Market Hypothesis**,
exemplified by the **Random Walk Model**, says that the
markets are completely **efficient** and no function of
past returns or prices can be used to predict future returns. The
markets are indeed very **efficient** nowadays, but no
market created by Man can be **100% efficient**. The
financial markets still become **overbought/oversold**
on occasion, and thus give rise to potentially profitable trading
opportunities, just like any other markets consisting of buyers and
sellers. The problem is once again to detect these **buy/sell**
opportunities.

There are two categories of **Linear Prediction filters;**
those designed for **stationary** time series and those
that are **adaptive** and can be used for **
non-stationary** time series. A **stationary**
time series is one for which the statistical properties do not
change with time, so the **covariance matrix**, or
**correlation **and** variance** of
returns, is constant with time. This is an ideal situation, much
easier to analyze, but one that is not achieved very often in the
real world. The theory of **Linear Prediction filters**
is much more highly developed for this class of time series, because
the condition of **stationarity** is a powerful
constraint. But **financial time series** are clearly
highly **non-stationary**. If these time series were
instances of some underlying **stochastic process**, it
would be found that the **covariance matrix** of the
process is **time-varying**. But we can only see one
instance of the time series, and we can never know what the
underlying **stochastic process** is. We can only hope
to try to measure the **correlation** and **
variance** over different time intervals and **estimate**
how it varies. Thus the very definition of a **covariance
matrix** for a **non-stationary time series** is
problematic. But we can still try to make **estimates**
and hopefully uncover some useful **predictive**
properties of the time series.

The types of **Linear Prediction filters** that
are suitable for **non-stationary time series** fall
into the category called **Adaptive filters**. The most
basic prototype is called the **Least-Mean Square (LMS) filter**,
which has been called the "workhorse" of **Adaptive filters**
by **Haykin**. In his book on **Neural Networks**,
he has also stated that the **LMS** filter is
equivalent to a **neural network** with one linear
neuron. The **Least-Mean Square filter** adapts
continuously to changing properties of the **covariance matrix**
of the time series, and makes no assumptions about the form of the
**time-dependent correlations** and **
time-dependent variance**. For the present, this is the main
type of filter used in * QuanTek*. It also
seems to be the best type for use with time series, such as
financial time series, that have a very low

The **Adaptive LP filters** use **linear
regression** to regress the **future returns**
on the **past returns**. However, the filters used in
** QuanTek **do not regress on past returns
directly, but instead on a set of

In the **Random Walk Model**, the future price
action is assumed to be **statistically independent**
of the past price action. This future price action is determined by
**exogeneous events**, which are events occuring
external to the markets that are essentially **unpredictable**.
Hence there is no way to predict these **exogeneous events**
or the future price action that they cause, from any past economic
data. However, this is an idealization, although a very good
approximation. In the real world, it is possible to forecast future
prices to some extent, or to at least try. For example, in 1929, a
few astute investors noticed that the stock market was in a "bubble"
or mania, and that a crash was imminent, so they sold the market
short and actually made money in the crash that followed. (In fact,
it was the short selling on the way down that contributed to the
crash.) So they were able to predict the future crash from the
current state of mania in the market. So it is the case, as for all
markets, that the financial markets can be "mispriced" and hence not
entirely **efficient**. These **inefficiencies**
then lead to profit opportunities, if you know how to take advantage
of them. But the market moves due to it being "mispriced", which are
to some extent **predictable**, must be distinguished
from market moves due to **exogenous events**, which
are **unpredictable**. No human being, trading
algorithm, or **Adaptive Filter** can anticipate
**exogenous events**.

What the **Adaptive Filter** can do is try to
separate the **long-term trend**, due to the
"mispriced" market, from the **short-term fluctuations**
due to **exogenous events**, which tend to average out
over time. In the case of * QuanTek*, the

As already stated, the **Default Adaptive** filter
is a variation of the standard **Least-Mean Square**
filter. Depending on the size of the data set, it goes back **
2048 days**, or less if the data set is smaller, then steps
forward one day at a time, adapting the **filter coefficients**
to the **N-day 'future' returns** (relative to any
point in the past). So this is a type of "learning" algorithm.
During this adaptation, the filter output at each point in the past
is saved, so you can view it in various **graphs** and
**displays** in ** QuanTek**. For
this version, the filter output is just a single number, the

The filter calculation is optimized for the **N-day future
returns**. If you wish to change the **Time Horizon**,
you should re-calculate the **Price Projection** for
all the securities, for best results. In the above graph, the value
of **N** is set for **32 days**. Note that
the **N-day future return (annualized)** is also
displayed in the header information above the graph.

As stated previously, the **Default Adaptive**
filter regresses on three types of functions with **wavelet
smoothing**. Each type of function corresponds to a type of
**correlation** in the **price** or
**returns** data. The **Relative Price**
function is the (log) prices smoothed on a scale of **N days**,
relative to some longer time scale such as **512 days**.
This may be viewed as an **indicator** designed to pick
up the **return to the mean** correlation. The **
Velocity** function is the **returns**, smoothed
on a scale of **N days**, designed to pick up the
**trend persistence** correlation. Finally, the **
Volatility** function is the **absolute returns**,
designed to pick up any **GARCH** correlation that may
exist. (It is known that the **volatility** is rather
strongly correlated with **future volatility**. Maybe
it is also correlated with **future returns**.) The
strongest **correlation** appears to be **return
to the mean**.

You can recalculate the filter by means of the **Calculate
Adaptive Filter** button on the toolbar, starting from the
beginning. This may sometimes be necessary, such as when you change
the **Time Horizon** setting. You can also calculate an
**Alternate Adaptive** filter, using the **Select
Adaptive Filter** button. This brings up the **Choose
Linear Prediction Filter Type** dialog, shown here:

This dialog lists 16 different **linear prediction**
filters that we have been testing. The first 8 are **adaptive**
filters, and the last 8 are earlier designs that have been kept for
comparison. The **Default Adaptive** filter is the
first one listed, Adaptive 1. However, you can calculate this filter
and any of the others with a different **Step Size Coefficient**,
by adjusting the slider. (For the older filters the slider adjusts a
different coefficient.) When you select a filter, it is then
calculated and saved as the **Alternate filter**.

Once you have calculated the **Alternate filter**,
you can compare it to the **Default filter** by using
the **Toggle Adaptive Filters** toolbar button. This
switches between the two filters for an immediate comparison. You
can also use the **Historical Price Projection** to
view the **Price Projection** at any day in the past.
For any selected day in the past, you can then click **Toggle
Adaptive Filters** to compare the **Alternate filter**
with the **Default filter** on that day. (The **
Splitter Window** displays also toggle using these toolbar
buttons. Of particular interest is the **Adaptive Filter
Output** display, which shows the whole range of the filter
output over the past 1000 days in the form of a graph.) These were
all tests that were devised to study the performance of the various
filters. Finally, for completeness, you can also calculate the
**Projected Error Bars** using the toolbar button.
These are the **actual measured error bars**, to be
compared to the **estimated error bars** that are shown
by default. The **estimated error bars**, such as shown
in the graph above, are obtained by measuring the **average
absolute deviation** (**high** minus **low**)
over the whole data set, and then extending this forward to future
day **N** by multiplying by the **square root of
N**. (This is just the range predicted by the **Random
Walk Model**.) Then you can toggle between the two types of
**error bars** using the toolbar button. Finally, to go
back to the default display, click the **Restore Display**
button.

The original **Linear Prediction** filter used in
* QuanTek* is the one that I now call the

When you first open a data file, the** Standard LP **
filter is calculated for the present day only, not all the way into
the past. If the **Default Adaptive** filter has never
been calculated, then this **Standard LP** filter is
the only one shown. Once you calculate the **Default Adaptive**
filter, it is shown, but you can still toggle back to the **
Standard LP** filter for the present day. If you want to view
the **Standard LP** filter all the way into the past,
you have to calculate it as the **Alternate filter**
using the filter selection at the top of the **Choose LP
Filter** dialog above. Then you can toggle back and forth
from the **Default Adaptive** filter to the **
Standard LP** filter for any day in the past.

Here is the **Standard LP** filter corresponding to
the graph above, obtained by clicking the **Toggle Adaptive
Filters** button:

Notice that the **Standard LP** filter gives a
varying future **Price Projection**, not just a
straight line as in the case of the **Default Adaptive**
filter. The **Standard LP** filter calculates a set of
**filter coefficients** for the present day, then moves
one day ahead at a time and computes a new **Price Projection**
for that day using the same set of **filter coefficients**.
This means that it is using the assumption of **stationarity**
of the time series to extend the **Price Projection**
forward past day 1 in the future. So this is not very realistic,
although it is a good strategy for smoother time series with a
higher S/N ratio.

In the **Short-Term Trading** dialog, there is also
a display on the right side that uses the **1-day**
prediction of the **Standard LP** filter. This may be
useful for setting daily **buy/sell** orders. It lists
the **1-day** prediction (**expected price**)
of the filter, for the **average price** (average of
**high**, **low**, **open**,
**close**) which seems to be pretty good. Then there is
a list box which shows various prices on either side of this **
predicted average price**, together with the **percent
(of 1-day absolute deviation) deviation** away from the
**predicted average price**. In other words, if you
click up and down in the list box to the +100% and -100% prices,
these are the prices at the **expected price range**
for the day. So this can be a useful tool for setting **day
buy/sell limit orders** at various points in the **
expected price range**, relative to the **expected
average price**. This is one appliction for which the **
Standard LP** filter seems to work pretty well.

**Harvey, Andrew C.; Forecasting,
Structural Time Series Models, and the Kalman Filter;
Cambridge (1989)**

**Haykin, Simon; Neural Networks
- A Comprehensive Foundatation; Macmillan (1994)**

**Percival, Donald B. & Walden, Andrew T.;
Wavelet Methods for Time Series Analysis;
Cambridge (2000)**

**Haykin, Simon; ****
Adaptive Filter Theory, 4th ed.;
Prentice Hall (2002)**

*Go back to ***QuanTek Features**