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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。