OPEN-SOURCE SCRIPT
BB + MA + Body Over Wick by KEROL

This indicator combines 3 technical analysis tools into one TradingView Pine Script:
---
# 1. Moving Average (MA 9 & MA 21)
It plots:
* **MA 9 (Blue)** → short-term trend
* **MA 21 (Red)** → medium-term trend
### How traders use it
* **MA9 above MA21** → bullish momentum
* **MA9 below MA21** → bearish momentum
* Crossovers can indicate trend changes.
### Example
* Blue crosses above Red → possible BUY momentum
* Blue crosses below Red → possible SELL momentum
---
# 2. Bollinger Bands (BB)
The script also plots:
* Upper Band
* Middle Band (20 SMA)
* Lower Band
Using:
* Length = 20
* Multiplier = 2
### What Bollinger Bands show
They measure:
* volatility
* overbought/oversold zones
* breakout potential
### Interpretation
* Price near **Upper BB** → market may be overbought
* Price near **Lower BB** → market may be oversold
* Bands expanding → high volatility
* Bands squeezing → possible breakout coming
---
# 3. Body Over Wick Signal
This is the custom signal logic.
## Bullish Signal (BULL label)
A bullish label appears when:
* current candle closes bullish (`close > open`)
* candle body breaks above previous candle high
Meaning:
* buyers are strong
* bullish momentum continuation
The script shows:
* green “BULL” label below candle
---
## Bearish Signal (BEAR label)
A bearish label appears when:
* current candle closes bearish (`close < open`)
* candle body breaks below previous candle low
Meaning:
* sellers are strong
* bearish momentum continuation
The script shows:
* red “BEAR” label above candle
---
# 4. Latest Signal Only
The script deletes old labels and keeps:
* only the latest BULL or BEAR signal visible
This keeps the chart clean.
---
# 5. Alerts
TradingView alerts can be created for:
* Bullish signal
* Bearish signal
Useful for:
* gold trading
* forex scalping
* breakout trading
* trend continuation setups
---
# Best Use Case
This indicator works best for:
* XAUUSD / Gold
* Forex
* Index scalping
* Intraday trend trading
Especially when:
* MA trend aligns
* price reacts at Bollinger Bands
* body-over-wick breakout appears
---
# Example Trading Idea
## BUY Setup
* MA9 above MA21
* Price near middle or lower BB
* BULL signal appears
→ Potential continuation upward.
## SELL Setup
* MA9 below MA21
* Price near middle or upper BB
* BEAR signal appears
→ Potential continuation downward.
---
# 1. Moving Average (MA 9 & MA 21)
It plots:
* **MA 9 (Blue)** → short-term trend
* **MA 21 (Red)** → medium-term trend
### How traders use it
* **MA9 above MA21** → bullish momentum
* **MA9 below MA21** → bearish momentum
* Crossovers can indicate trend changes.
### Example
* Blue crosses above Red → possible BUY momentum
* Blue crosses below Red → possible SELL momentum
---
# 2. Bollinger Bands (BB)
The script also plots:
* Upper Band
* Middle Band (20 SMA)
* Lower Band
Using:
* Length = 20
* Multiplier = 2
### What Bollinger Bands show
They measure:
* volatility
* overbought/oversold zones
* breakout potential
### Interpretation
* Price near **Upper BB** → market may be overbought
* Price near **Lower BB** → market may be oversold
* Bands expanding → high volatility
* Bands squeezing → possible breakout coming
---
# 3. Body Over Wick Signal
This is the custom signal logic.
## Bullish Signal (BULL label)
A bullish label appears when:
* current candle closes bullish (`close > open`)
* candle body breaks above previous candle high
Meaning:
* buyers are strong
* bullish momentum continuation
The script shows:
* green “BULL” label below candle
---
## Bearish Signal (BEAR label)
A bearish label appears when:
* current candle closes bearish (`close < open`)
* candle body breaks below previous candle low
Meaning:
* sellers are strong
* bearish momentum continuation
The script shows:
* red “BEAR” label above candle
---
# 4. Latest Signal Only
The script deletes old labels and keeps:
* only the latest BULL or BEAR signal visible
This keeps the chart clean.
---
# 5. Alerts
TradingView alerts can be created for:
* Bullish signal
* Bearish signal
Useful for:
* gold trading
* forex scalping
* breakout trading
* trend continuation setups
---
# Best Use Case
This indicator works best for:
* XAUUSD / Gold
* Forex
* Index scalping
* Intraday trend trading
Especially when:
* MA trend aligns
* price reacts at Bollinger Bands
* body-over-wick breakout appears
---
# Example Trading Idea
## BUY Setup
* MA9 above MA21
* Price near middle or lower BB
* BULL signal appears
→ Potential continuation upward.
## SELL Setup
* MA9 below MA21
* Price near middle or upper BB
* BEAR signal appears
→ Potential continuation downward.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.