Strategy vault / Trend following
Dual direction Trend Tracking Renko Trading Strategy
This strategy is a dual-direction trend tracking Renko trading strategy based on the improved Supertrend indicator. The strategy mainly tracks price trends and generates trading signals at trend reversal points…

Overview
This strategy is a dual-direction trend tracking Renko trading strategy based on the improved Supertrend indicator. The strategy mainly tracks price trends and generates trading signals at trend reversal points, adopting a trend tracking trading approach.
Strategy Logic
The core indicator of this strategy is the improved Supertrend. Supertrend is a technical indicator that tracks price trends. This strategy modifies it in two main aspects:
Add a Factor parameter to adjust the sensitivity of Supertrend to control the trading frequency.
Add a Trend variable that changes its value when the price breaks through the upper or lower rail, generating trading signals.
When Trend is 1, it indicates an upward trend. When Trend is -1, it indicates a downward trend. This strategy generates long and short entry signals when the value of Trend changes, which is the trend reversal point.
In addition, this strategy also sets the pyramiding parameter to allow pyramiding trading. In a trending market, we can increase our position to track the trend.
Advantage Analysis
The main advantages of this strategy are:
- Using the improved Supertrend can better capture trend reversals.
- Adopting a trend tracking trading approach makes it easy to catch big moves along price trends.
- Allowing pyramiding can further amplify profits.
- The combination of Renko and trend indicator can effectively filter false breakouts.
Risk Analysis
There are also some risks in this strategy:
- When the trend weakens, there may be multiple reverse signals, resulting in over-trading.
- Too much pyramiding can amplify losses.
- Unable to determine the drawdown range, there is a certain degree of capital risk.
Countermeasures:
- Optimize the Factor parameter to ensure signals are only generated at reversal points.
- Limit the number of pyramiding to control risks.
- Adopt capital management to limit the percentage of loss per trade.
Optimization Directions
This strategy can also be optimized in several ways:
- Test the optimal Factor parameters for different markets.
- Try other types of trend indicators like DMI, MACD etc.
- Add stop loss strategies to lock in profits and limit losses.
- Combine with other indicators to filter entry timing.
Summary
Overall, this is a good trend tracking strategy. Compared with traditional trend tracking strategies, this strategy obtains more accurate trend reversals through the improved Supertrend, thereby producing higher quality trading signals. Live verification shows that after parameter optimization, this strategy can produce good trading results. However, traders still need to pay attention to risk control to avoid excessive losses.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | true | Trend Transition Signal |
| v_input_2 | true | Period |
Source Pine Script
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//╭╮╱╱╭╮╭╮╱╱╭╮
//┃╰╮╭╯┃┃┃╱╱┃┃
//╰╮┃┃╭┻╯┣╮╭┫╰━┳╮╭┳━━╮
//╱┃╰╯┃╭╮┃┃┃┃╭╮┃┃┃┃━━┫
//╱╰╮╭┫╰╯┃╰╯┃╰╯┃╰╯┣━━┃
//╱╱╰╯╰━━┻━━┻━━┻━━┻━━╯
//╭━━━┳╮╱╱╱╱╱╱╱╭╮
//┃╭━╮┃┃╱╱╱╱╱╱╱┃┃
//┃┃╱╰┫╰━┳━━┳━╮╭━╮╭━━┫┃
//┃┃╱╭┫╭╮┃╭╮┃╭╮┫╭╮┫┃━┫┃
//┃╰━╯┃┃┃┃╭╮┃┃┃┃┃┃┃┃━┫╰╮
//╰━━━┻╯╰┻╯╰┻╯╰┻╯╰┻━━┻━╯
//━╯
//Vdub Renko SniperVX1 v1 // ATR Setting = 1
// ©Vdubus http://www.vdubus.co.uk/
// study("Vdub Renko SniperVX1 v1", overlay=true, shorttitle="Vdub_Renko_SniperVX1_v1")
//@version=4
strategy(title = "Stripped Down Vdub Renko Sniper Strategy", shorttitle = "Vdub Renko Strat", overlay = true )
//Modified - Rajandran R Supertrend-----------------------------------------------------
Factor=input(1, minval=1,maxval = 1000, title="Trend Transition Signal")
Pd=input(1, minval=1,maxval = 1000, title="Period")
Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))
TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],0)
plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=1000, minheight=50)
plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=1000, minheight=50)
goLong = Trend == 1 and Trend[1] == -1
goShort = Trend == -1 and Trend[1] == 1
strategy.entry("longgg", strategy.long, when=goLong)
strategy.entry("shortttt", strategy.short, when=goShort)
strategy.exit("XL", from_entry = "long", profit = na, loss = na)
strategy.exit("XS", from_entry = "short", profit = na, loss = na)
Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-23. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Dual-direction-Trend-Tracking-Renko-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Multi Indicator Dynamic Trend Following Strategy Based on EMA and SMAPine Script · Trend following · 1d
- Advanced Quantitative Trading Strategy Multi Dimensional Super Trend ATR Dynamic Tracking SystemPine Script · Trend following · 1h
- Dual EMA Crossover Trend Following Strategy with ATR and ADX FiltersPine Script · Trend following · 1d
- EMA MACD SuperTrend ADX ATR Multi Indicator Trading Signal StrategyPine Script · Trend following · 1d
- Multi Indicator Trend Following Strategy with Bollinger Bands and ATR Dynamic Stop LossPine Script · Trend following · 1d
- Advanced Supertrend Indicator Trading Mechanism Optimization StrategyPine Script · Trend following · 1d