Bill Williams Market Facilitation Index: Getting Color Values from Values of iBWMFI()

 

  Bill Williams Market Facilitation Index is typically represented by colored bars:

  • Green bar (Green)
  • Blue bar - (Fade)
  • Pink bar - (Fake)
  • Brown bar - (Squat)

 The mq4 function iBWMFI() returns numbers.  What number ranges should be associated with what colors?  For example, what colored bar should correspond to a value of 0.12345?

 
hknight:

  Bill Williams Market Facilitation Index is typically represented by colored bars:

  • Green bar (Green)
  • Blue bar - (Fade)
  • Pink bar - (Fake)
  • Brown bar - (Squat)

 The mq4 function iBWMFI() returns numbers.  What number ranges should be associated with what colors?  For example, what colored bar should correspond to a value of 0.12345?


The code is here,  check for yourself:  https://www.mql5.com/en/code/7992
 
My question is about how to use this function:
https://docs.mql4.com/indicators/iBWMFI

RaptorUK, the code in your link does not use the native mq4 function iBWMFI().
That function returns numbers and I want to know how to interpret those numbers.
 
hknight:
My question is about how to use this function:
https://docs.mql4.com/indicators/iBWMFI

RaptorUK, the code in your link does not use the native mq4 function iBWMFI().
That function returns numbers and I want to know how to interpret those numbers.

If you loo at the code you will see this . . .

else ExtMFIBuffer[i]=(High[i]-Low[i])/(Volume[i]*Point);

 . . .  which happens to agree with this . . .  "The Market Facilitation Index [1] (MFI) is the creation of Dr. Bill Williams. The indicator endeavors to establish the effectiveness of price movement by computing the price movement per volume unit. This is accomplished by subtracting the days low from the high and dividing the result by the total volume. (See below)"  from here:  Wiki


I assume that this is what iBWMFI() returns . . . 

 
So what values correspond to the green bar?
 
hknight:
So what values correspond to the green bar?
Did you look at the code ?  did you look at the Wiki article ?  I guess not,  maybe you should.  There is no value that corresponds to any of the bars . . . .  I knew nothing about BWMFI until your post,  now I know what determines if a bar is green or not and it is not based on a single value.  Read the Wiki,   it is all explained there.
 
What you should be asking is this . . .  "Is the BWMFI even valid for MT4 as there is no volume available on MT4 ?"
 

You only need to rewrite the function, it's not that hard:

if( MyBWMFI(Symbol(),PERIOD_H4,1) == "green" )
{
  //do some shit here...
}

string MyBWMFI(string SYMBOL, int PERIOD, int SHIFT)
{
  double Candle_1 = iOpen(SYMBOL,PERIOD,SHIFT) - iClose(SYMBOL,PERIOD,SHIFT);
  double Candle_2 = iOpen(SYMBOL,PERIOD,SHIFT+1) - iClose(SYMBOL,PERIOD,SHIFT+1);
  if( Candle_1 < 0 ) Candle_1 = Candle_1 - Candle_1*2;
  if( Candle_2 < 0 ) Candle_2 = Candle_2 - Candle_2*2;
  if( Candle_1 >  Candle_2 && iVolume(SYMBOL,PERIOD,SHIFT+1) <  iVolume(SYMBOL,PERIOD,SHIFT) ) return("green");
  if( Candle_1 <= Candle_2 && iVolume(SYMBOL,PERIOD,SHIFT+1) >= iVolume(SYMBOL,PERIOD,SHIFT) ) return("brown");
  if( Candle_1 >  Candle_2 && iVolume(SYMBOL,PERIOD,SHIFT+1) >= iVolume(SYMBOL,PERIOD,SHIFT) ) return("blue");
  if( Candle_1 <= Candle_2 && iVolume(SYMBOL,PERIOD,SHIFT+1) <  iVolume(SYMBOL,PERIOD,SHIFT) ) return("pink");
  return(0);
}

<link removed by moderator>

 

I actually came across this problem myself.  I had no idea how to come up with the colors and after checking two sites I couldn't find the answer so I tried to do it the hard way by watching the bar and taking note of the time of the color change and calculating the value.  The key words that I was looking for as RaptorUK had stated was already posted on Wiki, (which was a site that I hadn't even see before), was:

 MFI and volume are compared to the previous candles MFI and volume

 OMG I feel like such a genius now.  I wasted two hours doing it the hard way.  I'm gonna post the actual values for those of us who were lazy to look for it.  

 Green = Volume(+) Index (+)

Blue    = Volume(-) Index (-)

Pink     = Volume(-) Index (+)

Brown  = Volume(+) Index (-) 

Reason: