Investment Studio > Expressions > Functions > Indicator > MO
float array[*][2] mo(float array[*][2] dc, integer days)
Returns a two-column array containing dates (first column) and corresponding Momentum indicator (MO) values (second column). Given n input rows in dc, n - days rows are returned.
dc is a two-column array containing dates (first column) and corresponding daily closes (second column). The array is assumed to be time-sorted, with earlier dates preceding later dates.
Automatic type conversion allows the use of date strings as arguments instead of explicit date values.
days sets the timescale of the MO, i.e. the number of trading days over which each day's MO is computed.
Interpretation
MO is simply the difference between price now and price trading days ago (for the relative difference, use ROC instead). "Momentum" is therefore a misnomer, albeit an ingrained one.
Economists like to borrow their terminology (among other things) from physics. In physics, momentum is velocity times mass; velocity is distance over time. The natural equivalents are:
| Physics | Finance | |||||||||||||||
| distance = position - old position | MO(days) = price(now) - price(now - days) | |||||||||||||||
| velocity = distance / time | MO(days) / days | |||||||||||||||
| mass | number of traded shares (volume) | |||||||||||||||
| momentum = velocity * mass |
|
The last quantity, real momentum, is problematic because the tick-by-tick data needed for its computation often isn't available. In the absence of such data, one must make do with momentum guesstimates like EFI.
An MO chart basically tells you two things: if prices are rising (MO > 0) or falling (MO < 0) and how fast they are doing so (the larger the absolute value of MO, the faster). If MO is falling but still hasn't crossed into negative territory, prices are still rising, but at a declining rate. Since the rate must fall to zero before the price can start falling, peaks and troughs in MO usually lead peaks and troughs in price. An impending trend reversal in price will therefore usually be presaged by a divergence between MO and price (i.e. MO and price will be moving in opposite directions).
When such a divergence appears, it's important to wait for confirmation from the price action (i.e. a peak in price after a peak in MO, a trough in price after a trough in MO) before triggering an actual buy or sell signal. It's also a good idea to keep track of the position of MO peaks and troughs relative to the historical record: a peak occurring well above historical MO levels (i.e. during a strong uptrend in price), or a trough occurring well below historical MO levels (i.e. during a strong downtrend in price), can easily turn out to be a "breather" followed by a resumption of the trend.
A less sophisticated approach is simply to buy when MO crosses above a certain threshold (determined from historical data) and sell when it crosses below a second threshold (ditto). When traders talk about "momentum investing", this is basically what they have in mind. Replacing the thresholds with a longer MO yields another popular system (buy when the short MO crosses above the long MO, sell when the short MO crosses below the long MO).
For a real life example, consider IBM (NYSE:IBM) from January 1 to December 31, 2001:

The top chart shows daily prices in standard candlestick form and their EMA(9). The bottom chart shows the 9 day MO in blue and its 9 day EMA in black (with gray fill-in). The EMA can be seen to introduce only a modest lag (1 or 2 days at most with respect to 0 crossings and peaks) while making the MO much less erratic. In the top chart, the days marked in green are EMA(MO) crossings from below of 1.8; the days marked in red are EMA(MO) crossings from above of 3.
Note the divergences between EMA(MO) and EMA(price), especially in January, May and September.
The following charts show the same asset and period with 12 day (red) and 25 day (blue) MO crossovers:

It's evident from the chart in the middle that raw MO crossovers can be quite erratic, especially in the absence of a clear price trend. The highlighted days in the top chart reflect the much more tractable crossovers of MOs smoothed with EMAs of the same length.
Example
Assuming standard US date format settings,
=mo({{"1/1/1990", 100}, {"1/2/1990", 97}}, 1)
returns {{32875, -3}}. 32785 is the date code for 1/2/1990; -3 = 97 - 100 is the 1 day MI on that date.