OPEN-SOURCE SCRIPT
HEMA Trend by Rostek (Filters + ATR + RR)

https://www.tradingview.com/x/MGwcCvxn/For testing by anyone. Enjoy! :)
HEMA Trend Levels with Gradient, ATR-based SL & TP, HTF Filter, and R/R Statistics
This advanced indicator is designed to help you detect high-quality trend crossovers using HEMA (Hull Exponential Moving Average) smoothing logic. It integrates dynamic visualization, strong multi-layer filters, and risk management levels — all in one package.
✅ Core Concept
The indicator plots two HEMAs (fast and slow), with a gradient fill between them that dynamically changes color based on the trend direction. Crossovers between these HEMAs generate potential trade signals (long or short).
🎨 Key Visual Features
Smooth gradient fill area between fast and slow HEMA.
Dynamic arrows marking crossover points (precisely above/below HEMA cross).
Optional ATR-based Stop Loss (SL) and Take Profit (TP) levels shown as dashed lines with labels.
Automatic display of calculated Risk/Reward (R/R) ratio next to TP level.
⚙️ Powerful Filters
You can enable/disable each of these filters individually:
✅ EMA Filter — Confirm signals only when the price is above/below a selected EMA (default: 100).
✅ ADX Filter — Confirms signals only if ADX value exceeds a set threshold (default: 20).
✅ RSI Filter — Filter signals based on RSI value (e.g., >50 for longs, <50 for shorts).
✅ Higher Time Frame (HTF) EMA Filter — Only take signals aligned with a higher timeframe EMA trend (e.g., daily EMA 100).
📏 Risk Management Features
ATR-based Stop Loss (SL): Dynamic stop level calculated using ATR, configurable multiplier (e.g., 1.5 × ATR).
ATR-based Take Profit (TP): Dynamic take profit level based on ATR, configurable multiplier (e.g., 3 × ATR).
Risk/Reward Statistics: Calculates and displays R/R ratio on the chart to help visually evaluate trade setups.
🔔 Alerts
A single unified alert condition for both long and short filtered signals, making it easy to set up TradingView alerts.
⚡ Usage Tips
Adjust HEMA lengths (default: 20 & 40) to tune responsiveness.
Enable/disable filters depending on your strategy and market conditions.
Fine-tune ATR multipliers for SL/TP based on your risk tolerance.
Use HTF filter to trade only in the direction of the main higher timeframe trend.
✅ Ideal for
Trend-following traders who want smoothed entries.
Traders looking for integrated visual risk management levels.
Users who want precise, customizable signals with strong filtering logic.
HEMA Trend Levels with Gradient, ATR-based SL & TP, HTF Filter, and R/R Statistics
This advanced indicator is designed to help you detect high-quality trend crossovers using HEMA (Hull Exponential Moving Average) smoothing logic. It integrates dynamic visualization, strong multi-layer filters, and risk management levels — all in one package.
✅ Core Concept
The indicator plots two HEMAs (fast and slow), with a gradient fill between them that dynamically changes color based on the trend direction. Crossovers between these HEMAs generate potential trade signals (long or short).
🎨 Key Visual Features
Smooth gradient fill area between fast and slow HEMA.
Dynamic arrows marking crossover points (precisely above/below HEMA cross).
Optional ATR-based Stop Loss (SL) and Take Profit (TP) levels shown as dashed lines with labels.
Automatic display of calculated Risk/Reward (R/R) ratio next to TP level.
⚙️ Powerful Filters
You can enable/disable each of these filters individually:
✅ EMA Filter — Confirm signals only when the price is above/below a selected EMA (default: 100).
✅ ADX Filter — Confirms signals only if ADX value exceeds a set threshold (default: 20).
✅ RSI Filter — Filter signals based on RSI value (e.g., >50 for longs, <50 for shorts).
✅ Higher Time Frame (HTF) EMA Filter — Only take signals aligned with a higher timeframe EMA trend (e.g., daily EMA 100).
📏 Risk Management Features
ATR-based Stop Loss (SL): Dynamic stop level calculated using ATR, configurable multiplier (e.g., 1.5 × ATR).
ATR-based Take Profit (TP): Dynamic take profit level based on ATR, configurable multiplier (e.g., 3 × ATR).
Risk/Reward Statistics: Calculates and displays R/R ratio on the chart to help visually evaluate trade setups.
🔔 Alerts
A single unified alert condition for both long and short filtered signals, making it easy to set up TradingView alerts.
⚡ Usage Tips
Adjust HEMA lengths (default: 20 & 40) to tune responsiveness.
Enable/disable filters depending on your strategy and market conditions.
Fine-tune ATR multipliers for SL/TP based on your risk tolerance.
Use HTF filter to trade only in the direction of the main higher timeframe trend.
✅ Ideal for
Trend-following traders who want smoothed entries.
Traders looking for integrated visual risk management levels.
Users who want precise, customizable signals with strong filtering logic.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.