Strategy vault / Trend following
SuperTrend Strategy for Ethereum Trading
This strategy is based on the SuperTrend indicator and uses ATR to dynamically set stop loss lines to profit from strong trends in Ethereum. It can run on the ETH/USD trading pair on Coinbase exchange.

Overview
This strategy is based on the SuperTrend indicator and uses ATR to dynamically set stop loss lines to profit from strong trends in Ethereum. It can run on the ETH/USD trading pair on Coinbase exchange.
Strategy Logic
The strategy uses a classic trend-following indicator - SuperTrend indicator to determine the trend direction. The SuperTrend indicator consists of two lines:
- Uptrend stop loss line to hold long positions in uptrends;
- Downtrend stop loss line to hold short positions in downtrends.
When price turns from uptrend to downtrend, open short position. When price turns from downtrend to uptrend, open long position.
In addition, the strategy utilizes the ATR indicator to dynamically adjust the stop loss line. Specifically, the uptrend stop loss line position is the average of highest high and lowest low minus ATR multiplied by a coefficient; the downtrend stop loss line position is the average of highest high and lowest low plus ATR multiplied by a coefficient. This allows adjusting the stop loss based on market volatility.
After entry signals are triggered, if price breaks back above the stop loss line, stop out with loss.
Advantages
This is a relatively mature trend following strategy with the following advantages:
- Use SuperTrend indicator to determine trend direction reliably;
- Apply adaptive ATR stop loss to effectively control risks;
- Simple and clear strategy logic, easy to understand and modify;
- Profitable in the high volatility cryptocurrency market.
Risks
There are also some risks with this strategy:
- Probability of SuperTrend indicator judging wrongly exists, may cause unnecessary losses;
- ATR stop loss may be too aggressive, stopped out by price reversals;
- High volatility in crypto markets increases probability of stop loss being hit;
- Higher transaction fees on some exchanges impacts final profitability.
To mitigate the above risks, ATR coefficient can be adjusted, or add filters with other indicators. Stop loss buffer can also be considered.
Improvement Directions
There is room for further improvements:
- Introduce more indicators to improve signal accuracy;
- Research optimal values for ATR length and coefficient;
- Implement dynamic position sizing based on risk-reward ratio;
- Test strategy effectiveness across more crypto trading pairs.
Conclusion
Overall this is a mature and reliable trend following strategy. It uses SuperTrend indicator to determine trend direction and adapts stop loss with ATR to control risks while profiting. The strategy works well for high volatility cryptocurrencies like Ethereum. Further optimizations can expand its application across more markets for steady outperformance.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 21 | ATR Period |
| v_input_2 | 6.2 | ATR Multiplier |
| v_input_3 | false | Take Wicks into Account ? |
| v_input_4 | false | Start from Specific Date ? |
| v_input_5 | 2019 | Start Year |
| v_input_6 | true | Start Month |
| v_input_7 | true | Start Day |
Source Pine Script
/*backtest
start: 2023-01-01 00:00:00
end: 2024-01-07 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("SuperTrend Strategy",
overlay=true,
initial_capital=2e3,
process_orders_on_close=true,
commission_type=strategy.commission.percent,
commission_value=0.1
)
length = input(title="ATR Period", type=input.integer, defval=21)
mult = input(title="ATR Multiplier", type=input.float, step=.25, defval=6.2)
wicks = input(title="Take Wicks into Account ?", type=input.bool, defval=false)
useDate = input(title="Start from Specific Date ?", defval=false)
yearStart = input(title="Start Year", defval=2019)
monthStart = input(title="Start Month", minval=1, maxval=12, defval=1)
dayStart = input(title="Start Day", minval=1, maxval=31, defval=1)
startTime = timestamp(yearStart, monthStart, dayStart, 0, 0)
startFrom = useDate ? time(timeframe.period) >= startTime : true
atr = mult * ta.atr(length)
longStop = hl2 - atr
longStopPrev = nz(longStop[1], longStop)
longStop := (wicks ? low[1] : close[1]) > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = hl2 + atr
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := (wicks ? high[1] : close[1]) < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and (wicks ? high : close) > shortStopPrev ? 1 : dir == 1 and (wicks ? low : close) < longStopPrev ? -1 : dir
longColor = color.green
shortColor = color.red
plot(dir == 1 ? longStop : na, title="Long Stop", style=plot.style_linebr, linewidth=2, color=longColor)
plotshape(dir == 1 and dir[1] == -1 ? longStop : na, title="Long Start", location=location.absolute, style=shape.circle, size=size.tiny, color=longColor, transp=0)
plot(dir == 1 ? na : shortStop, title="Short Stop", style=plot.style_linebr, linewidth=2, color=shortColor)
plotshape(dir == -1 and dir[1] == 1 ? shortStop : na, title="Short Start", location=location.absolute, style=shape.circle, size=size.tiny, color=shortColor, transp=0)
longCondition = dir[1] == -1 and dir == 1
if longCondition and startFrom
strategy.entry("Long", strategy.long, stop=longStop)
else
strategy.cancel("Long")
shortCondition = dir[1] == 1 and dir == -1
if shortCondition and startFrom
strategy.entry("Short", strategy.short, stop=shortStop)
else
strategy.cancel("Short")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-08. 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/SuperTrend-Strategy-for-Ethereum-Trading.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
- Advanced Supertrend Indicator Trading Mechanism Optimization StrategyPine Script · Trend following · 1d
- Dynamic Trend Following SuperTrend Triple Enhancement StrategyPine Script · Trend following · 1d
- Heiken Ashi and Super Trend Combination StrategyPine Script · Trend following · 1d
- Multi Indicator Dynamic Trend Following Strategy Based on EMA and SMAPine Script · Trend following · 1d
- Multi Period SuperTrend Dynamic Trading StrategyPine Script · Trend following · 1d
- Precision Trading Strategy and Risk Management System Based on SuperTrend IndicatorPine Script · Trend following · 1d