OPEN-SOURCE SCRIPT
Renko ATR Trend + SMA Indicator by YCGH Capital

🧭 Overview
The Renko ATR Trend + SMA Indicator is a trend-following tool designed for chart trading.
It combines Renko-style price movement logic (based on ATR) with a Simple Moving Average (SMA) filter to identify sustained bullish or bearish phases on any timeframe.
It plots a color-coded trend line directly on the price chart — green for bullish trends, red for bearish — and maintains a single active state (no repeated buy/sell signals) until the opposite condition appears.
⚙️ How It Works
1️⃣ Renko ATR Engine
Instead of using fixed box sizes like classic Renko charts, this indicator builds synthetic Renko movement based on ATR (Average True Range) of a chosen timeframe.
It pulls OHLC data from your selected Renko Source Timeframe (for example, 60-minute candles).
It calculates an ATR brick size — representing the minimum price move needed for a new Renko brick.
When price moves by at least one ATR in the opposite direction, it flips the trend.
This filters out small fluctuations and captures the underlying directional bias.
2️⃣ SMA Filter
A Simple Moving Average (SMA) acts as a trend confirmation filter.
Only when Renko direction aligns with the price relative to the SMA, a trend signal activates.
BUY → Renko uptrend + price above SMA
SELL → Renko downtrend + price below SMA
3️⃣ Stateful Signal Logic
Unlike typical indicators that spam multiple buy/sell shapes:
This version holds one persistent signal (Buy or Sell)
The state continues until an opposite signal is confirmed
No “continuation” arrows — clean and minimal trend visualization
🎨 Visuals
Element Meaning
🟩 Green Renko Line Active Bullish Trend
🟥 Red Renko Line Active Bearish Trend
⚪ Gray Line Neutral / Waiting phase
🟡 Yellow Line SMA (trend filter)
📍 Label (Buy Active / Sell Active) Displays the current market bias
🔧 Inputs
Input Description
Renko Source Timeframe The timeframe from which Renko data is calculated (e.g., 60 = 1h candles).
ATR Period Determines brick size sensitivity (lower = more responsive, higher = smoother).
SMA Length Moving Average length used as a directional filter.
💡 How Traders Use It
Trend Confirmation:
Use green/red Renko line to stay aligned with the dominant market move.
Entry Timing:
Enter trades when a new Renko direction is confirmed along with SMA alignment.
Exit or Reverse:
Exit long when a red line (Sell Active) appears, and vice versa.
Combine with Price Action:
Add support/resistance or volume analysis for confirmation.
The Renko ATR Trend + SMA Indicator is a trend-following tool designed for chart trading.
It combines Renko-style price movement logic (based on ATR) with a Simple Moving Average (SMA) filter to identify sustained bullish or bearish phases on any timeframe.
It plots a color-coded trend line directly on the price chart — green for bullish trends, red for bearish — and maintains a single active state (no repeated buy/sell signals) until the opposite condition appears.
⚙️ How It Works
1️⃣ Renko ATR Engine
Instead of using fixed box sizes like classic Renko charts, this indicator builds synthetic Renko movement based on ATR (Average True Range) of a chosen timeframe.
It pulls OHLC data from your selected Renko Source Timeframe (for example, 60-minute candles).
It calculates an ATR brick size — representing the minimum price move needed for a new Renko brick.
When price moves by at least one ATR in the opposite direction, it flips the trend.
This filters out small fluctuations and captures the underlying directional bias.
2️⃣ SMA Filter
A Simple Moving Average (SMA) acts as a trend confirmation filter.
Only when Renko direction aligns with the price relative to the SMA, a trend signal activates.
BUY → Renko uptrend + price above SMA
SELL → Renko downtrend + price below SMA
3️⃣ Stateful Signal Logic
Unlike typical indicators that spam multiple buy/sell shapes:
This version holds one persistent signal (Buy or Sell)
The state continues until an opposite signal is confirmed
No “continuation” arrows — clean and minimal trend visualization
🎨 Visuals
Element Meaning
🟩 Green Renko Line Active Bullish Trend
🟥 Red Renko Line Active Bearish Trend
⚪ Gray Line Neutral / Waiting phase
🟡 Yellow Line SMA (trend filter)
📍 Label (Buy Active / Sell Active) Displays the current market bias
🔧 Inputs
Input Description
Renko Source Timeframe The timeframe from which Renko data is calculated (e.g., 60 = 1h candles).
ATR Period Determines brick size sensitivity (lower = more responsive, higher = smoother).
SMA Length Moving Average length used as a directional filter.
💡 How Traders Use It
Trend Confirmation:
Use green/red Renko line to stay aligned with the dominant market move.
Entry Timing:
Enter trades when a new Renko direction is confirmed along with SMA alignment.
Exit or Reverse:
Exit long when a red line (Sell Active) appears, and vice versa.
Combine with Price Action:
Add support/resistance or volume analysis for confirmation.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。