# Money Flow Indicator (Chaikin Oscillator)

286 1
Indicator plots Money Flow Indicator (Chaikin). This indicator looks
to improve on Larry William's Accumulation Distribution formula that
compared the closing price with the opening price. In the early 1970's,
opening prices for stocks stopped being transmitted by the exchanges.
This made it difficult to calculate Williams' formula. The Chaikin
Oscillator uses the average price of the bar calculated as follows
(High + Low) /2 instead of the Open.
The indicator subtracts a 10 period exponential moving average of the
AccumDist function from a 3 period exponential moving average of the
AccumDist function.
```////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 12/05/2014
//    Indicator plots Money Flow Indicator (Chaikin). This indicator looks
//    to improve on Larry William's Accumulation Distribution formula that
//    compared the closing price with the opening price. In the early 1970's,
//    opening prices for stocks stopped being transmitted by the exchanges.
//    This made it difficult to calculate Williams' formula. The Chaikin
//    Oscillator uses the average price of the bar calculated as follows
//    (High + Low) /2 instead of the Open.
//    The indicator subtracts a 10 period exponential moving average of the
//    AccumDist function from a 3 period exponential moving average of the
//    AccumDist function.
////////////////////////////////////////////////////////////

study(title="Money Flow Indicator (Chaikin Oscillator)", shorttitle="MFI")
Fast = input(3, minval=1)
Slow = input(10, minval=1)
hline(0, color=gray, linestyle=dashed)
lenMax = max(Fast, Slow)
lenMin = min(Fast, Slow)
xDiv = (high - low) * volume
SumMax = sum(iff(xDiv > 0, (close - open) / (high - low) * volume , 0) , lenMax)
SumMin = sum(iff(xDiv > 0, (close - open) / (high - low) * volume , 0) , lenMin)
emaMax = ema(SumMax, lenMax)
emaMin = ema(SumMin, lenMin)
nRes = emaMax - emaMin
plot(nRes, color=blue, title="RMI")
```
DONATE/TIP

BTC: 1Lo1GoTNsPbrjGAgPgF4MYZPhBFdoVHaTm
Good work on programming this indicator. I was wondering if it might be more accurate to track money flow using something called Twiggs Money flow. I read about it and rather than reproduce it, you can find that write up here:
http://www.incrediblecharts.com/indicators/twiggs_money_flow.php
It will account for gaps up or down. and give early warning of moves about to happen in either direction as well. The logic of how to calculate Twiggs Money Flow is also presented. I think this would be an added bonus to have Twiggs Money Flow in Tradingview. All the best.
Banimal
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter