Log in to see Cloud of Tags

Wealth-Lab Wiki


public MoneyFlow(Bars bars, string description)
public static MoneyFlow Series(Bars bars)

Parameter Description

bars The Bars object


Money Flow returns the average price multiplied by volume. Money Flow is the core component of the Money Flow Index (MFI) indicator. This is not really an indicator, but a mathematical function used to construct other indicators.


See the Money Flow Index (MFI) indicator and the example strategy application below.


Money Flow is the average price multiplied by Volume.

Money Flow = Volume x AveragePriceC


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 example below duplicates the calculation of the MFI double today = 0; double yesterday = 0; DataSeries MFPositive = new DataSeries( Bars, "MFPositive" ); DataSeries MFNegative = new DataSeries( Bars, "MFNegative" ); DataSeries MyMFI = new DataSeries( Bars, "MyMFI" ); DataSeries myAveragePrice = (High+Low+Close)/3; for(int bar = 1; bar < Bars.Count; bar++) { today = myAveragePrice[bar]; yesterday = myAveragePrice[bar-1]; if( today > yesterday ) MFPositive[bar] = MoneyFlow.Series( Bars )[bar]; else if( today < yesterday ) MFNegative[bar] = MoneyFlow.Series( Bars )[bar]; } DataSeries MFPosSum = Sum.Series( MFPositive, 14 ); DataSeries MFNegSum = Sum.Series( MFNegative, 14 ); DataSeries MoneyRatio = MFPosSum/MFNegSum;

for(int bar = 14; bar < Bars.Count; bar++) MyMFI[bar] = 100 - ( 100 / ( 1 + MoneyRatio[bar] ) ); ChartPane MFPane = CreatePane( 30, true, true ); ChartPane MFIPane = CreatePane( 30, true, true ); PlotSeries( MFPane, MyMFI, Color.Navy, WealthLab.LineStyle.Solid, 2 ); PlotSeries( MFIPane, MFI.Series( Bars, 14 ), Color.Brown, WealthLab.LineStyle.Solid, 2 ); } } }

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.