← Script Marketplace
Open-source scriptindicator/v1

Money Flow Index

by Kodexius·@kodexius·

Measure volume-weighted buying and selling pressure with a configurable Money Flow Index oscillator.

#mfi#momentum#oscillator#volume
Money Flow Index chart preview
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.

About this script

The Money Flow Index combines price and volume to estimate buying and selling pressure. Use the configurable threshold levels to identify extreme readings and monitor crosses back into the normal range.

Source code
mpl-2.0
// Volume-weighted momentum oscillator
indicator("Money Flow Index", { overlay: false });

const len = input.number("MFI length", 14, { min: 2, max: 100 });
const overbought = input.number("Overbought", 80, { min: 50, max: 100 });
const oversold = input.number("Oversold", 20, { min: 0, max: 50 });
const value = mfi(hlc3, len);

plot(value, { title: "MFI", color: "#22d3ee" });
hline(overbought, { title: "Overbought", color: "#f87171", overlay: false });
hline(50, { title: "Midline", color: "#64748b", overlay: false });
hline(oversold, { title: "Oversold", color: "#34d399", overlay: false });

alertcondition(crossover(value, oversold), "MFI crossed above the oversold level");
alertcondition(crossunder(value, overbought), "MFI crossed below the overbought level");

Release notes

Initial official release.