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. اقرأ المزيد في شروط الاستخدام.