LazyBear

Indicator: Market Facilitation Index [MFIndex]



***** NOTE: You may see all GREEN circles (it is due to a recent TV update). To work around this issue, change the "Circles" to "Cross" via Format -> Style *****

Market Facilitation Index, by Bill Williams, plots the effectiveness of price movement by computing the price movement per volume unit.

4 possible combinations of MFIndex and Volume are:

Green :
---------------------------------
MFIndex increases and the volume increases. This means that the amount of participants entering the market increases, therefore the volume increases and the fresh incoming players align their positions in the direction of candlestick growth.

Fade :
------------------------------
MFIndex falls and volume falls. It means that the market participants are indifferent and the price movement is small on small volumes. This usually happens at the end of a trend.

Fake :
------------------------------
MFIndex increases, but the volume falls. It is highly likely that the market is being supported by broker speculation and not any significant client volume .

Squat :
--------------------------------
MFIndex falls, but the volume increases. In this particular situation bulls and bears are fighting between themselves to see who will dominate the next trend. These battles are noticeable by the large sell and buy volumes. However, the price does not change appreciably since the strengths are equal. One of the competing parties either the buyers or the sellers will ultimately triumph in the battle. Usually, the fracture of such a candle indicates if this particular candle determines the continuation of the trend, or terminates the trend.

More info: http://en.wikipedia.org/wiki/Market_facilitation_index

Code: http://pastebin.com/Y9qYTW2R
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear
// @credits http://en.wikipedia.org/wiki/Market_facilitation_index
//
// If you use this code in its original/modified form, do drop me a note. 
//
study("Market Facilitation Index [LazyBear]", shorttitle="MFIndex_LB", overlay=true)
plot_offs=input(0.005, title="Indicator offset % (below low)")
r_hl=roc((high-low)/volume,1)
r_v=roc(volume,1)
green_f= (r_hl > 0) and (r_v > 0)
fade_f=(r_hl < 0) and (r_v < 0)
fake_f=(r_hl > 0) and (r_v < 0)
squat_f=(r_hl < 0) and (r_v > 0)
b_color = green_f ? green : fade_f ? blue : fake_f ? gray : squat_f ? red : na
plot(low - (low*plot_offs), color=b_color, style=circles, linewidth=4)
Nice job on this one.

Would be much easier to read this if we had candle volume chart type.
+2 Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
Thx
+2 Reply
BizkitBR PRO
2 years ago
Nice work dude...
+1 Reply
LazyBear PRO BizkitBR
2 years ago
Thx.
+1 Reply
the_batman PRO
2 years ago
Thanks. Possible to code a version that uses multiple bars per indicator bar (ie for a 5-min chart where you wanna see the MFI of the hour?)
Reply
LazyBear PRO the_batman
2 years ago
Here's the MTF version.

Source: http://pastebin.com/NZRvLP7Y

snapshot
+2 Reply
the_batman PRO LazyBear
2 years ago
Thanks a ton!
Reply
the_batman PRO LazyBear
2 years ago
You didn't publish it. Shall I or ..?
Reply
LazyBear PRO the_batman
2 years ago
I have already added this to my main scripts index - https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit#heading=h.hxxxw8bfvb8j

Feel free to include this in your published charts.
Reply
the_batman PRO
2 years ago
Question: The MFI is supposed to use tick volume in it's measure ("trends come from off the floor"). I don't see that anywhere here. What am I missing?
Reply
the_batman PRO the_batman
2 years ago
Where are the ticks?

I checked out the wikipedia article you posted. It's vague and/or wrong. (I'm not sure what a "volume unit" is.) Referring back to the original source material, the original name of this badboy was "mileage per tick". I was just wondering if you'd implemented it as such (correctly) or the normal way (incorrectly, with volume in lieu of tick volume).
Reply
LazyBear PRO the_batman
2 years ago
Tick volume data is not available here. The best you can do is 1min.
+1 Reply
coondawg71 PRO
2 years ago
Great indicator! Can we please request the option to be added which allows the colorization of the price bars? How about the standard MFI histogram with the colorization? Thank You !
Reply
LazyBear PRO coondawg71
2 years ago
Here you go..this version will color bars or draw histo (based on HL ROC) - http://pastebin.com/Kwbv7qrT

Sample chart:
snapshot
Reply
coondawg71 PRO LazyBear
2 years ago
Perfect! Thanks LB
Reply
LazyBear PRO coondawg71
2 years ago
yw :)
Reply
coondawg71 PRO LazyBear
2 years ago
wow! don't look, but it makes the US stock "markets" look even scarier!!!
Reply
CA2015Wb
4 months ago
Thanks for the starting point! I wanted an indicator that showed a histogram on the bottom, so modified your original code as follows to do it:

//@version=2
study("Market Facilitation Index", shorttitle="MFIndex_CSA")
p_range=roc((high-low)/volume,1)
plt_range=(high-low)
plt_mfi=(plt_range/volume)
t_volume=roc(volume,1)
green_wdw= (p_range > 0) and (t_volume > 0)
fade_wdw=(p_range < 0) and (t_volume < 0)
fake_wdw=(p_range > 0) and (t_volume < 0)
squat_wdw=(p_range < 0) and (t_volume > 0)
b_color = green_wdw ? green : fade_wdw ? blue : fake_wdw ? gray : squat_wdw ? red : na
plot(plt_mfi, color=b_color, style=histogram, linewidth=4)

This would have been a far more difficult task had I not had your model to start with. Thanks again!!

Chuck
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out