Volume indicator
Chaikin Money Flow (CMF) Calculator
Paste high, low, close, and volume for each bar and this computes the Chaikin Money Flow over your lookback length. It shows where each bar closed within its range, weighted by the volume traded.
What Chaikin Money Flow is
Chaikin Money Flow, developed by Marc Chaikin, is a volume-weighted oscillator built on his Accumulation/Distribution idea. For each bar it asks where the close landed within the high to low range, then weights that answer by the bar's volume. The result oscillates around a zero line, and in practice it stays between -1 and +1.
The calculation has three steps. The money flow multiplier is ((close − low) − (high − close)) / (high − low), which is +1 when the close equals the high and −1 when it equals the low. Multiplying it by volume gives the money flow volume. CMF is then the sum of money flow volume over the lookback divided by the sum of volume over the same lookback. A bar with no range, where the high equals the low, contributes zero money flow volume.
Why Chaikin Money Flow is used
CMF is used to study buying and selling pressure over a window. Readings above zero mean closes tended to land in the upper half of each bar's range, and readings below zero mean they landed in the lower half. Analysts often watch the zero line crossing and compare CMF against price to look for agreement or divergence.
Because the value depends on the lookback length and on where bars close relative to their range, it can differ between instruments and timeframes. What any reading means is a matter of your own analysis. It describes past bars and is not a prediction.
What are TradingView and Pine Script?
TradingView is one of the most widely used charting and market-analysis platforms, where traders and analysts study price movement across stocks, crypto, forex, and futures on interactive charts. Pine Script is TradingView's own lightweight programming language, created so anyone can build custom tools that run directly on those charts.
People use Pine Script to build four main kinds of tools. Indicators calculate and plot values on the chart, exactly like the calculation above, but recomputed automatically on every bar. Strategies add explicit entry and exit rules and can be backtested against historical data in TradingView's Strategy Tester to see how they would have behaved. Screeners scan many symbols at once for conditions you define. Alerts notify you the moment a condition you specified occurs, so you do not have to watch the screen.
The value is precision and automation. Instead of eyeballing a chart, you describe exactly what you want measured, visualized, or notified about, and TradingView runs it consistently across any market and timeframe. That is why traders, analysts, and developers write Pine Script: it turns a manual charting idea into a repeatable tool. These tools are for tracking, visualizing, and testing market ideas; they do not tell you what to trade, and that decision always remains yours.
Writing that code by hand means learning Pine Script's syntax, its type system, and the exact names of hundreds of built-in functions. It is a real programming language, and small mistakes stop a script from compiling in the Pine Editor.
Turn this into Pine Script
This calculator gives you CMF at the latest bar of the data you paste. On a live TradingView chart it needs to update on every bar and plot beneath price. In Pine Script that is the multiplier, a pair of math.sum calls, and a zero line, but turning it into an indicator with alerts on zero line crosses or a smoothed signal is where most of the work lives.
//@version=6
indicator("Chaikin Money Flow", overlay = false)
length = input.int(20, "Length", minval = 1)
// Money flow volume: multiplier times volume, 0 when the bar has no range
mfVolume = high == low ? 0.0 : ((close - low) - (high - close)) / (high - low) * volume
cmf = math.sum(mfVolume, length) / math.sum(volume, length)
plot(cmf, "CMF", color = color.teal)
hline(0, "Zero line", color = color.gray)PineScripter is an AI built specifically for Pine Script. You describe what you want in plain English and it writes TradingView-ready v6 code. Because it is specialized on the Pine Script language and its exact function signatures, it tends to produce code that compiles far more reliably than general-purpose models like ChatGPT, which often invent functions that do not exist in Pine Script.
Related free calculators
From the blog
PineScripter is an AI developer tool that helps you write Pine Script code. It is not a financial advisor and will never offer financial, investment, or trading advice. Everything on this page, including the calculator and the explanations, is provided purely for educational and informational purposes. Any decision about how to interpret an indicator or trade a market is entirely your own. See our full disclaimer for more.