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.
The strategy uses a classic trend-following indicator - SuperTrend indicator to determine the trend direction. The SuperTrend indicator consists of two lines:
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.
This is a relatively mature trend following strategy with the following advantages:
There are also some risks with this strategy:
To mitigate the above risks, ATR coefficient can be adjusted, or add filters with other indicators. Stop loss buffer can also be considered.
There is room for further improvements:
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.
/*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")