Volume

Chaikin Money Flow Signals: Volume Weighting and Data Limits

Read CMF zero and threshold crossings with a guarded Pine Script example. Understand gap behavior, missing volume and why CMF cannot identify institutional flows.

Chaikin Money Flow Signal Interpretation

Quick-reference guide to 5 signal types you will see on the chart.

Signal TypeIndicator ConditionMarket MeaningInterpretation limits
CMF above a positive thresholdCMF exceeds the selected positive levelVolume-weighted closes favor the upper parts of recent bar ranges.Does not identify buyers or measure dollars entering an asset.
CMF below a negative thresholdCMF falls below the selected negative levelVolume-weighted closes favor the lower parts of recent bar ranges.Not evidence that large institutions are selling.
Cross above zeroA confirmed change from non-positive to positive CMFThe weighted balance changes sign.A crossing is not an executed entry or reversal forecast.
Cross below zeroA confirmed change from non-negative to negative CMFThe weighted balance changes sign in the opposite direction.No universally best entry/exit use is established.
Price/CMF divergence conceptCorresponding price swings and CMF swings disagreeA relationship requiring explicit swing selection and confirmation.The example does not label arbitrary window extremes as confirmed divergence.

Chaikin Money Flow Pine Script Signal Code

Educational indicator example. Review its exact rules and compare its plots with your intended calculation in TradingView. It does not place orders or establish profitability.

Pine Script v6
//@version=6
indicator("CMF Threshold Condition Examples", overlay=false)
length = input.int(21, "CMF Period", minval=1)
upper = input.float(0.05, "Positive Threshold", minval=0, maxval=1)
lower = input.float(-0.05, "Negative Threshold", minval=-1, maxval=0)
multiplier = high == low ? 0.0 : (2.0 * close - high - low) / (high - low)
missingCount = math.sum(na(volume) ? 1.0 : 0.0, length)
volumeSum = math.sum(nz(volume), length)
weightedSum = math.sum(multiplier * nz(volume), length)
cmf = missingCount == 0 and volumeSum > 0 ? weightedSum / volumeSum : na
crossUp = ta.crossover(cmf, 0)
crossDown = ta.crossunder(cmf, 0)
upperCross = ta.crossover(cmf, upper)
lowerCross = ta.crossunder(cmf, lower)
zeroUp = barstate.isconfirmed and crossUp
zeroDown = barstate.isconfirmed and crossDown
positiveEntry = barstate.isconfirmed and upperCross
negativeEntry = barstate.isconfirmed and lowerCross
plot(cmf, "CMF", color=cmf >= 0 ? color.teal : color.red, linewidth=2)
hline(upper, "Positive threshold", color=color.green)
hline(lower, "Negative threshold", color=color.red)
hline(0, "Zero", color=color.gray)
bgcolor(cmf > upper ? color.new(color.green, 90) : cmf < lower ? color.new(color.red, 90) : na)
plotshape(zeroUp, "Zero cross up", shape.triangleup, location.bottom, color=color.green, size=size.small)
plotshape(zeroDown, "Zero cross down", shape.triangledown, location.top, color=color.red, size=size.small)
alertcondition(zeroUp, "CMF zero cross up", "Confirmed CMF cross above zero")
alertcondition(zeroDown, "CMF zero cross down", "Confirmed CMF cross below zero")
alertcondition(positiveEntry, "CMF positive threshold cross", "Confirmed CMF cross above the selected positive threshold")
alertcondition(negativeEntry, "CMF negative threshold cross", "Confirmed CMF cross below the selected negative threshold")

Example settings for Chaikin Money Flow

Record the inputs used by the example. These settings are not an optimized trading recommendation.

Feature comparison table: Default vs Description
ParameterDefaultDescription
CMF Period21 bars, exampleTwenty-one bars approximate a trading month only on an appropriate daily market calendar; they are not a calendar month on every timeframe.
Positive Threshold0.05, exampleA buffer around zero. It does not classify real investor identities or establish overvaluation.
Negative Threshold-0.05, exampleOpposite buffer. Compare event changes on reserved data rather than asserting stronger readings are more profitable.
Missing or zero volumeReturn no CMF valueThe example suppresses a window with missing volume or no positive volume total. A zero-range candle contributes zero weighted volume.

Turn the condition into an explicit rule

Specify the calculation, confirmation time, entry and exit rules before asking Pineify to draft or revise Pine Script. Review the code and simulate realistic costs before evaluating a strategy.

Explore Pine Script coding

FAQ

Chaikin Money Flow Signals FAQ

Does CMF measure actual cash flowing into a stock?
It is a normalized price/volume calculation. The formula weights each bar’s volume by where its close lies within that bar’s range. It does not observe investor identity, net fund subscriptions or dollar inflows.
Why can CMF rise after a downward gap?
The multiplier compares close with the current bar’s high and low, not the previous close. A gap-down bar can close near its own high and make a positive contribution. Inspect this mechanism before interpreting a divergence.
Can I assume crypto volume is complete and reliable?
No. The selected feed and venue determine the observed volume. A single chart does not establish complete market activity or the absence of hidden/off-venue trading. Verify what the field represents before comparing symbols.
How does this differ from OBV?
CMF uses range position, volume weights and a rolling normalization. OBV accumulates signed volume according to close-to-close direction. Their numerical scales and gap behavior differ; neither reveals who traded.
Are the divergence and reliability claims tested here?
No personal trade sample or numeric reliability is established. The code implements zero and threshold crossings, not swing divergence or a complete trading strategy.
How do I check the script?
Match period, feed and timeframe with the built-in CMF; inspect normal, zero-range and missing-volume cases. Markers wait for close. Compare alert logs on new data, since replaying old bars does not trigger saved server alerts.