OPEN-SOURCE SCRIPT

Money Flow Index + VWAP Trend Filter

401
This indicator combines the volume-weighted momentum analysis of the Money Flow Index (MFI) with the trend-filtering capabilities of the Volume Weighted Average Price (VWAP) to generate reliable buy and sell signals. By requiring MFI overbought/oversold conditions to align with the trend direction relative to VWAP, this indicator reduces false signals, making it ideal for trading on timeframes like 5-minute to 4-hour charts.


How It Works
The indicator uses two technical components to produce signals:
  • Money Flow Index (MFI) for Momentum Extremes:
    The MFI, calculated over a default 14-period length, measures buying and selling pressure using price and volume data. A buy signal is triggered when MFI crosses above the oversold level (default: 20), indicating potential buying pressure, while a sell signal occurs when MFI crosses below the overbought level (default: 80), suggesting selling pressure.

  • Volume Weighted Average Price (VWAP) for Trend Direction:
    The VWAP calculates the average price of an asset, weighted by volume, resetting at the start of each trading session (e.g., daily for stocks). It acts as a dynamic support/resistance level. A bullish trend is confirmed when the price is above the VWAP, and a bearish trend when the price is below the VWAP. This ensures MFI signals are filtered to align with the broader trend direction, plotted as a purple line on the chart.

Signal Generation
Signals are generated using the previous bar’s values to prevent repainting:
  • Buy Signal: The MFI crosses above the oversold level, and the price is above the VWAP (bullish trend). Displayed as a green upward triangle below the bar.

  • Sell Signal: The MFI crosses below the overbought level, and the price is below the VWAP (bearish trend). Displayed as a red downward triangle above the bar.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。