这是一个结合了SuperTrend、VWAP、EMA和ADX多个技术指标的趋势跟踪交易策略。该策略主要通过SuperTrend指标识别趋势方向,并利用VWAP和EMA的位置关系确认趋势,同时使用ADX指标过滤弱趋势,从而提供高准确度的交易信号。策略设计适用于日内交易,特别是在5分钟、15分钟和1小时等时间周期上。
策略的核心逻辑基于以下几个关键组成部分: 1. SuperTrend指标计算采用10周期的ATR和3.0的乘数,用于确定趋势方向。当价格突破上轨时形成多头趋势(绿色),突破下轨时形成空头趋势(红色)。 2. 21周期EMA用作动态支撑/阻力位,同时与VWAP共同确认趋势。当VWAP位于EMA之上时,具有多头偏向;反之则具有空头偏向。 3. ADX指标用于衡量趋势强度,当ADX数值大于25时表示趋势强劲,交易信号更可靠;低于25时表示趋势较弱,需要谨慎。 4. 入场条件包括: 买入信号:SuperTrend转为绿色(上升趋势确认)、收盘价在VWAP和EMA之上、ADX显示趋势强度。 卖出信号:SuperTrend转为红色(下降趋势确认)、收盘价在VWAP和EMA之下、ADX确认下降趋势强度。
这是一个结构完整、逻辑清晰的趋势跟踪策略。通过多重指标的配合使用,有效提高了交易信号的可靠性。策略的优势在于信号明确、易于执行,同时具有良好的可扩展性。但在实际应用中需要注意市场环境的选择,并做好风险控制。通过持续优化和完善,该策略有望在趋势性较强的市场中取得稳定收益。
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-08 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("SuperTrend on Steroids", overlay=true)
// Input parameters
atrLength = input(10, title="ATR Period")
atrMultiplier = input(3.0, title="ATR Multiplier")
emaLength = input(21, title="EMA Length")
adxLength = input(14, title="ADX Length")
adxSmoothing = input(14, title="ADX Smoothing")
// EMA Calculation
emaValue = ta.ema(close, emaLength)
// VWAP Calculation
vwapValue = ta.vwap(close)
// ATR Calculation
atrValue = ta.atr(atrLength)
// SuperTrend Calculation
var trend = 1
up = hl2 - atrMultiplier * atrValue
dn = hl2 + atrMultiplier * atrValue
up1 = nz(up[1], up)
dn1 = nz(dn[1], dn)
up := close[1] > up1 ? math.max(up, up1) : up
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
// ADX Calculation
[diplus, diminus, adx] = ta.dmi(adxLength, adxSmoothing)
// Buy/Sell Signals
buySignal = trend == 1 and trend[1] == -1
sellSignal = trend == -1 and trend[1] == 1
// Executing Trades
if buySignal
strategy.entry("Long", strategy.long)
if sellSignal
strategy.close("Long")
// Plotting SuperTrend Line
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_line, color=color.yellow, linewidth=2)
dnPlot = plot(trend == -1 ? dn : na, title="Down Trend", style=plot.style_line, color=color.red, linewidth=2)
// Buy/Sell Labels
plotshape(buySignal, title="Buy Signal", text="BUY", location=location.belowbar, style=shape.labelup, size=size.normal, color=color.green, textcolor=color.white, offset=-1)
plotshape(sellSignal, title="Sell Signal", text="SELL", location=location.abovebar, style=shape.labeldown, size=size.normal, color=color.red, textcolor=color.white, offset=1)
// Background Highlighting
fill(upPlot, dnPlot, color=trend == 1 ? color.new(color.green, 90) : color.new(color.red, 90), title="Trend Highlight")
//vwap and EMA
plot(emaValue, title="EMA", color=color.white, linewidth=2)
plot(vwapValue, title="VWAP", color=color.blue, linewidth=2)