Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

public MFI(Bars bars, int period, string description)
public static MFI Series(Bars bars, int period)

Parameter Description

bars The Bars object
period Indicator calculation period

Description

Money Flow Index measures the flow of money into and out of a security over the specified Period. Its calculation is similar to that of the Relative Strength Index (RSI), but takes volume into account in its calculation. The indicator is calculated by accumulating positive and negative Money Flow values (see Money Flow indicator), then creating a Money Ratio. The Money Ratio is then normalized into the MFI oscillator form.

Interpretation

  • Look for oversold levels below 20 and overbought levels above 80. These normally occur before the underlying price chart forms a top or a bottom. Levels may change depending on market conditions. Ensure that the level lines cut across the highest peaks and the lowest troughs. During strong trends the MFI may remain in overbought or oversold for extended periods.
  • If underlying price makes a new high or low that isn't confirmed by the MFI, this divergence can signal a price reversal. MFI divergences from price indicates very strong buy or sell signal.
  • The mid point level of 50 will often act as support or resistance if the FMI bounce off the 50 level. Crosses of the 50 level can be used as a buying or selling signal. When MFI cross above then buy, when FMI crosses below then sell.

Calculation

The follow steps are used to calculate Money Flow Index. See MoneyFlow for an excellent example script showing the construction of the MFI.

Money Flow = Volume x AveragePriceC

Money Flow direction: if today's average price is greater than yesterday's, then it is considered positive money flow, otherwise it is negative money flow.

Positive Money Flow = Sum all the Positive Money Flows day over specified periods. Negative Money Flow = Sum all the Negative Money Flows day over specified periods. Money Ratio = Sum of Positive Money Flow / Sum of Negative Money Flow

Money Flow Index (MFI) = 100 - ( 100 / ( 1 + Money Ratio ) )

Example

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { /* The trading system below buys a position whenever MFI crosses below 20. It sells all open positions as soon as MFI crosses above 80. The Strategy also colors MFI bars red and green to show oversold/overbought levels. */ DataSeries mfi = MFI.Series( Bars, 14 ); ChartPane mfiPane = CreatePane( 50, true, true ); PlotSeries( mfiPane, mfi, Color.Black, WealthLab.LineStyle.Solid, 2 ); SetBarColors( Color.Silver, Color.Silver );

for(int bar = 50; bar < Bars.Count; bar++) { if( CrossUnder( bar, mfi, 20 ) ) BuyAtMarket( bar+1 ); // Let's work directly with the list of active positions if( CrossOver( bar, mfi, 80 ) ) { for( int p = ActivePositions.Count - 1; p > -1 ; p-- ) SellAtMarket( bar+1, ActivePositions[p], "MFI" ); } if( mfi[bar] < 20 ) SetSeriesBarColor( bar, mfi, Color.Red ); if( mfi[bar] > 80 ) SetSeriesBarColor( bar, mfi, Color.Green ); } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.