Money Flow Index

The Money Flow Index (MFI) is similar to a lot of other momentum indicators, RSI being the most well knows. These indicators make it possible to very quickly see if a coin is overbought or oversold and thus if it would be a good time to buy or sell. The MFI has a value between 0 and 100. There are a few other things that the MFI consists of, the Typical Price and the Money Ratio. To calculate the final MFI, first you need to calculate the Typical Price which is done with the following formula: (highest price + lowest price + closing price) /3. This calculation is always done over 1 candlestick, the difference in Typical Price between different candlestick is called the Money Flow. The eventual Money Flow Index is calculated using complicated formulas where the trading volume is also a factor. Now we can use this MFI to see if there is more or less money being traded in the coin compared to a set period.


How to use MFI in Gunbot

Gunbot can use the MFI in 2 different ways: first as a PnD protection and second as a confirming indicator. In this article we will only discuss the second option. When you want to use MFI as a confirming indicator then Gunbot will check if the MFI is lower than the set buy_level for buy orders. For sell orders, Gunbot will check if the MFI is higher than the set sell_level before placing an order. If any of the conditions are not met, there will be no order.

To use MFI in your strategy, go to Settings > Strategy Configurator and select your strategy there. Next, click the indicator tab and check MFI Enabled and you will see the button turn to blue to confirm you are now using MFI. You will also notice a few new parameters appearing, they are explained on bottom of this page.


You may adjust these parameters to your liking, we highly suggest you use the Backtesting add-on to see what settings give you the safest or most profitable trades.

MFI_ENABLED false Values: true or false.
Setting this to true will make sure Gunbot only sells when both strategy selling conditions and MFI_BUY_LEVEL/MFI_SELL_LEVEL are met.
MFI_BUY_LEVEL 30 Values: numerical, ranging between 1 and 99.
Defines the maximum MFI level you want to allow buy orders at.When set to 30, buy orders will only be placed when MFI is between 0 and 30.
MFI_SELL_LEVEL 70 Values: numerical, ranging between 1 and 99.
Set this to the minimum MFI level you want to allow sell orders at.For example: when set to 70, sell orders will only be placed when MFI is between 70 and 100.
MFI_LENGTH 14 Values: numerical, represents a number of candlestick periods.
Set this to the number of candlestick periods you want to use for calculating MFI.MFI is calculated using an array of the period close prices of MFI_LENGTH-1 candles and the last price.

Sign up for our newsletter: