Investment Studio > Expressions > Functions > Indicator > MFP
float array[*][2] mfp(float array[*][5] dhlcv, integer days)
Returns a two-column array containing dates (first column) and corresponding positive Money Flow (MFP) values (second column). Given n input rows in dhlcv, n - days rows are returned.
dhlcv is a five-column array containing daily price and volume quotes. Each row is structured as follows:
| Column # | Content |
| 1 | The quote date. |
| 2 | The day's high (highest traded price). |
| 3 | The day's low (lowest traded price). |
| 4 | The day's close (last traded price). |
| 5 | The day's volume (number of traded shares). |
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 > 0 is the length of the time frame, i.e. the number of trading days contributing to the calculation of each day's MFP value.
Interpretation
MFP is an upside momentum indicator (and the positive component of MFI).
Every trading day, the so-called Typical Price (a simple arithmetic average of the day's high, low and close, also available as function TP)
| high + low + close | ||
| Typical Price | = | ¾¾¾¾¾¾¾¾ |
| 3 |
is computed and compared with the previous trading day's Typical Price; if it has increased, the quantity
Money Flow = Typical Price * volume
is considered positive money flow. The sum of all such positive money flows over the last days is the day's MFP value. A rising MFP is assumed to imply a growing flow of money into the asset under study, an obviously bullish sign.
Note that this is not a strict result. MFP and relatives (MFM, MFI) are mainly useful in the absence of tick-by-tick data showing the price and number of shares traded in each transaction over the course of the trading day (and hence the actual net flow in the asset) or at least of actual upside/downside volume data.
MFP is usually plotted together with its downside counterpart, MFM. Signals are triggered by the MFM crossing above the MFP (sell) and by the MFP crossing above the MFM (buy).
For a real life example, consider Cisco (NASD:CSCO) from June 1 to December 31, 2001:

The top chart shows the price in standard candlestick form, with signals from MFM/MFP crossings highlighted in red (sell) and green (buy). The middle chart shows volume. The bottom chart shows the actual ten day MFM (red) and MFP (green) lines, with arrows marking the crossings.
Example
Assuming standard US date format settings,
=mfp({{"1/1/1990", 97, 84, 86, 858}, {"1/2/1990", 100, 90, 98, 1000}}, 1)
returns {{32875, 96000}}. 32875 is the date code for 1/2/1990; 96000 = 1000 * (100 + 90 + 98) / 3 is the one day MFP on that date since 100 + 90 + 98 > 97 + 84 + 86.
The MFM/MFP chart above uses the definitions
_NDAYS = 10
_QUOTES = asset_quotes(SELF, "HLCV", FROM_DATE - 2 * _NDAYS, TO_DATE)
_MFM = mfm(array(_QUOTES), _NDAYS)
_MFP = mfp(array(_QUOTES), _NDAYS)
_CROSSES = crosses(array(_MFP), 2, array(_MFM), 2)
_MFMX = vlookup(array(_MFM), 2, FALSE) * 1E-6
_MFPX = vlookup(array(_MFP), 2, FALSE) * 1E-6
the line sources
_MFMX
_MFPX
and the image source
choose(2 + vlookup(X, array(_CROSSES), 2, FALSE), {9, _MFMX, -25}, "", {10, _MFMX, 25})
The highlighting in the top chart is done with the image source
choose(2 + vlookup(X, array(_CROSSES), 2, FALSE), {13, asset_close(SELF, X)}, "", {12, asset_close(SELF, X)})