Money Flow Index
The Money Flow Index combines price and volume to identify overbought and oversold levels.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the MFI direction or its level position. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers exits by the MFI direction or its level position. |
The Money Flow Index produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.
Logic rules
The indicator offers the standard oscillator rule set, evaluated on the MFI value:
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| MFI rises | MFI rose on the previous bar | MFI fell on the previous bar |
| MFI falls | MFI fell on the previous bar | MFI rose on the previous bar |
| MFI is higher than the Level line | MFI is above Level | MFI is below 100 − Level |
| MFI is lower than the Level line | MFI is below Level | MFI is above 100 − Level |
| MFI crosses the Level line upward | MFI crossed above Level from below | MFI crossed below 100 − Level from above |
| MFI crosses the Level line downward | MFI crossed below Level from above | MFI crossed above 100 − Level from below |
| MFI changes its direction upward | MFI formed a valley (down then up) | MFI formed a peak (up then down) |
| MFI changes its direction downward | MFI formed a peak (up then down) | MFI formed a valley (down then up) |
The Level parameter sets the long threshold; the short threshold is always 100 − Level. With the default Level of 20, the long side uses 20 and the short side uses 80.
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Period | number | 14 | 1 to 1000 | Bars over which the money flows are summed |
| Level | number | 20 | 0 to 100 | Long threshold; the short threshold is 100 − Level |
Calculation
tech.MFI in engine/indicator-engine/tech.ts computes:
- Typical price × Volume = raw money flow per bar.
- Positive money flow on up bars, negative on down bars.
- MFI =
100 − 100 / (1 + Positive Flow / Negative Flow)over the Period.
The MFI line is drawn in a separate chart pane. The indicator needs volume data.
Backtesting
- The rule is evaluated on the previous (closed) bar with the standard dead zone (
SIGMA = 0.000001). - The indicator contributes only long/short signal arrays — it never changes the entry or exit order price.
- An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.