OPEN-SOURCE SCRIPT
Crypto 1H [Universal - Strict + R:R]

Overview This indicator is a trend-following strategy designed specifically for the 1-hour timeframe (though it works universally). It focuses on high-probability "pullback" entries within an established trend.
What distinguishes this script from standard trend indicators is the integrated Risk:Reward (R:R) Pre-Filter. Before generating a signal, the script calculates the distance to the logical Stop Loss and the logical Take Profit (Resistance/Support). If the trade does not offer a minimum Risk-to-Reward ratio (default 1:2), the signal is suppressed.
How It Works
The strategy follows a strictly defined logical flow:
1. Trend Identification The script uses a Baseline EMA (Default: 50) to determine the trend.
Long: Price is above the 50 EMA, and the 50 EMA is sloping up.
Short: Price is below the 50 EMA, and the 50 EMA is sloping down.
2. The Pullback & Trigger Once a trend is identified, the script waits for price to pull back to the "Trigger" EMA (Default: 21).
The Wait Window: The script utilizes a "Max Wait Bars" logic. Once the price touches the Trigger EMA, it listens for an entry signal for exactly 3 bars. If price lingers too long without reacting, the setup is invalidated to avoid chopping markets.
3. The Risk:Reward Filter (Crucial) This is the final gatekeeper. Even if the trend and candle shape are perfect, the script performs a geometric check:
Stop Loss Calculation: Determined by the lowest low (for longs) or highest high (for shorts) of the last 5 bars, plus a small ATR buffer.
Target Calculation: Determined by the highest high or lowest low of the last 24 bars (local Support/Resistance).
The Math: If the distance to the Target is not at least 2.0x the distance to the Stop Loss, the trade is skipped. This prevents buying right into resistance or selling right into support.
Indicator Features & Settings
Session Filter: Defaults to London and NY sessions (UTC) to ensure volume is present.
Volatility Filter: Requires the signal candle to have a minimum body size (0.15% of price) to avoid "doji" or low-momentum entries.
Visuals:
White Line: 50 EMA (Trend)
Yellow Line: 21 EMA (Momentum Trigger)
Labels: Green (Long) and Red (Short) entry markers.
Red Crosses: These indicate exactly where the suggested Stop Loss was located at the moment of entry.
Risk Disclaimer This tool is designed for educational and analytical purposes. The "Strict R:R" filter does not guarantee profit; it simply filters out setups that mathematically do not fit the specified ratio based on historical price action. Always perform your own analysis.
What distinguishes this script from standard trend indicators is the integrated Risk:Reward (R:R) Pre-Filter. Before generating a signal, the script calculates the distance to the logical Stop Loss and the logical Take Profit (Resistance/Support). If the trade does not offer a minimum Risk-to-Reward ratio (default 1:2), the signal is suppressed.
How It Works
The strategy follows a strictly defined logical flow:
1. Trend Identification The script uses a Baseline EMA (Default: 50) to determine the trend.
Long: Price is above the 50 EMA, and the 50 EMA is sloping up.
Short: Price is below the 50 EMA, and the 50 EMA is sloping down.
2. The Pullback & Trigger Once a trend is identified, the script waits for price to pull back to the "Trigger" EMA (Default: 21).
The Wait Window: The script utilizes a "Max Wait Bars" logic. Once the price touches the Trigger EMA, it listens for an entry signal for exactly 3 bars. If price lingers too long without reacting, the setup is invalidated to avoid chopping markets.
3. The Risk:Reward Filter (Crucial) This is the final gatekeeper. Even if the trend and candle shape are perfect, the script performs a geometric check:
Stop Loss Calculation: Determined by the lowest low (for longs) or highest high (for shorts) of the last 5 bars, plus a small ATR buffer.
Target Calculation: Determined by the highest high or lowest low of the last 24 bars (local Support/Resistance).
The Math: If the distance to the Target is not at least 2.0x the distance to the Stop Loss, the trade is skipped. This prevents buying right into resistance or selling right into support.
Indicator Features & Settings
Session Filter: Defaults to London and NY sessions (UTC) to ensure volume is present.
Volatility Filter: Requires the signal candle to have a minimum body size (0.15% of price) to avoid "doji" or low-momentum entries.
Visuals:
White Line: 50 EMA (Trend)
Yellow Line: 21 EMA (Momentum Trigger)
Labels: Green (Long) and Red (Short) entry markers.
Red Crosses: These indicate exactly where the suggested Stop Loss was located at the moment of entry.
Risk Disclaimer This tool is designed for educational and analytical purposes. The "Strict R:R" filter does not guarantee profit; it simply filters out setups that mathematically do not fit the specified ratio based on historical price action. Always perform your own analysis.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.