Money Flow Index

The Money Flow Index combines price and volume to identify overbought and oversold levels.

Role in the strategy

SlotAvailableRole
Entry PointNo—
Entry RuleYesFilters entries by the MFI direction or its level position.
Exit PointNo—
Exit RuleYesTriggers 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:

RuleLong signal is 1 whenShort signal is 1 when
MFI risesMFI rose on the previous barMFI fell on the previous bar
MFI fallsMFI fell on the previous barMFI rose on the previous bar
MFI is higher than the Level lineMFI is above LevelMFI is below 100 − Level
MFI is lower than the Level lineMFI is below LevelMFI is above 100 − Level
MFI crosses the Level line upwardMFI crossed above Level from belowMFI crossed below 100 − Level from above
MFI crosses the Level line downwardMFI crossed below Level from aboveMFI crossed above 100 − Level from below
MFI changes its direction upwardMFI formed a valley (down then up)MFI formed a peak (up then down)
MFI changes its direction downwardMFI 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

ParameterTypeDefaultRangePurpose
Periodnumber141 to 1000Bars over which the money flows are summed
Levelnumber200 to 100Long 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.