# Measuring Bullish Strength from a Single Candlestick

- Channel: 量化交易科學園區 - 江加宏
- Published: 2023-04-20
- Series: [Quant Trading Science Park](https://xknow.app/en/s/quant-trading-science-park/?ref=agent) ([series index](https://xknow.app/en/s/quant-trading-science-park/llms.txt))
- Topics: [Technical Analysis](https://xknow.app/en/topics/technicals/llms.txt), [AI & Software Engineering](https://xknow.app/en/topics/ai-engineering/llms.txt)
- Page: https://xknow.app/en/v/quant-trading-science-park-ep13/?ref=agent
- YouTube: https://www.youtube.com/watch?v=5JM4LnEco5I

> The bullish strength indicator converts a single candlestick's open-to-low distance (defense) and close-to-high distance (offense) into a value to judge how aggressively major players are attacking, but it is not an entry signal and works only as a filter for deciding whether to lean long or short in day trading.

## Key ideas

- Bullish strength has two parts: the smaller the open-to-low distance as a share of the high-low range, the stronger the defense; the smaller the close-to-high share, the stronger the offense. The strongest defense is when the open is the low of the day.
- In code, subtract each distance share from 100 to get attack strength and defense strength, average the two into bullish strength, then take a moving average (the period is adjustable; the demo uses 5 days) so the curve does not swing too much from day to day and distort interpretation.
- When the high equals the low, the denominator is zero and the indicator breaks, so an if function checks first and returns the neutral value 50 when they are equal.
- Longsteel's bullish strength is mostly above the zero line, meaning major players are attacking aggressively and closing near the high; Acbel stays below the zero line for long periods, a common pattern of major players pushing the price up and quietly selling, leaving closes with upper shadows or black candles.
- Bullish strength cannot be used directly as an entry signal, but it works as a filter when picking day trading stocks: if it is positive over the long term, favor going long; if it is negative over the long term, shorting is stronger.

## Section summaries

### 0:05 How a Single Candlestick Defines Bullish Strength

Before writing the indicator, the definition of bullish strength must be clear. Taking a red candlestick as an example, the smaller the open-to-low distance share, the stronger the defense; the smaller the close-to-high distance share, the stronger the offense. This forms the basis of the indicator design.

[Page](https://xknow.app/en/v/quant-trading-science-park-ep13/?ref=agent#s-0) | [YouTube 0:05](https://www.youtube.com/watch?v=5JM4LnEco5I&t=5s)

### 2:15 Coding the Indicator and Handling Division by Zero

Attack strength and defense strength are each calculated by subtracting the distance share from 100, then averaged into bullish strength, and a 5-day moving average smooths the curve. To avoid a division-by-zero error when the high equals the low, an if function checks first and returns the neutral value 50 when they are equal.

[Page](https://xknow.app/en/v/quant-trading-science-park-ep13/?ref=agent#s-1) | [YouTube 2:15](https://www.youtube.com/watch?v=5JM4LnEco5I&t=135s)

### 7:45 Longsteel and Acbel Examples and Use as a Filter

After the chart settings are done, Longsteel and Acbel serve as examples: Longsteel's bullish strength is mostly above the zero line, meaning major players are attacking aggressively, while Acbel stays below the zero line for long periods. Bullish strength is not an entry signal but a filter for judging whether to lean long or short in day trading.

[Page](https://xknow.app/en/v/quant-trading-science-park-ep13/?ref=agent#s-2) | [YouTube 7:45](https://www.youtube.com/watch?v=5JM4LnEco5I&t=465s)

---

Full notes (with slides) and other episodes in this series: https://xknow.app/en/v/quant-trading-science-park-ep13/?ref=agent

Watch the original video: https://www.youtube.com/watch?v=5JM4LnEco5I
