Elder’s Force Index AFL Code

Elder’s Force Index (EFI) is an oscillator that determines the ‘force’ at which the price moves in a particular direction. It was developed by famous phycologist and trader Dr. Alexander Elder and was introduced in his bestselling book Trading for a Living: Psychology, Trading Tactics, Money Management.

According to Elder, there are three primary reasons which cause price movements; direction, extent and volume. The force index oscillator combines all these three factors into one indicator and accurately predicts the market trends.

The indicator fluctuates in positive and negative territory and its magnitude determines the overall power which moves the prices in a particular direction. Essentially it measures the traders’ commitment and conviction for the market. This masterpiece combines the price movement with psychology which is a rare mix.

EFI is in positive territory with higher absolute magnitude when the overall market trend is bullish, while it is in negative territory with higher absolute magnitude when the overall trend is bearish.

Preferred Timeframe

This indicator works well in all the timeframes. But you should look at multiple timeframes for extra confirmation of the signal

Also Read: Percentage Price Oscillator AFL Code


Below is the screenshot of the Elder’s force index plotted in an Amibroker chart. There are two variations of the index; EFI(1) which is simply the difference between the current price and previous price multiplied by volume, and EFI(13) which is the 13 periods exponential moving average of EFI(1).

EFI(1) is plotted in white and EFI(13) is plotted in blue.

Elders Force Index AFL Screenshot

You can also plot them as histograms as per your convenience.

Elder’s Force Index AFL Download

Download the AFL code for Elder’s force index from the below link:

Elder’s Force Index AFL Download

AFL Explanation

After plotting the chart title and candlestick chart, EFI(1) and EFI(13) are calculated using the below formulas:

EFI(1) = (Current Close – Previous Close) * Current Volume

EFI(13) = 13 period EMA of ((Current Close – Previous Close) * Current Volume)


EMA = exponential moving average

And then, these lines are plotted on a candlestick chart by using the standard Amibroker “plot” function.

Do you want to learn AFL coding from scratch and build your own profitable trading systems? Check out our best-selling Algorithmic trading Bootcamp course bundle.

Long and Short Rules

Here are the long and short rules you can consider while trading through EFI:

  1. If EFI(13) is in positive territory with higher absolute magnitude, stay long
  2. If EFI(13) is in negative territory with higher absolute magnitude, stay short
  3. If EFI(13) breaks out from negative to a positive value, go long
  4. If EFI(13) breaks out from positive to a negative value, go short
  5. EFI can also be used to assess the technical divergence between price and indicator. For example- if price makes a higher high and EFI makes a lower high, then the bullishness may be subsiding. And if price makes a lower low and EFI makes a higher low, then the bearishness may come to an end soon


All the AFL’s posted in this section are for learning purposes. Trading Tuitions does not necessarily own these AFL’s and we don’t have any intellectual property rights on them. We might copy useful AFL’s from public forums and post it in this section in a presentable format. The intent is not to copy anybody’s work but to share knowledge. If you find any misleading or non-reproducible content then please inform us at support@tradingtuitions.com

Related Posts

Leave a Reply

Your email address will not be published.