Balance of Power Indicator Amibroker AFL Code

In this post, we’ll go through a Balance of Power Indicator Amibroker AFL Code. The AFL code can be downloaded free of cost and imported into Amibroker.

Balance of Power Indicator Overview

The Balance of Power is a technical indicator that measures the strength of buyers and sellers in the market. It calculates the power of buyers in an uptrend and the power of sellers in a downtrend. It is calculated using the following formula:

BOP = (Close - Open) / (High - Low)

The BOP indicator returns values between -1 and 1, with positive values indicating that buyers are in control and negative values indicating that sellers are in control.

Also Read: Weekly Breakout Trading Strategy Amibroker AFL Code

Balance of Power Indicator Amibroker AFL Download

Please download the AFL code from this link. It can be readily imported into Amibroker.

Balance of Power Indicator Amibroker AFL Screenshot

Check out the screenshot of this AFL below

Balance of Power Indicator Amibroker AFL

AFL Explanation

  1. The formula for calculating the BOP indicator is (Close - Open) / (High - Low).
  2. The code starts with the calculation of BOP indicator using the formula, and stores it in a variable called BOP. The C and O variables represent the current closing price and opening price respectively, while H and L represent the high and low prices for the current bar.
  3. The Plot() function is used to plot the BOP indicator as a histogram. The first parameter is the data to be plotted (BOP in this case), the second parameter is the name of the plot (“Balance of Power”), the third parameter is the color of the plot (blue in this case), and the fourth parameter is the style of the plot (histogram in this case).

Also Read: The 7 Best Indicators for Intraday Trading


All the AFLs posted in this section are for learning purposes. Trading Tuitions does not necessarily own these and we don’t have any intellectual property rights on them. We might copy useful AFLs from public forums and post them 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


  1. seems that any of AFL files can’t be downloaded anymore. Links are broken.

Leave a Reply

Your email address will not be published.