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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.