OPEN-SOURCE SCRIPT
1H Candlestick vs EMA Crossover

# Description — 1H Candlestick vs EMA Crossover (Pine Script)
This indicator is built in **TradingView Pine Script v5** and is designed to track the relationship between the **1‑hour candlestick close** and the **1‑hour Exponential Moving Average (EMA)**. It works on any chart timeframe but always pulls in **1H data** using `request. security`.
### Core Features
* **Customizable EMA length** (default = 200)
* **Plots the 1H EMA** as an orange line on your chart
* Optionally shows the **1H close** as a faint gray line for reference
* Detects and highlights when the **1H candle close crosses above or below the 1H EMA**
* **Arrows**: Green triangles appear below the bar when a bullish crossover happens (1H close > EMA); red triangles appear above the bar when a bearish crossover happens (1H close < EMA)
* **Alerts**: Built‑in `alert condition` statements let you create TradingView alerts whenever a crossover occurs
### How to Use
1. Adjust the EMA length if you want a faster or slower moving average.
2. Enable alerts: Right‑click the chart → Add Alert → choose this indicator and select either “crossed ABOVE EMA” or “crossed BELOW EMA.”
### Trading Applications
* **Trend Confirmation**: Use the 1H EMA as a higher‑timeframe filter while trading on lower timeframes.
* **Entry/Exit Signals**: Crossovers can mark potential entry points for trend continuation or reversals.
* **Scalping/Intraday**: Even on a 5m or 15m chart, you can overlay the 1H EMA to align your trades with the bigger trend.
This makes the indicator a simple yet powerful tool for aligning trades with higher‑timeframe momentum and avoiding false signals from lower‑timeframe noise.
This indicator is built in **TradingView Pine Script v5** and is designed to track the relationship between the **1‑hour candlestick close** and the **1‑hour Exponential Moving Average (EMA)**. It works on any chart timeframe but always pulls in **1H data** using `request. security`.
### Core Features
* **Customizable EMA length** (default = 200)
* **Plots the 1H EMA** as an orange line on your chart
* Optionally shows the **1H close** as a faint gray line for reference
* Detects and highlights when the **1H candle close crosses above or below the 1H EMA**
* **Arrows**: Green triangles appear below the bar when a bullish crossover happens (1H close > EMA); red triangles appear above the bar when a bearish crossover happens (1H close < EMA)
* **Alerts**: Built‑in `alert condition` statements let you create TradingView alerts whenever a crossover occurs
### How to Use
1. Adjust the EMA length if you want a faster or slower moving average.
2. Enable alerts: Right‑click the chart → Add Alert → choose this indicator and select either “crossed ABOVE EMA” or “crossed BELOW EMA.”
### Trading Applications
* **Trend Confirmation**: Use the 1H EMA as a higher‑timeframe filter while trading on lower timeframes.
* **Entry/Exit Signals**: Crossovers can mark potential entry points for trend continuation or reversals.
* **Scalping/Intraday**: Even on a 5m or 15m chart, you can overlay the 1H EMA to align your trades with the bigger trend.
This makes the indicator a simple yet powerful tool for aligning trades with higher‑timeframe momentum and avoiding false signals from lower‑timeframe noise.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.