OPEN-SOURCE SCRIPT

{Gunzo} Bulls Power vs. Bears Power

Updated
Bulls Power vs. Bears Power is a unique tool that displays on each candle the balance between the bears (sellers) and the bulls (buyers).

OVERWIEW :
This indicator is mainly based on the popular indicator “Elder ray” made by Dr. Alexander Elder in 1989. This indicator has been developed in order to determine the strength of the competing groups of buyers and sellers in the markets.

CALCULATION :
To measure the competing power of bulls and bears, the indicator compares the current high (maximum power of the bulls) and current low (maximum power of the bears) to the average price using a exponential moving average.
Bull Power = Current High – EMA 13 (closing)
Bear Power = Current Low – EMA 13 (closing)

This Elder ray indicator can also tell us more information about market conditions :
  • If the current high and current low are above the EMA 13, the bulls are totally in control on the market
  • If the current high and current low are under the EMA 13, the bears are totally in control of the market
  • If the EMA 13 is in between of the current high and current low, there is strong fight about controlling the market, there is possible reversal in this configuration


SETTINGS :
  • Fast MA Period : Fast moving average period (only used for buy sell signal)
  • Slow MA Period : Slow moving average period (only used for buy sell signal)
  • Display candle labels : Show/hide candle labels on the chart
  • Display only bear labels above X : Exclude all top candle labels on the chart below the value specified.
  • Display only bull labels above X : Exclude all bottom candle labels on the chart below the value specified.
  • Display opposite values : Show all candle labels on top (bearish) and bottom (bullish) or only show the candle labels for the winning force on the candle.
  • Display box for last candle : Show/hide the dominance boxes (red and blue) after last candle showing the last bear and bull power.
  • Display box after X candles : How many candles in the future the dominance boxes should be displayed.
  • Display slow / fast crossover (o) : Display crossover signals (circles) between fast line and slow line.
  • Display bear / bull fighting (x) : Display fighting signals (crosses) between bull and bears.


VISUALIZATIONS :
This indicator has 3 possible complementary visualizations:
  • Candle labels : The labels on top are the percentage of the bears on the candle, while the labels on the bottom are the percentage of the bulls on the candle. When the bulls are winning the labels are blue, when the bears are winning the labels are red, silver otherwise.
  • Box after last candle : The blue and red boxes after the last candle are the percentage of bears and bulls on the last candle of the chart. That boxes can be disabled in the settings if you feel it is redundant with the labels.
  • Signals : The signals are displayed at the bottom of the main area of trading. The orange “x” represents an area where bulls and bears are fighting hard. The blue “o” represents a buy signal (fast line crosses over the slow line) and the red “o” represents a sell sinal (fast line crosses under the slow line).

    USAGE :
    The most important rule in the usage of this indicator is :
    “The higher the current bull power is (or bear power), the higher the chances are the next candle will also be bullish (or bearish).”
    When the prices is increasing, it is very interesting to follow the bull power to verify that it is either stable or increasing. If the bull power keeps decreasing candle after candle, there is chances that in the next candles there will be a reversal.
    When there is orange crosses in the signal area (bottom of the screen), it means that there is a big fight between bulls and bears and that the current price of the asset is probably stable. During these fighting areas, reversals are more likely to happen.
    When there is a blue circle in the signal area (or red signal), it can be considered as a buy signal (or sell signal). These signals are determined by the crossover of the fast and slow lines of the total power of the bulls plus the bears.

    LIMITATIONS :
    As Pine script only allows to display about 50 drawings on the chart, the labels on the candles can not be printed on all the historical candles. The option “Display opposites” could be useful to hide unnecessary labels and then be able to display more older labels.
    As the Elder ray indicator uses an average price (EMA 13 of closing price), the indicator may be lagging in some situations, but most of the time it will help to filter the bad signals contrary to the indicators that are too reactive.

Release Notes
Added script option to display more values on the chart at the same time.
Replaced top box visualization with the new "table" feature available on trading view.
Added conditions for setting up alerts.
Minor variables renaming.
Release Notes
Inverted colors for top right boxes.
Disable informational labels for compatibility issues.
Release Notes
Added some features requested by the community :
  • configurable high/low threshold for alerts (requested by null119988 and Go-Zilla)
  • show the labels on the last X candles in the past (requested by Go-Zilla)
bearishpatternBears PowerbullishpatternBulls PowercandlemeterdbsielderraymarketanalysisTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer