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.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.