Renko Trend Reversal Strategy

🔍 Purpose
The script is a strategy (not just an indicator) designed to simulate trading based on Renko-style trend changes, using smoothed price data to detect entries and exits.
🧠 How It Works
1. Trend Detection Using SMAs
It uses two simple moving averages (SMAs) to simulate a Renko-like trend signal:
renko_trend = ta.sma(close, 2) > ta.sma(close, 10) ? 1 : -1
If the short-term SMA (2) is above the long-term SMA (10), the trend is considered bullish (1).
If below, it's bearish (-1).
2. Trend Reversal Detection
A trend change is detected using:
trend_change = ta.change(renko_trend)
It checks if the renko_trend has flipped since the previous candle.
3. Trade Entry Conditions
A long trade is entered when the trend changes to bullish.
A short trade is entered when the trend changes to bearish.
if long_condition
strategy.entry("Long", strategy.long)
if short_condition
strategy.entry("Short", strategy.short)
4. Exit Conditions
Exits are handled using a trailing stop:
strategy.exit(..., trail_points = 50, trail_offset = 20)
A trailing stop loss of 50 points is used, activating only after the price moves 20 points in favor of the trade.
📈 Visualization
It plots the current trend (1 or -1) on the chart as a blue line, which helps you see trend direction changes visually.
⚙️ Strategy Settings
Uses 10% of equity per trade (default_qty_value = 10).
Works on regular candlestick charts, but mimics a Renko-style trend-following behavior.
✅ Summary
This strategy:
Enters trades on trend reversals based on short-term vs. long-term SMA crossover.
Uses trailing stops for exits.
Mimics Renko behavior without using real Renko bricks—just SMA-based smoothing.
🔍 Purpose
The script is a strategy (not just an indicator) designed to simulate trading based on Renko-style trend changes, using smoothed price data to detect entries and exits.
🧠 How It Works
1. Trend Detection Using SMAs
It uses two simple moving averages (SMAs) to simulate a Renko-like trend signal:
renko_trend = ta.sma(close, 2) > ta.sma(close, 10) ? 1 : -1
If the short-term SMA (2) is above the long-term SMA (10), the trend is considered bullish (1).
If below, it's bearish (-1).
2. Trend Reversal Detection
A trend change is detected using:
trend_change = ta.change(renko_trend)
It checks if the renko_trend has flipped since the previous candle.
3. Trade Entry Conditions
A long trade is entered when the trend changes to bullish.
A short trade is entered when the trend changes to bearish.
if long_condition
strategy.entry("Long", strategy.long)
if short_condition
strategy.entry("Short", strategy.short)
4. Exit Conditions
Exits are handled using a trailing stop:
strategy.exit(..., trail_points = 50, trail_offset = 20)
A trailing stop loss of 50 points is used, activating only after the price moves 20 points in favor of the trade.
📈 Visualization
It plots the current trend (1 or -1) on the chart as a blue line, which helps you see trend direction changes visually.
⚙️ Strategy Settings
Uses 10% of equity per trade (default_qty_value = 10).
Works on regular candlestick charts, but mimics a Renko-style trend-following behavior.
✅ Summary
This strategy:
Enters trades on trend reversals based on short-term vs. long-term SMA crossover.
Uses trailing stops for exits.
Mimics Renko behavior without using real Renko bricks—just SMA-based smoothing.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.