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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน