Skip to main content
BTC / USDT——ETH / USDT——SOL / USDT——BNB / USDT——XRP / USDT——DOGE / USDT——TON / USDT——AVAX / USDT——LINK / USDT——ADA / USDT——TRX / USDT——DOT / USDT——BTC / USDT——ETH / USDT——SOL / USDT——BNB / USDT——XRP / USDT——DOGE / USDT——TON / USDT——AVAX / USDT——LINK / USDT——ADA / USDT——TRX / USDT——DOT / USDT——
Preise

MFI (Money Flow Index)

Volume-weighted RSI, 0–100 — TradeStation and MetaStock code.

MFI is a volume-weighted RSI: it measures buying versus selling pressure from typical price and volume over N bars, bounded 0–100. Above 80 is overbought, below 20 oversold, and MFI/price divergences flag weakening moves. Copy the version for your platform.

MQL4 · MFI.mq4
#property indicator_separate_window
#property indicator_buffers 1

input int MFIPeriod = 14;

double MFIBuffer[];

int OnInit() {
  SetIndexBuffer(0, MFIBuffer);
  IndicatorShortName("MFI");
  return 0;
}

int OnCalculate(const int rates_total, const int prev_calculated, const double &close[]) {
  for (int i = 0; i < rates_total; i++) {
    MFIBuffer[i] = iMFI(NULL, 0, MFIPeriod, i);
  }
  return rates_total;
}
MQL5 · MFI.mq5
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1

input int MFIPeriod = 14;

double MFIBuffer[];

int OnInit() {
  SetIndexBuffer(0, MFIBuffer, INDICATOR_DATA);
  IndicatorSetString(INDICATOR_SHORTNAME, "MFI");
  return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total, const int prev_calculated,
                const datetime &time[], const double &open[],
                const double &high[], const double &low[],
                const double &close[], const long &tick_volume[],
                const long &volume[], const int &spread[]) {
  for (int i = 0; i < rates_total; i++) {
    MFIBuffer[i] = iMFI(_Symbol, PERIOD_CURRENT, MFIPeriod);
  }
  return rates_total;
}
Pine Script
//@version=5
indicator("MFI")
length = input.int(14, "Length")
plot(ta.mfi(hlc3, length), "MFI", color=color.red)
EasyLanguage
inputs: Length(14);
Plot1(MFI(Length), "MFI");
MetaStock
MFI(14)

To use it inside dtcharts, paste any version into the Script Converter and it becomes a native indicator on your chart.