Visual Basic (Declaration)  

Public Overloads Shared Function ChaikinMoneyFlowOverPeriod( _ ByVal s As Series, _ ByVal lengthOfPeriod As Integer _ ) As Series 
Visual Basic (Usage)  Copy Code 


C#  

public static Series ChaikinMoneyFlowOverPeriod( Series s, int lengthOfPeriod ) 
Parameters
 s
 A financial series.
 lengthOfPeriod
 An integer which represents the number of periods over which the indicator is calculated.
Remark: The form in which the Chaikin Money Flow (CMF) in provided here is particularly suitable when wishing to integrated this functionality within a Client side GUI Charting Application.
Details of Chaikin Money Flow (CMF)
Chaikin Money Flow (CMF) is a volume weighted average of Accumulation/Distribution over a specified period, which is usually taken to be 21 days. The CMF offers a volume weighted indicator on the following two principles:
 The nearer the close is to the high the more accumulation is taking place.
 The nearer the close is to the low the more distribution is taking place.
Evaluation
The CMF indicator is evaluated for the following steps:
 Evaluate the Volume Weighted Accumulation/Distribution over each of the days within the
period considered for the calculation. The Volume Weighted Accumulation/Distribution on each
day is given by:
(((Close  Low)(High  Close))/(High  Low)) * Volume  Sum the Volume Weighted Accumulation/Distribution over the period and the divide the result by the sum of the volume over the period.
Example of Application
Within this example we illustrate the way this method works when we consider a given 10 period in which the length of period over which the CHM is evaluated is 4. In this case the result will be an array of 7 elements as follows:
 result[0]: CMF calculated over the last four periods
 result[1]: CMF calculated over previous four periods
 ...
 result[7]: CMF calculated using the periods between the earliest period and the fourth from earliest period.