OPEN-SOURCE SCRIPT
Bullish-Bearish Candle Power

Bullish Bearish Candle Power
What Does This Code Do For You?
Saves you from the hassle of constantly scanning for candlestick patterns on the screen.
Measures whether price action is supported by volume.
Provides an emotion-free, mathematical momentum report.
Part 1: Measuring the Candle Anatomy
The code breaks down every new candlestick into precise components:
Candle Range: The difference between the highest and lowest price.
Body Size: The net difference between the open and close price.
Wicks (Upper and Lower): Shows how much the price was rejected at the top and bottom.
Part 2: Pattern Recognition Engine
This is the smartest part of the code. It automatically scans for popular technical analysis candlestick patterns. If a candle meets the rules, it awards Bonus Points to that direction's strength.
Bullish (Uptrend) Patterns and Criteria:
Hammer: Long lower wick, short upper wick (Buyers bought the dip). +25 points.
Bullish Engulfing: The green candle's body is larger than the previous red candle's body. +30 points.
Bullish Marubozu: A solid green candle with almost no wicks. +35 points.
Morning Star, Tweezer Bottom, Harami: Other classic reversal patterns.
Bearish (Downtrend) Patterns and Criteria:
Shooting Star: Long upper wick, short lower wick (Sellers hit from the top). +25 points.
Bearish Engulfing: The red body engulfs the previous green body. +30 points.
Bearish Marubozu: A solid, full red candle. +35 points.
Evening Star, Tweezer Top, Hanging Man: Classic bearish reversal patterns.
Part 3: Volume Confirmation
Low-volume rallies are usually traps. To solve this, the code divides the current candle's volume by the volume average of the last 20 candles (SMA). If the volume is above the average, the power is multiplied; if it is below, it reduces the score.
Part 4: Final Strength Calculation
The code aggregates all this data (Position in the candle + Volume + Bonus Points) and creates two pools: Raw Bullish Power and Raw Bearish Power. It then converts them into percentages:
Bullish Percentage = (Bullish Score / Total Score) * 100
For example, at the end of the calculation, the system tells you: "There is 80% Buying and 20% Selling pressure on this candle."
Part 5: Visualization, Tables, and Alerts
It displays the results on your screen for easy reading:
Sub-chart Lines: Draws dynamic Green and Red lines to show instantly who is in control.
Top-Right Table: Shows the real-time percentage status of the candle and the detected pattern name (e.g., Hammer).
Background Colors and Alerts: If either side exceeds a threshold you set in the settings (for example 75%), it paints the background of the screen and sends an automatic alert to your phone or computer.
GOOD LUCK!
Author:Rmzn4406
What Does This Code Do For You?
Saves you from the hassle of constantly scanning for candlestick patterns on the screen.
Measures whether price action is supported by volume.
Provides an emotion-free, mathematical momentum report.
Part 1: Measuring the Candle Anatomy
The code breaks down every new candlestick into precise components:
Candle Range: The difference between the highest and lowest price.
Body Size: The net difference between the open and close price.
Wicks (Upper and Lower): Shows how much the price was rejected at the top and bottom.
Part 2: Pattern Recognition Engine
This is the smartest part of the code. It automatically scans for popular technical analysis candlestick patterns. If a candle meets the rules, it awards Bonus Points to that direction's strength.
Bullish (Uptrend) Patterns and Criteria:
Hammer: Long lower wick, short upper wick (Buyers bought the dip). +25 points.
Bullish Engulfing: The green candle's body is larger than the previous red candle's body. +30 points.
Bullish Marubozu: A solid green candle with almost no wicks. +35 points.
Morning Star, Tweezer Bottom, Harami: Other classic reversal patterns.
Bearish (Downtrend) Patterns and Criteria:
Shooting Star: Long upper wick, short lower wick (Sellers hit from the top). +25 points.
Bearish Engulfing: The red body engulfs the previous green body. +30 points.
Bearish Marubozu: A solid, full red candle. +35 points.
Evening Star, Tweezer Top, Hanging Man: Classic bearish reversal patterns.
Part 3: Volume Confirmation
Low-volume rallies are usually traps. To solve this, the code divides the current candle's volume by the volume average of the last 20 candles (SMA). If the volume is above the average, the power is multiplied; if it is below, it reduces the score.
Part 4: Final Strength Calculation
The code aggregates all this data (Position in the candle + Volume + Bonus Points) and creates two pools: Raw Bullish Power and Raw Bearish Power. It then converts them into percentages:
Bullish Percentage = (Bullish Score / Total Score) * 100
For example, at the end of the calculation, the system tells you: "There is 80% Buying and 20% Selling pressure on this candle."
Part 5: Visualization, Tables, and Alerts
It displays the results on your screen for easy reading:
Sub-chart Lines: Draws dynamic Green and Red lines to show instantly who is in control.
Top-Right Table: Shows the real-time percentage status of the candle and the detected pattern name (e.g., Hammer).
Background Colors and Alerts: If either side exceeds a threshold you set in the settings (for example 75%), it paints the background of the screen and sends an automatic alert to your phone or computer.
GOOD LUCK!
Author:Rmzn4406
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.